commit 08abe87cfb509a491d7c7fdaa4351ec44337eea8 Author: cherubin Date: Tue Mar 17 13:31:18 2026 -0700 link start! diff --git a/VTBS/Template/FlatRateTemplate.px b/VTBS/Template/FlatRateTemplate.px new file mode 100755 index 0000000..3a58d5b --- /dev/null +++ b/VTBS/Template/FlatRateTemplate.px @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VTBS/Template/FlatRateTemplateSubBreakdown.px b/VTBS/Template/FlatRateTemplateSubBreakdown.px new file mode 100755 index 0000000..fc8967d --- /dev/null +++ b/VTBS/Template/FlatRateTemplateSubBreakdown.px @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VTBS/Template/FlatRateTemplateSubTotal.px b/VTBS/Template/FlatRateTemplateSubTotal.px new file mode 100755 index 0000000..2166705 --- /dev/null +++ b/VTBS/Template/FlatRateTemplateSubTotal.px @@ -0,0 +1,299 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VTBS/Template/MixedRateTemplateSubBreakdown.px b/VTBS/Template/MixedRateTemplateSubBreakdown.px new file mode 100755 index 0000000..88ba309 --- /dev/null +++ b/VTBS/Template/MixedRateTemplateSubBreakdown.px @@ -0,0 +1,355 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VTBS/Template/TimedTemplate.px b/VTBS/Template/TimedTemplate.px new file mode 100755 index 0000000..baa32f5 --- /dev/null +++ b/VTBS/Template/TimedTemplate.px @@ -0,0 +1,399 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/JD2XX.dll b/bin/JD2XX.dll new file mode 100755 index 0000000..d621c34 Binary files /dev/null and b/bin/JD2XX.dll differ diff --git a/bin/Microsoft.VC90.CRT.manifest b/bin/Microsoft.VC90.CRT.manifest new file mode 100755 index 0000000..d3c2afb --- /dev/null +++ b/bin/Microsoft.VC90.CRT.manifest @@ -0,0 +1,13 @@ + + + + + + + diff --git a/bin/Ndiscope.exe b/bin/Ndiscope.exe new file mode 100755 index 0000000..61cc51c Binary files /dev/null and b/bin/Ndiscope.exe differ diff --git a/bin/ProtInstall.exe b/bin/ProtInstall.exe new file mode 100755 index 0000000..5aa33af Binary files /dev/null and b/bin/ProtInstall.exe differ diff --git a/bin/REVerify2.exe b/bin/REVerify2.exe new file mode 100755 index 0000000..aea345f Binary files /dev/null and b/bin/REVerify2.exe differ diff --git a/bin/W64N55.dll b/bin/W64N55.dll new file mode 100755 index 0000000..1356350 Binary files /dev/null and b/bin/W64N55.dll differ diff --git a/bin/alarmDialog.dll b/bin/alarmDialog.dll new file mode 100755 index 0000000..fb22d4e Binary files /dev/null and b/bin/alarmDialog.dll differ diff --git a/bin/bacEther.dll b/bin/bacEther.dll new file mode 100755 index 0000000..8705580 Binary files /dev/null and b/bin/bacEther.dll differ diff --git a/bin/bajaui.dll b/bin/bajaui.dll new file mode 100755 index 0000000..5d486d0 Binary files /dev/null and b/bin/bajaui.dll differ diff --git a/bin/bport_exe.exe b/bin/bport_exe.exe new file mode 100755 index 0000000..6ff2bc9 Binary files /dev/null and b/bin/bport_exe.exe differ diff --git a/bin/build.exe b/bin/build.exe new file mode 100755 index 0000000..21942a2 Binary files /dev/null and b/bin/build.exe differ diff --git a/bin/checklicense.exe b/bin/checklicense.exe new file mode 100755 index 0000000..1ff8832 Binary files /dev/null and b/bin/checklicense.exe differ diff --git a/bin/common.dll b/bin/common.dll new file mode 100755 index 0000000..4d73be4 Binary files /dev/null and b/bin/common.dll differ diff --git a/bin/console.exe b/bin/console.exe new file mode 100755 index 0000000..9f3f6e3 Binary files /dev/null and b/bin/console.exe differ diff --git a/bin/cppunit.dll b/bin/cppunit.dll new file mode 100755 index 0000000..408289d Binary files /dev/null and b/bin/cppunit.dll differ diff --git a/bin/cryptoCore.jar b/bin/cryptoCore.jar new file mode 100755 index 0000000..3b399aa Binary files /dev/null and b/bin/cryptoCore.jar differ diff --git a/bin/cryptocore.dll b/bin/cryptocore.dll new file mode 100755 index 0000000..a8e5ca7 Binary files /dev/null and b/bin/cryptocore.dll differ diff --git a/bin/daemon.dll b/bin/daemon.dll new file mode 100755 index 0000000..dbd3556 Binary files /dev/null and b/bin/daemon.dll differ diff --git a/bin/daemonCrypto.jar b/bin/daemonCrypto.jar new file mode 100755 index 0000000..fdfa582 Binary files /dev/null and b/bin/daemonCrypto.jar differ diff --git a/bin/ddns.dll b/bin/ddns.dll new file mode 100755 index 0000000..b2a69bb Binary files /dev/null and b/bin/ddns.dll differ diff --git a/bin/ddns_tzo.dll b/bin/ddns_tzo.dll new file mode 100755 index 0000000..b3b7e32 Binary files /dev/null and b/bin/ddns_tzo.dll differ diff --git a/bin/dllwrap.exe b/bin/dllwrap.exe new file mode 100755 index 0000000..d2213af Binary files /dev/null and b/bin/dllwrap.exe differ diff --git a/bin/ext/activation-111.jar b/bin/ext/activation-111.jar new file mode 100755 index 0000000..29a59a9 Binary files /dev/null and b/bin/ext/activation-111.jar differ diff --git a/bin/ext/bcpkix-jdk15on-149.jar b/bin/ext/bcpkix-jdk15on-149.jar new file mode 100755 index 0000000..96d1985 Binary files /dev/null and b/bin/ext/bcpkix-jdk15on-149.jar differ diff --git a/bin/ext/bcprov-jdk15on-149.jar b/bin/ext/bcprov-jdk15on-149.jar new file mode 100755 index 0000000..e1d4bb3 Binary files /dev/null and b/bin/ext/bcprov-jdk15on-149.jar differ diff --git a/bin/ext/mail-145.jar b/bin/ext/mail-145.jar new file mode 100755 index 0000000..300f436 Binary files /dev/null and b/bin/ext/mail-145.jar differ diff --git a/bin/install-data/install.properties b/bin/install-data/install.properties new file mode 100755 index 0000000..9459669 --- /dev/null +++ b/bin/install-data/install.properties @@ -0,0 +1,145 @@ +############################################################################## +# +# Install.properties for Win32 Self-Extracting Installer +# +# %version% inserts the Niagara version number. +# +############################################################################## +window.title=Vykon AX Supervisor %version% including WorkPlace AX + +default.folder=C:\Niagara\Niagara-%version% +startMenu.folder=Vykon AX Supervisor %version% + +welcome.title=Installation +welcome.message= +welcome.message2=Welcome to the Vykon AX Supervisor %version% Installation Process +welcome.message3=This program will install the Vykon AX Supervisor %version% software onto your computer. + +licenseAgreement.title=License Agreement +licenseAgreement.yes=Yes +licenseAgreement.no=No +licenseAgreement.message=Please read the following license agreement: +licenseAgreement.accept=Do you accept this agreement? + +selectModules.title=Select Install Location +selectModules.destinationFolder=Destination Folder +button.default=Default +button.browse=Browse... +button.refresh=Refresh +install.dist=This instance of WorkPlace AX will be used as an installation tool +selectModules.spaceRequired=Space Required +selectModules.spaceAvailable=Space Available +selectModules.spaceAvailible=Space Available + +selectLexicons.title=Select Language Packages +lexicon.selectAll=Select All +selectLexicons.message=Select the language packages you wish to install: +selectLexicons.spaceReq=Additional Space Required: + +options.title=Select Options +install.startMenu=Install Start Menu Shortcuts +install.desktop=Install Desktop Shortcuts + +installing.title=Installing... + +finish.title=Finish Install +finish.message=AX Supervisor %version% Installation is Complete! +finish.launchMessage=Would you like to? +finish.screen=JADE_FINISH +finish.launchWbCommand=bin\\wb_w.exe +finish.script= + +############################################################################## +# +# Uninstall Properties +# +############################################################################## +uninstall.window.title=Vykon AX Supervisor %version% Uninstall + +uninstall.welcome.title=Uninstall +uninstall.welcome.message=Vykon AX Supervisor %version% Uninstall Program! +uninstall.welcome.message2=This program will uninstall the following software from your computer: + +uninstall.options.display=true +uninstall.options.title=Select Uninstall Options +uninstall.options.message=Please select from the following uninstall options: +uninstall.options.saveStations=Save station files. +uninstall.options.saveUsers=Save user files. + +uninstall.uninstalling.title=Uninstalling... + +uninstall.finish.title=Finished +uninstall.finish.message=Vykon AX Supervisor %version% Uninstall is Complete! + +############################################################################## +# Shortcuts +# +# - must be numbered sequentially, starting with 0 +# - all paths are relative to the install directory +# - attributes: (* = required) +# .bin * path to executable, relative to install dir. +# .lnk * name of shortcut +# .start * normal or min +# .description description for mouseovers - defaults to "" +# .startmenu display shortcut on start menu - defaults to true +# .desktop display shortcut on desktop - defaults to true +# .iconLocation path to file containing the alternate icon for the shortcut +# .iconIndex index of icon in file +# +############################################################################## + +shortcut.0.bin=bin\\wb_w.exe +shortcut.0.lnk=WorkPlace AX +shortcut.0.start=normal +shortcut.0.description=Shortcut to WorkPlace AX +shortcut.0.desktop=true + +shortcut.1.bin=bin\\wb.exe +shortcut.1.lnk=WorkPlace AX (Console) +shortcut.1.start=normal +shortcut.1.description=Shortcut to WorkPlace AX +shortcut.1.desktop=false + +shortcut.2.bin=bin\\console.exe +shortcut.2.lnk=Console +shortcut.2.start=normal +shortcut.2.description=Shortcut to Console +shortcut.2.desktop=false + +shortcut.3.bin=bin\\wb_w.exe +shortcut.3.args=-profile:alarm:AlarmPortalProfile +shortcut.3.lnk=Alarm Portal +shortcut.3.start=normal +shortcut.3.description=Niagara Alarm Portal +shortcut.3.desktop=true +shortcut.3.iconLocation=bin\\trayIcon.dll +shortcut.3.iconIndex=0 + +shortcut.4.bin=bin\\station.exe +shortcut.4.args=demo +shortcut.4.lnk=Demo Station +shortcut.4.start=min +shortcut.4.description=Run the Demo Station +shortcut.4.startmenu=true +shortcut.4.desktop=false + +shortcut.5.bin=bin\\uninstall.exe +shortcut.5.lnk=Uninstall +shortcut.5.start=normal +shortcut.5.description=Uninstall Niagara %version% +shortcut.5.desktop=false + +shortcut.6.bin=bin\\plat.exe +shortcut.6.args=installdaemon +shortcut.6.lnk=Install Platform Daemon +shortcut.6.start=normal +shortcut.6.description=Install Platform Daemon %version% +shortcut.6.desktop=false + +shortcut.7.bin=docs\\index.html +shortcut.7.lnk=Vykon Document Library +shortcut.7.start=normal +shortcut.7.description=Vykon Document Library +shortcut.7.startmenu=true +shortcut.7.desktop=false +shortcut.7.iconLocation=bin\\uninstall.exe diff --git a/bin/install-data/sidebarImage.bmp b/bin/install-data/sidebarImage.bmp new file mode 100755 index 0000000..802b88e Binary files /dev/null and b/bin/install-data/sidebarImage.bmp differ diff --git a/bin/install-data/titleImage.bmp b/bin/install-data/titleImage.bmp new file mode 100755 index 0000000..f3553f0 Binary files /dev/null and b/bin/install-data/titleImage.bmp differ diff --git a/bin/jikes.exe b/bin/jikes.exe new file mode 100755 index 0000000..26ea1fd Binary files /dev/null and b/bin/jikes.exe differ diff --git a/bin/libeay32.dll b/bin/libeay32.dll new file mode 100755 index 0000000..fbe886b Binary files /dev/null and b/bin/libeay32.dll differ diff --git a/bin/linePrinter.dll b/bin/linePrinter.dll new file mode 100755 index 0000000..a97f094 Binary files /dev/null and b/bin/linePrinter.dll differ diff --git a/bin/msvcm90.dll b/bin/msvcm90.dll new file mode 100755 index 0000000..45fdb91 Binary files /dev/null and b/bin/msvcm90.dll differ diff --git a/bin/msvcp90.dll b/bin/msvcp90.dll new file mode 100755 index 0000000..a1727ca Binary files /dev/null and b/bin/msvcp90.dll differ diff --git a/bin/msvcr100.dll b/bin/msvcr100.dll new file mode 100755 index 0000000..329b111 Binary files /dev/null and b/bin/msvcr100.dll differ diff --git a/bin/msvcr90.dll b/bin/msvcr90.dll new file mode 100755 index 0000000..0ae568a Binary files /dev/null and b/bin/msvcr90.dll differ diff --git a/bin/nBacES60.inf b/bin/nBacES60.inf new file mode 100755 index 0000000..09c4c76 --- /dev/null +++ b/bin/nBacES60.inf @@ -0,0 +1,85 @@ +;------------------------------------------------------------------------- +; nBacES60.INF -- NDIS 6.0 SPR Protocol Driver for Niagara +; +; Copyright (c) 2010, Tridium, Inc. +; Copyright (c) 2008-2010, Printing Communications Assoc., Inc. (PCAUSA) +;------------------------------------------------------------------------- +[version] +Signature = "$Windows NT$" +Class = NetTrans +ClassGUID = {4d36e975-e325-11ce-bfc1-08002be10318} +Provider = %PcaUsa% +CatalogFile = nBacES60.cat +DriverVer=07/18/2010,6.00.30.02 + +[Manufacturer] +%PcaUsa%=PCAUSA,NTAMD64 + +[PCAUSA.NTAMD64] +%nBacES60_Desc%=Install, PCA_NBACES60 + +;------------------------------------------------------------------------- +; Installation Section +;------------------------------------------------------------------------- +[Install] +AddReg=Inst_Ndi +Characteristics=0x8 ; NCF_HIDDEN +CopyFiles=CpyFiles_Sys + +;------------------------------------------------------------------------- +; Ndi installation support +;------------------------------------------------------------------------- +[Inst_Ndi] +HKR,Ndi,Service,,"nBacES60" +HKR,Ndi,HelpText,,%nBacES60_HelpText% +HKR,Ndi\Interfaces, UpperRange,, noupper +HKR,"Ndi\Interfaces","LowerRange",,"ndis6,ndis5,ethernet" + +;------------------------------------------------------------------------- +; Service installation support +;------------------------------------------------------------------------- +[Install.Services] +AddService=nBacES60,,nBacES60_Service_Inst + +[nBacES60_Service_Inst] +DisplayName = %nBacES60_Desc% +ServiceType = 1 ;SERVICE_KERNEL_DRIVER +StartType = 3 ;SERVICE_DEMAND_START +ErrorControl = 1 ;SERVICE_ERROR_NORMAL +ServiceBinary = %12%\nBacES60.sys +LoadOrderGroup = NDIS +Description = %nBacES60_Desc% + +[Install.Remove.Services] +DelService=nBacES60,0x200 + +;------------------------------------------------------------------------- +; Declare Destination Directories for file copy/deletion +;------------------------------------------------------------------------- +[SourceDisksNames] +1=%DiskDescription%,"",, + +[SourceDisksFiles] +nBacES60.sys=1 + + +[DestinationDirs] +CpyFiles_Sys = 12 ; DIRID_DRIVERS + + +;------------------------------------------------------------------------- +; Files to Copy/Delete - Referenced by Install and Remove sections above +;------------------------------------------------------------------------- +[CpyFiles_Sys] +nBacES60.sys,,,2 + +[Strings] +PcaUsa = "Tridium, Inc." +DiskDescription = "Niagara Protocol Driver Disk" +nBacES60_Desc = "NDIS 6.0 SPR Protocol Driver for Niagara" +nBacES60_HelpText = "NDIS 6.0 SPR Protocol Driver for Niagara" + + + + + diff --git a/bin/nBacES60.sys b/bin/nBacES60.sys new file mode 100755 index 0000000..9173da3 Binary files /dev/null and b/bin/nBacES60.sys differ diff --git a/bin/nbaces60.cat b/bin/nbaces60.cat new file mode 100755 index 0000000..da349a8 Binary files /dev/null and b/bin/nbaces60.cat differ diff --git a/bin/niagaraBasicProvider.jar b/bin/niagaraBasicProvider.jar new file mode 100755 index 0000000..3468f90 Binary files /dev/null and b/bin/niagaraBasicProvider.jar differ diff --git a/bin/niagarad.exe b/bin/niagarad.exe new file mode 100755 index 0000000..e20a8ef Binary files /dev/null and b/bin/niagarad.exe differ diff --git a/bin/niagarad.jar b/bin/niagarad.jar new file mode 100755 index 0000000..29560bb Binary files /dev/null and b/bin/niagarad.jar differ diff --git a/bin/nre.dll b/bin/nre.dll new file mode 100755 index 0000000..612aee9 Binary files /dev/null and b/bin/nre.dll differ diff --git a/bin/nre.exe b/bin/nre.exe new file mode 100755 index 0000000..a804897 Binary files /dev/null and b/bin/nre.exe differ diff --git a/bin/nre.jar b/bin/nre.jar new file mode 100755 index 0000000..d3effcc Binary files /dev/null and b/bin/nre.jar differ diff --git a/bin/nreVersion.xml b/bin/nreVersion.xml new file mode 100755 index 0000000..7658ad5 --- /dev/null +++ b/bin/nreVersion.xml @@ -0,0 +1,2 @@ + + diff --git a/bin/opc.dll b/bin/opc.dll new file mode 100755 index 0000000..fe6f5cd Binary files /dev/null and b/bin/opc.dll differ diff --git a/bin/opcae.dll b/bin/opcae.dll new file mode 100755 index 0000000..38e50cb Binary files /dev/null and b/bin/opcae.dll differ diff --git a/bin/opccomn_ps.dll b/bin/opccomn_ps.dll new file mode 100755 index 0000000..7e8b882 Binary files /dev/null and b/bin/opccomn_ps.dll differ diff --git a/bin/opcproxy.dll b/bin/opcproxy.dll new file mode 100755 index 0000000..13ce8f5 Binary files /dev/null and b/bin/opcproxy.dll differ diff --git a/bin/plat.exe b/bin/plat.exe new file mode 100755 index 0000000..8e14ccf Binary files /dev/null and b/bin/plat.exe differ diff --git a/bin/platbport.dll b/bin/platbport.dll new file mode 100755 index 0000000..12b6aed Binary files /dev/null and b/bin/platbport.dll differ diff --git a/bin/platform.dll b/bin/platform.dll new file mode 100755 index 0000000..522fa5d Binary files /dev/null and b/bin/platform.dll differ diff --git a/bin/rxtxParallel.dll b/bin/rxtxParallel.dll new file mode 100755 index 0000000..92666dd Binary files /dev/null and b/bin/rxtxParallel.dll differ diff --git a/bin/rxtxSerial.dll b/bin/rxtxSerial.dll new file mode 100755 index 0000000..211e006 Binary files /dev/null and b/bin/rxtxSerial.dll differ diff --git a/bin/showAdapters.exe b/bin/showAdapters.exe new file mode 100755 index 0000000..77aeb78 Binary files /dev/null and b/bin/showAdapters.exe differ diff --git a/bin/slot.exe b/bin/slot.exe new file mode 100755 index 0000000..d10b505 Binary files /dev/null and b/bin/slot.exe differ diff --git a/bin/ssleay32.dll b/bin/ssleay32.dll new file mode 100755 index 0000000..28daf3f Binary files /dev/null and b/bin/ssleay32.dll differ diff --git a/bin/station.exe b/bin/station.exe new file mode 100755 index 0000000..a34f3c0 Binary files /dev/null and b/bin/station.exe differ diff --git a/bin/test.dll b/bin/test.dll new file mode 100755 index 0000000..0007bb6 Binary files /dev/null and b/bin/test.dll differ diff --git a/bin/test.exe b/bin/test.exe new file mode 100755 index 0000000..ba1e78a Binary files /dev/null and b/bin/test.exe differ diff --git a/bin/trayIcon.dll b/bin/trayIcon.dll new file mode 100755 index 0000000..623dbef Binary files /dev/null and b/bin/trayIcon.dll differ diff --git a/bin/txSimple.exe b/bin/txSimple.exe new file mode 100755 index 0000000..f9b2993 Binary files /dev/null and b/bin/txSimple.exe differ diff --git a/bin/uninstall.exe b/bin/uninstall.exe new file mode 100755 index 0000000..56ba47e Binary files /dev/null and b/bin/uninstall.exe differ diff --git a/bin/wb.exe b/bin/wb.exe new file mode 100755 index 0000000..b554232 Binary files /dev/null and b/bin/wb.exe differ diff --git a/bin/wb_w.exe b/bin/wb_w.exe new file mode 100755 index 0000000..01d7e40 Binary files /dev/null and b/bin/wb_w.exe differ diff --git a/bin/wireless.dll b/bin/wireless.dll new file mode 100755 index 0000000..9072d7a Binary files /dev/null and b/bin/wireless.dll differ diff --git a/bin/zlibwapi.dll b/bin/zlibwapi.dll new file mode 100755 index 0000000..66e8f74 Binary files /dev/null and b/bin/zlibwapi.dll differ diff --git a/certificates/Honeywell.certificate b/certificates/Honeywell.certificate new file mode 100755 index 0000000..fbceccc --- /dev/null +++ b/certificates/Honeywell.certificate @@ -0,0 +1,13 @@ + + +MIIBuDCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZ +pRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1 +fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCo +uuEC/BYHPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCB +gLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqh +RkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYUAAoGBAN0wyG60Cyu7lZF/Uoq+64tqcqgc0q +w2CoGF/PyGUXView5oOs+IqD/k9JVIbrjq+AfJ5CG9dtxzpf8AenkZkrhWBFlhb+gXa9klJAE5Y +o1Wg2ziGqaSSBUYpVcVf2jfE7rm3OMDHNnwNX7+d9ysgBHZn4hTyqGU65Pfk4ylsN8U + + MCwCFFuDNX00tdsOr8DWUf5cYMp2784UAhQi3tiWmf8lcn6Gyi67/ezFlEtRTg== + diff --git a/certificates/Tridium.certificate b/certificates/Tridium.certificate new file mode 100755 index 0000000..7f15a56 --- /dev/null +++ b/certificates/Tridium.certificate @@ -0,0 +1,13 @@ + + +MIIBtzCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZ +pRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1 +fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCo +uuEC/BYHPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCB +gLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqh +RkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYQAAoGACo/ytO+Pq+JBhXSiC1VhdTc5f6MBId +NbaBJ+Xr+y8BHPCHEWMqAhs2i3hSfck+lY++A7ilXWhQqyhry1wE3qWGPKLVGAoJltIzUCaD5cg +aNnjjx7gNHtHI+afH+IeBQSzbiSXaP2sRk/Nm1avsdVjKXaysPWB6l5lZB097NTI7I= + + MC0CFQCWeuny190mtvpsHDo9UIJoLlEBPAIUVm/vjfqReAvrHUwoXIH//ik9dcE= + diff --git a/cleanDist/qnx-jace-james-etfs2048-clean.dist b/cleanDist/qnx-jace-james-etfs2048-clean.dist new file mode 100755 index 0000000..8112792 Binary files /dev/null and b/cleanDist/qnx-jace-james-etfs2048-clean.dist differ diff --git a/cleanDist/qnx-jace-james-etfs512-clean.dist b/cleanDist/qnx-jace-james-etfs512-clean.dist new file mode 100755 index 0000000..f09cfac Binary files /dev/null and b/cleanDist/qnx-jace-james-etfs512-clean.dist differ diff --git a/cleanDist/qnx-jace-javelina_booke-etfs2048-clean.dist b/cleanDist/qnx-jace-javelina_booke-etfs2048-clean.dist new file mode 100755 index 0000000..7fa26b2 Binary files /dev/null and b/cleanDist/qnx-jace-javelina_booke-etfs2048-clean.dist differ diff --git a/cleanDist/qnx-jace-npm2xx-etfs2048-clean.dist b/cleanDist/qnx-jace-npm2xx-etfs2048-clean.dist new file mode 100755 index 0000000..b8a0d56 Binary files /dev/null and b/cleanDist/qnx-jace-npm2xx-etfs2048-clean.dist differ diff --git a/cleanDist/qnx-jace-npm2xx-etfs512-clean.dist b/cleanDist/qnx-jace-npm2xx-etfs512-clean.dist new file mode 100755 index 0000000..3ae6869 Binary files /dev/null and b/cleanDist/qnx-jace-npm2xx-etfs512-clean.dist differ diff --git a/cleanDist/qnx-jace-npm3xx-etfs2048-clean.dist b/cleanDist/qnx-jace-npm3xx-etfs2048-clean.dist new file mode 100755 index 0000000..ae48804 Binary files /dev/null and b/cleanDist/qnx-jace-npm3xx-etfs2048-clean.dist differ diff --git a/cleanDist/qnx-jace-npm6e-etfs2048-clean.dist b/cleanDist/qnx-jace-npm6e-etfs2048-clean.dist new file mode 100755 index 0000000..25f69dc Binary files /dev/null and b/cleanDist/qnx-jace-npm6e-etfs2048-clean.dist differ diff --git a/cleanDist/qnx-jace-npm6xx-etfs2048-clean.dist b/cleanDist/qnx-jace-npm6xx-etfs2048-clean.dist new file mode 100755 index 0000000..82bac94 Binary files /dev/null and b/cleanDist/qnx-jace-npm6xx-etfs2048-clean.dist differ diff --git a/cleanDist/qnx-jace-titan-am335x-clean.dist b/cleanDist/qnx-jace-titan-am335x-clean.dist new file mode 100755 index 0000000..f211c56 Binary files /dev/null and b/cleanDist/qnx-jace-titan-am335x-clean.dist differ diff --git a/cleanDist/qnx-jace-york-etfs2048-clean.dist b/cleanDist/qnx-jace-york-etfs2048-clean.dist new file mode 100755 index 0000000..a48c8d0 Binary files /dev/null and b/cleanDist/qnx-jace-york-etfs2048-clean.dist differ diff --git a/cleanDist/qnx-jace-york-etfs512-clean.dist b/cleanDist/qnx-jace-york-etfs512-clean.dist new file mode 100755 index 0000000..53e6e97 Binary files /dev/null and b/cleanDist/qnx-jace-york-etfs512-clean.dist differ diff --git a/conversion/AXtoN4-qnx-jace-titan-am335x.dist b/conversion/AXtoN4-qnx-jace-titan-am335x.dist new file mode 100755 index 0000000..233ab08 Binary files /dev/null and b/conversion/AXtoN4-qnx-jace-titan-am335x.dist differ diff --git a/decompiled/Honeywell_logo.png b/decompiled/Honeywell_logo.png new file mode 100644 index 0000000..1fd52ff Binary files /dev/null and b/decompiled/Honeywell_logo.png differ diff --git a/decompiled/META-INF/maven/com.beust/jcommander/pom.xml b/decompiled/META-INF/maven/com.beust/jcommander/pom.xml new file mode 100644 index 0000000..ed23a7b --- /dev/null +++ b/decompiled/META-INF/maven/com.beust/jcommander/pom.xml @@ -0,0 +1,265 @@ + + + + 4.0.0 + com.beust + jcommander + jar + JCommander + 1.13 + A Java framework to parse command line options with annotations. + http://beust.com/jcommander + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + scm:git:git@github.com:cbeust/jcommander.git + scm:git:git@github.com:cbeust/jcommander.git + git@github.com:cbeust/jcommander.git + + + + + Cedric Beust + + + + + org.sonatype.oss + oss-parent + 3 + + + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.1.1 + + + attach-sources + + jar + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.1 + + 1.5 + 1.5 + UTF-8 + + + + + + org.apache.maven.plugins + maven-resources-plugin + 2.4.1 + + UTF-8 + + + + + + org.apache.felix + maven-bundle-plugin + 2.1.0 + + + bundle-manifest + process-classes + + manifest + + + + <_versionpolicy>$(@) + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.3.1 + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + + + org.apache.felix + maven-bundle-plugin + 2.1.0 + + + bundle-manifest + process-classes + + manifest + + + + <_versionpolicy>$(@) + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.3.1 + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.7 + + *.internal + + + + + + + + org.testng + testng + 5.14.4 + jar + test + + + + + + + + license + + + + com.mycila.maven-license-plugin + maven-license-plugin + 1.7.0 + + false +
src/main/license/license-header.txt
+ + src/** + pom.xml + + + **/.git/** + + **/target/** + + false +
+ + + + check + + + +
+
+
+
+ + + + sign + + + + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + + +
+ +
+ diff --git a/decompiled/META-INF/maven/commons-collections/commons-collections/pom.xml b/decompiled/META-INF/maven/commons-collections/commons-collections/pom.xml new file mode 100644 index 0000000..2e0c4d0 --- /dev/null +++ b/decompiled/META-INF/maven/commons-collections/commons-collections/pom.xml @@ -0,0 +1,439 @@ + + + + + org.apache.commons + commons-parent + 9 + + 4.0.0 + commons-collections + commons-collections + 3.2.1 + Commons Collections + + 2001 + Types that extend and augment the Java Collections Framework. + + http://commons.apache.org/collections/ + + + jira + http://issues.apache.org/jira/browse/COLLECTIONS + + + + scm:svn:http://svn.apache.org/repos/asf/commons/proper/collections/trunk + scm:svn:https://svn.apache.org/repos/asf/commons/proper/collections/trunk + http://svn.apache.org/viewvc/commons/proper/collections/trunk + + + + + Stephen Colebourne + scolebourne + + + + + Morgan Delagrange + morgand + + + + + Matthew Hawthorne + matth + + + + + Geir Magnusson + geirm + + + + + Craig McClanahan + craigmcc + + + + + Phil Steitz + psteitz + + + + + Arun M. Thomas + amamment + + + + + Rodney Waldhoff + rwaldhoff + + + + + Henri Yandell + bayard + + + + + James Carman + jcarman + + + + + Robert Burrell Donkin + rdonkin + + + + + + Rafael U. C. Afonso + + + Max Rydahl Andersen + + + Federico Barbieri + + + Arron Bates + + + Nicola Ken Barozzi + + + Sebastian Bazley + + + Matt Benson + + + Ola Berg + + + Christopher Berry + + + Nathan Beyer + + + Janek Bogucki + + + Chuck Burdick + + + Dave Bryson + + + Julien Buret + + + Jonathan Carlson + + + Ram Chidambaram + + + Steve Clark + + + Eric Crampton + + + Dimiter Dimitrov + + + Peter Donald + + + Steve Downey + + + Rich Dougherty + + + Tom Dunham + + + Stefano Fornari + + + Andrew Freeman + + + Gerhard Froehlich + + + Paul Jack + + + Eric Johnson + + + Kent Johnson + + + Marc Johnson + + + Nissim Karpenstein + + + Shinobu Kawai + + + Mohan Kishore + + + Simon Kitching + + + Thomas Knych + + + Serge Knystautas + + + Peter KoBek + + + Jordan Krey + + + Olaf Krische + + + Guilhem Lavaux + + + Paul Legato + + + David Leppik + + + Berin Loritsch + + + Hendrik Maryns + + + Stefano Mazzocchi + + + Brian McCallister + + + Steven Melzer + + + Leon Messerschmidt + + + Mauricio S. Moura + + + Kasper Nielsen + + + Stanislaw Osinski + + + Alban Peignier + + + Mike Pettypiece + + + Steve Phelps + + + Ilkka Priha + + + Jonas Van Poucke + + + Will Pugh + + + Herve Quiroz + + + Daniel Rall + + + Robert Ribnitz + + + Huw Roberts + + + Henning P. Schmiedehausen + + + Howard Lewis Ship + + + Joe Raysa + + + Thomas Schapitz + + + Jon Schewe + + + Andreas Schlosser + + + Christian Siefkes + + + Michael Smith + + + Stephen Smith + + + Jan Sorensen + + + Jon S. Stevens + + + James Strachan + + + Leo Sutic + + + Chris Tilden + + + Neil O'Toole + + + Jeff Turner + + + Kazuya Ujihara + + + Jeff Varszegi + + + Ralph Wagner + + + David Weinrich + + + Dieter Wimberger + + + Serhiy Yevtushenko + + + Jason van Zyl + + + + + + junit + junit + 3.8.1 + test + + + + + 1.2 + 1.2 + collections + 3.2.1 + -bin + COLLECTIONS + 12310465 + + + + src/java + src/test + + + org.apache.maven.plugins + maven-surefire-plugin + + + org/apache/commons/collections/TestAllPackages.java + + + + + maven-antrun-plugin + + + package + + + + + + + + + + + + + run + + + + + + maven-assembly-plugin + + + src/assembly/bin.xml + src/assembly/src.xml + + gnu + + + + + + + diff --git a/decompiled/META-INF/maven/commons-lang/commons-lang/pom.xml b/decompiled/META-INF/maven/commons-lang/commons-lang/pom.xml new file mode 100644 index 0000000..0cc1a9f --- /dev/null +++ b/decompiled/META-INF/maven/commons-lang/commons-lang/pom.xml @@ -0,0 +1,463 @@ + + + + + org.apache.commons + commons-parent + 9 + + 4.0.0 + commons-lang + commons-lang + 2.4 + Commons Lang + + 2001 + + Commons Lang, a package of Java utility classes for the + classes that are in java.lang's hierarchy, or are considered to be so + standard as to justify existence in java.lang. + + + http://commons.apache.org/lang/ + + + jira + http://issues.apache.org/jira/browse/LANG + + + + scm:svn:http://svn.apache.org/repos/asf/commons/proper/lang/trunk + scm:svn:https://svn.apache.org/repos/asf/commons/proper/lang/trunk + http://svn.apache.org/viewvc/commons/proper/lang/trunk + + + + + Daniel Rall + dlr + dlr@finemaltcoding.com + CollabNet, Inc. + + Java Developer + + + + Stephen Colebourne + scolebourne + scolebourne@joda.org + SITA ATS Ltd + 0 + + Java Developer + + + + Henri Yandell + bayard + bayard@apache.org + + + Java Developer + + + + Steven Caswell + scaswell + stevencaswell@apache.org + + + Java Developer + + -5 + + + Robert Burrell Donkin + rdonkin + rdonkin@apache.org + + + Java Developer + + + + Gary D. Gregory + ggregory + ggregory@seagullsw.com + Seagull Software + -8 + + Java Developer + + + + Phil Steitz + psteitz + phil@steitz.com + + + Java Developer + + + + Fredrik Westermarck + fredrik + + + + Java Developer + + + + James Carman + jcarman + jcarman@apache.org + Carman Consulting, Inc. + + Java Developer + + + + Niall Pemberton + niallp + + Java Developer + + + + Matt Benson + mbenson + + Java Developer + + + + + + C. Scott Ananian + + + Chris Audley + + + Stephane Bailliez + + + Michael Becke + + + Ola Berg + + + Nathan Beyer + + + Stefan Bodewig + + + Janek Bogucki + + + Mike Bowler + + + Sean Brown + + + Alexander Day Chaffee + + + Al Chou + + + Greg Coladonato + + + Maarten Coene + + + Justin Couch + + + Michael Davey + + + Norm Deane + + + Ringo De Smet + + + Russel Dittmar + + + Steve Downey + + + Matthias Eichel + + + Christopher Elkins + + + Chris Feldhacker + + + Pete Gieser + + + Jason Gritman + + + Matthew Hawthorne + + + Michael Heuer + + + Oliver Heger + + + Chris Hyzer + + + Marc Johnson + + + Shaun Kalley + + + Tetsuya Kaneuchi + + + Nissim Karpenstein + + + Ed Korthof + + + Holger Krauth + + + Rafal Krupinski + + + Rafal Krzewski + + + Craig R. McClanahan + + + Rand McNeely + + + Dave Meikle + + + Nikolay Metchev + + + Kasper Nielsen + + + Tim O'Brien + + + Brian S O'Neill + + + Andrew C. Oliver + + + Alban Peignier + + + Moritz Petersen + + + Dmitri Plotnikov + + + Neeme Praks + + + Eric Pugh + + + Stephen Putman + + + Travis Reeder + + + Antony Riley + + + Scott Sanders + + + Ralph Schaer + + + Henning P. Schmiedehausen + + + Sean Schofield + + + Reuben Sivan + + + Ville Skytta + + + Jan Sorensen + + + Glen Stampoultzis + + + Scott Stanchfield + + + Jon S. Stevens + + + Sean C. Sullivan + + + Ashwin Suresh + + + Helge Tesgaard + + + Arun Mammen Thomas + + + Masato Tezuka + + + Jeff Varszegi + + + Chris Webb + + + Mario Winterer + + + Stepan Koltsov + + + Holger Hoffstatte + + + + + + + junit + junit + 3.8.1 + test + + + + + 1.3 + 1.2 + lang + 2.4 + LANG + 12310481 + + + + + src/java + src/test + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*TestSuite.java + + + **/AllLangTestSuite.java + + + + + maven-assembly-plugin + + + src/assembly/bin.xml + src/assembly/src.xml + + gnu + + + + + + + + + maven-checkstyle-plugin + 2.1 + + ${basedir}/checkstyle.xml + false + + + + + org.codehaus.mojo + clirr-maven-plugin + 2.1.1 + + 2.3 + info + + + + + + + diff --git a/decompiled/META-INF/module.xml b/decompiled/META-INF/module.xml new file mode 100644 index 0000000..20f8639 --- /dev/null +++ b/decompiled/META-INF/module.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/TstatModels.xml b/decompiled/TstatModels.xml new file mode 100644 index 0000000..1ed2843 --- /dev/null +++ b/decompiled/TstatModels.xml @@ -0,0 +1,687 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/AddBind.xml b/decompiled/XL10NextGenXML/AddBind.xml new file mode 100644 index 0000000..80665c0 --- /dev/null +++ b/decompiled/XL10NextGenXML/AddBind.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/BacnetSpyder.xml b/decompiled/XL10NextGenXML/BacnetSpyder.xml new file mode 100644 index 0000000..ebb6e46 --- /dev/null +++ b/decompiled/XL10NextGenXML/BacnetSpyder.xml @@ -0,0 +1,2913 @@ + + + + + + + + + This model supports all kind of component supported in Spyder Controller. It is not a valid model as per Spyder Controller + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BCompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.validation.BBacnetValidator + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.resourceManager.BBacnetRM + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjects.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjects.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_Dummy.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_DummyModel.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BPiranhaUpload + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.download.BXL10NextGenFileWriter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable Unitary Control. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 8 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.validation.BBacnetValidator + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.resourceManager.BBacnetRM + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjects.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjects.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model3.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model3.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.download.BBacnetFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable Unitary Control. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 8 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.validation.BBacnetValidator + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.resourceManager.BBacnetRM + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjects.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjects.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model3.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model3.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.download.BBacnetFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable Unitary Control. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 8 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderRelayCompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.validation.BBacnetValidator + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.resourceManager.BBacnetRM + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjectsForRelay.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjectsForRelay.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model3.xml + local:|module://honeywellBacnetSpyder/com/honeywell/bacnetSpyder/io/IO_BACnetRelayModel.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.download.BBacnetRelayFileOffsetWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderRelayUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable Unitary Control. Supports 4 Universal Inputs, 2 Modulating Outputs, 4 Binary Outputs, Sylk Bus Wall Module, 400 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BCompilationCC1 + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.validation.BBacnetValidator + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.resourceManager.BBacnetRM + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjects.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjects.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model3.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.download.BBacnetFileOffsetWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BUploadCC1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable Unitary Control. Supports 1 Universal Inputs, 1 Modulating Outputs, 2 Binary Outputs, Sylk Bus Wall Module, 400 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BCompilationCC1 + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.validation.BBacnetValidator + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.resourceManager.BBacnetRM + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjects.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjects.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model4.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.download.BBacnetFileOffsetWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BUploadCC1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control with Actuator. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 6 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.validation.BBacnetValidator + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.resourceManager.BBacnetRM + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjects.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjects.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.download.BBacnetFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control with Actuator. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 6 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.validation.BBacnetValidator + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.resourceManager.BBacnetRM + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjects.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjects.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.download.BBacnetFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control with Actuator. Supports 4 Universal Inputs, 2 Modulating Outputs, 2 Binary Outputs, Sylk Bus Wall Module, 400 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BCompilationCC1 + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.validation.BBacnetValidator + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.resourceManager.BBacnetRM + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjects.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjects.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model2.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.download.BBacnetFileOffsetWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BUploadCC1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control with Actuator. Supports Sylk Bus Wall Module, 400 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BCompilationCC1 + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.validation.BBacnetValidator + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.resourceManager.BBacnetRM + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjects.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjects.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model5.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.download.BBacnetFileOffsetWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BUploadCC1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control without Actuator. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 8 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.validation.BBacnetValidator + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.resourceManager.BBacnetRM + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjects.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjects.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model2.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model2.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.download.BBacnetFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control without Actuator. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 8 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.validation.BBacnetValidator + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.resourceManager.BBacnetRM + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjects.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjects.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model2.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model2.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.download.BBacnetFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control without Actuator. Supports 4 Universal Inputs, 2 Modulating Outputs, 4 Binary Outputs, Sylk Bus Wall Module, 400 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BCompilationCC1 + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.validation.BBacnetValidator + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.resourceManager.BBacnetRM + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjects.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjects.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + honeywellBacnetSpyder.com.honeywell.bacnetSpyder.xl10Controller.download.BBacnetFileOffsetWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BUploadCC1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/DummyModel.xml b/decompiled/XL10NextGenXML/DummyModel.xml new file mode 100644 index 0000000..a625f81 --- /dev/null +++ b/decompiled/XL10NextGenXML/DummyModel.xml @@ -0,0 +1,158 @@ + + + + + + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_Dummy.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_DummyModel.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Spyder1.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryFixedNv_Dummy.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/FixedObjects.xml + local:|module://honeywellBacnetSpyder/XL10NextGenXML/MandatoryObjects.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/FixedIo_Dummy.xml b/decompiled/XL10NextGenXML/FixedIo_Dummy.xml new file mode 100644 index 0000000..a73edce --- /dev/null +++ b/decompiled/XL10NextGenXML/FixedIo_Dummy.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/FixedIo_model1.xml b/decompiled/XL10NextGenXML/FixedIo_model1.xml new file mode 100644 index 0000000..aeaa1fa --- /dev/null +++ b/decompiled/XL10NextGenXML/FixedIo_model1.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/FixedIo_model2.xml b/decompiled/XL10NextGenXML/FixedIo_model2.xml new file mode 100644 index 0000000..c18997b --- /dev/null +++ b/decompiled/XL10NextGenXML/FixedIo_model2.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/FixedIo_model3.xml b/decompiled/XL10NextGenXML/FixedIo_model3.xml new file mode 100644 index 0000000..9ff7d6a --- /dev/null +++ b/decompiled/XL10NextGenXML/FixedIo_model3.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/FixedNvs_Micro.xml b/decompiled/XL10NextGenXML/FixedNvs_Micro.xml new file mode 100644 index 0000000..1f5e075 --- /dev/null +++ b/decompiled/XL10NextGenXML/FixedNvs_Micro.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/FixedNvs_Spyder1.xml b/decompiled/XL10NextGenXML/FixedNvs_Spyder1.xml new file mode 100644 index 0000000..8160946 --- /dev/null +++ b/decompiled/XL10NextGenXML/FixedNvs_Spyder1.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/FixedNvs_Spyder2.xml b/decompiled/XL10NextGenXML/FixedNvs_Spyder2.xml new file mode 100644 index 0000000..5a22e42 --- /dev/null +++ b/decompiled/XL10NextGenXML/FixedNvs_Spyder2.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/FixedNvs_SpyderLonRelay.xml b/decompiled/XL10NextGenXML/FixedNvs_SpyderLonRelay.xml new file mode 100644 index 0000000..36dd3c0 --- /dev/null +++ b/decompiled/XL10NextGenXML/FixedNvs_SpyderLonRelay.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/FixedObjects.xml b/decompiled/XL10NextGenXML/FixedObjects.xml new file mode 100644 index 0000000..cc8e318 --- /dev/null +++ b/decompiled/XL10NextGenXML/FixedObjects.xml @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/FixedObjectsForRelay.xml b/decompiled/XL10NextGenXML/FixedObjectsForRelay.xml new file mode 100644 index 0000000..100a9bc --- /dev/null +++ b/decompiled/XL10NextGenXML/FixedObjectsForRelay.xml @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/FunctionalBlocks.xml b/decompiled/XL10NextGenXML/FunctionalBlocks.xml new file mode 100644 index 0000000..12c5dce --- /dev/null +++ b/decompiled/XL10NextGenXML/FunctionalBlocks.xml @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/LonSpyder.xml b/decompiled/XL10NextGenXML/LonSpyder.xml new file mode 100644 index 0000000..478fc0b --- /dev/null +++ b/decompiled/XL10NextGenXML/LonSpyder.xml @@ -0,0 +1,4112 @@ + + + + + + + + + This model supports all kind of component supported in Spyder Controller. It is not a valid model as per Spyder Controller + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BCompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryFixedNv_Dummy.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Spyder1.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_Dummy.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_DummyModel.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/Mandatory1.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BPiranhaUpload + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BXL10NextGenFileWriter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable Unitary Control. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 8 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Spyder2.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model3.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model3.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/Mandatory2.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable Unitary Control. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 8 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Spyder2.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model3.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model3.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/Mandatory2.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable Unitary Control. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 8 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks, Relays + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderRelayCompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderRelay.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_SpyderLonRelay.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model3.xml + local:|module://honeywellLonSpyder/com/honeywell/lonSpyder/io/IO_LonRelayModel.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatorySpyderRelay.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BLonSpyderFileOffsetWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderRelayUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable Unitary Control. Supports 4 Universal Inputs, 2 Modulating Outputs, 4 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Micro.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model3.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryMicro.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable Unitary Control. Supports 4 Universal Inputs, 2 Modulating Outputs, 4 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Micro.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model3.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryMicro.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable Unitary Control. Supports 1 Universal Inputs, 1 Modulating Outputs, 2 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Micro.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model4.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryMicro.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable Unitary Control. Supports 1 Universal Inputs, 1 Modulating Outputs, 2 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Micro.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model4.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryMicro.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control with Actuator. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 6 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Spyder2.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/Mandatory2.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control with Actuator. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 6 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Spyder2.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/Mandatory2.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control with Actuator. Supports 4 Universal Inputs, 2 Modulating Outputs, 2 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Micro.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model2.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryMicro.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control with Actuator. Supports 4 Universal Inputs, 2 Modulating Outputs, 2 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Micro.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model2.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryMicro.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control with Actuator. Supports Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Micro.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model5.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryMicro.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control with Actuator. Supports Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Micro.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model5.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryMicro.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control without Actuator. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 8 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Spyder2.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model2.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model2.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/Mandatory2.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control without Actuator. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 8 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Spyder2.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model2.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model2.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/Mandatory2.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control without Actuator. Supports 4 Universal Inputs, 2 Modulating Outputs, 4 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Micro.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryMicro.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control without Actuator. Supports 4 Universal Inputs, 2 Modulating Outputs, 4 Binary Outputs, Sylk Bus Wall Module, 200 Functional Blocks + + + + + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BSpyderIICompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BSpyderIIValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Micro.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Micro_Model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryMicro.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BSpyderIIFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BSpyderIIUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable Unitary Control. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 8 Binary Outputs, 100 Functional Blocks + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BCompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryFixedNv_Dummy.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Spyder1.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model3.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model3.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/Mandatory1.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BXL10NextGenFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BPiranhaUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control without Actuator. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 8 Binary Outputs, 100 Functional Blocks + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BCompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.OnlineDummy + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryFixedNv_Dummy.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Spyder1.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model2.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model2.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/Mandatory1.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BXL10NextGenFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BPiranhaUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Programmable VAV Control with Actuator. Supports 6 Universal Inputs, 4 Binary Inputs, 3 Modulating Outputs, 6 Binary Outputs, 100 Functional Blocks + + + + + + + + + + + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.compilation.BCompilation + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.BMemoryManager + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.validation.BValidator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BXIFGenerator + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.BMandatoryXIFValues + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.resourceManager.BResourceManager + local:|module://honeywellLonSpyder/XL10NextGenXML/MandatoryFixedNv_Dummy.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/FixedNvs_Spyder1.xml + local:|module://honeywellSpyderTool/XL10NextGenXML/FixedIo_model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Model1.xml + local:|module://honeywellSpyderTool/com/honeywell/honeywellXL10NextGen/io/IO_Common.xml + local:|module://honeywellLonSpyder/XL10NextGenXML/Mandatory1.lnml + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.onlineOperation.flowBalancing.BFlowCalibrationPointsReadWrite + + + honeywellLonSpyder.com.honeywell.lonSpyder.xl10Controller.download.BXL10NextGenFileWriter + honeywellSpyderTool.com.honeywell.honeywellXL10NextGen.xl10Controller.upload.BPiranhaUpload + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/MandatoryFixedNv_Dummy.xml b/decompiled/XL10NextGenXML/MandatoryFixedNv_Dummy.xml new file mode 100644 index 0000000..5f1c32c --- /dev/null +++ b/decompiled/XL10NextGenXML/MandatoryFixedNv_Dummy.xml @@ -0,0 +1,302 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml b/decompiled/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml new file mode 100644 index 0000000..1e77baa --- /dev/null +++ b/decompiled/XL10NextGenXML/MandatoryNv_SpyderEnhanced.xml @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/MandatoryNv_SpyderRelay.xml b/decompiled/XL10NextGenXML/MandatoryNv_SpyderRelay.xml new file mode 100644 index 0000000..960caba --- /dev/null +++ b/decompiled/XL10NextGenXML/MandatoryNv_SpyderRelay.xml @@ -0,0 +1,301 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/MandatoryNv_spyder2.xml b/decompiled/XL10NextGenXML/MandatoryNv_spyder2.xml new file mode 100644 index 0000000..6c24fb0 --- /dev/null +++ b/decompiled/XL10NextGenXML/MandatoryNv_spyder2.xml @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/MandatoryObjects.xml b/decompiled/XL10NextGenXML/MandatoryObjects.xml new file mode 100644 index 0000000..f320b10 --- /dev/null +++ b/decompiled/XL10NextGenXML/MandatoryObjects.xml @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/MandatoryObjectsForRelay.xml b/decompiled/XL10NextGenXML/MandatoryObjectsForRelay.xml new file mode 100644 index 0000000..7570b5f --- /dev/null +++ b/decompiled/XL10NextGenXML/MandatoryObjectsForRelay.xml @@ -0,0 +1 @@ + diff --git a/decompiled/XL10NextGenXML/SelectDevice.xml b/decompiled/XL10NextGenXML/SelectDevice.xml new file mode 100644 index 0000000..29cc7d9 --- /dev/null +++ b/decompiled/XL10NextGenXML/SelectDevice.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/Spyder_Units.xml b/decompiled/XL10NextGenXML/Spyder_Units.xml new file mode 100644 index 0000000..ae7173b --- /dev/null +++ b/decompiled/XL10NextGenXML/Spyder_Units.xml @@ -0,0 +1,1100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/UnitSystemList.xml b/decompiled/XL10NextGenXML/UnitSystemList.xml new file mode 100644 index 0000000..552fdad --- /dev/null +++ b/decompiled/XL10NextGenXML/UnitSystemList.xml @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/XL10NextGenXML/lonXL10NextGen_Units.xml b/decompiled/XL10NextGenXML/lonXL10NextGen_Units.xml new file mode 100644 index 0000000..249d7ed --- /dev/null +++ b/decompiled/XL10NextGenXML/lonXL10NextGen_Units.xml @@ -0,0 +1,1105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/appliance/ui/InitechLeft.png b/decompiled/appliance/ui/InitechLeft.png new file mode 100644 index 0000000..afa2404 Binary files /dev/null and b/decompiled/appliance/ui/InitechLeft.png differ diff --git a/decompiled/appliance/ui/InitechRight.png b/decompiled/appliance/ui/InitechRight.png new file mode 100644 index 0000000..61cdd14 Binary files /dev/null and b/decompiled/appliance/ui/InitechRight.png differ diff --git a/decompiled/appliance/ui/InitechSplash.png b/decompiled/appliance/ui/InitechSplash.png new file mode 100644 index 0000000..942e9ed Binary files /dev/null and b/decompiled/appliance/ui/InitechSplash.png differ diff --git a/decompiled/appliance/ui/initech.png b/decompiled/appliance/ui/initech.png new file mode 100644 index 0000000..980f054 Binary files /dev/null and b/decompiled/appliance/ui/initech.png differ diff --git a/decompiled/bullet_point.png b/decompiled/bullet_point.png new file mode 100644 index 0000000..6f88a8c Binary files /dev/null and b/decompiled/bullet_point.png differ diff --git a/decompiled/collapseall.gif b/decompiled/collapseall.gif new file mode 100644 index 0000000..ac87248 Binary files /dev/null and b/decompiled/collapseall.gif differ diff --git a/decompiled/com/beust/jcommander/IDefaultProvider.java b/decompiled/com/beust/jcommander/IDefaultProvider.java new file mode 100644 index 0000000..ac9aab3 --- /dev/null +++ b/decompiled/com/beust/jcommander/IDefaultProvider.java @@ -0,0 +1,5 @@ +package com.beust.jcommander; + +public interface IDefaultProvider { + String getDefaultValueFor(String str); +} diff --git a/decompiled/com/beust/jcommander/IStringConverter.java b/decompiled/com/beust/jcommander/IStringConverter.java new file mode 100644 index 0000000..aff1f61 --- /dev/null +++ b/decompiled/com/beust/jcommander/IStringConverter.java @@ -0,0 +1,5 @@ +package com.beust.jcommander; + +public interface IStringConverter { + T convert(String str); +} diff --git a/decompiled/com/beust/jcommander/IStringConverterFactory.java b/decompiled/com/beust/jcommander/IStringConverterFactory.java new file mode 100644 index 0000000..7fbbe78 --- /dev/null +++ b/decompiled/com/beust/jcommander/IStringConverterFactory.java @@ -0,0 +1,5 @@ +package com.beust.jcommander; + +public interface IStringConverterFactory { + Class> getConverter(Class cls); +} diff --git a/decompiled/com/beust/jcommander/Parameter.java b/decompiled/com/beust/jcommander/Parameter.java new file mode 100644 index 0000000..7e1a04f --- /dev/null +++ b/decompiled/com/beust/jcommander/Parameter.java @@ -0,0 +1,27 @@ +package com.beust.jcommander; + +import com.beust.jcommander.converters.NoConverter; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface Parameter { + int arity() default -1; + + Class> converter() default NoConverter.class; + + String description() default ""; + + String descriptionKey() default ""; + + boolean hidden() default false; + + String[] names() default {}; + + boolean password() default false; + + boolean required() default false; +} diff --git a/decompiled/com/beust/jcommander/Parameters.java b/decompiled/com/beust/jcommander/Parameters.java new file mode 100644 index 0000000..8b79d78 --- /dev/null +++ b/decompiled/com/beust/jcommander/Parameters.java @@ -0,0 +1,20 @@ +package com.beust.jcommander; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface Parameters { + public static final String DEFAULT_OPTION_PREFIXES = "-"; + + String commandDescription() default ""; + + String optionPrefixes() default "-"; + + String resourceBundle() default ""; + + String separators() default " "; +} diff --git a/decompiled/com/beust/jcommander/ResourceBundle.java b/decompiled/com/beust/jcommander/ResourceBundle.java new file mode 100644 index 0000000..a3e85f9 --- /dev/null +++ b/decompiled/com/beust/jcommander/ResourceBundle.java @@ -0,0 +1,12 @@ +package com.beust.jcommander; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface ResourceBundle { + String value(); +} diff --git a/decompiled/com/honeywell/DisplayDriver/constants/DeviceConst.java b/decompiled/com/honeywell/DisplayDriver/constants/DeviceConst.java new file mode 100644 index 0000000..dda64ec --- /dev/null +++ b/decompiled/com/honeywell/DisplayDriver/constants/DeviceConst.java @@ -0,0 +1,30 @@ +package com.honeywell.DisplayDriver.constants; + +public interface DeviceConst { + public static final int ALARM_LIST_SIZE = 100; + public static final int CLOCK_UPDATE_INTERVAL = 60; + public static final int DEVTYPE_DISPLAY = 17; + public static final int DEVTYPE_UNDEFINED = 0; + public static final int DEV_INFO_UPDATE_INTERVAL = 2; + public static final int DOWNLOAD_ACCESS_CODES = 7; + public static final int DOWNLOAD_CANCELING = 6; + public static final int DOWNLOAD_ENCODING = 1; + public static final int DOWNLOAD_ENDING = 5; + public static final int DOWNLOAD_IDLE = 0; + public static final int DOWNLOAD_IN_PROGRESS = 3; + public static final int DOWNLOAD_REQUESTED = 2; + public static final int DOWNLOAD_SERIAL_FAULT = -1; + public static final int DOWNLOAD_STARTING = 4; + public static final int DOWNLOAD_TIMESTAMP = 8; + public static final int UPGRADE_CANCELING = 15; + public static final int UPGRADE_ENDING = 14; + public static final int UPGRADE_IN_PROGRESS = 12; + public static final int UPGRADE_REQUESTED = 11; + public static final int UPGRADE_SERIAL_FAULT = -2; + public static final int UPGRADE_STARTING = 13; + public static final String WEBS_SERIAL_PREFIX1 = "7402"; + public static final String WEBS_SERIAL_PREFIX2 = "7403"; + public static final String bogFileExt = ".xml"; + public static final String displayEmulationFileName = "emulate"; + public static final String displayLayoutFileName = "layout"; +} diff --git a/decompiled/com/honeywell/DisplayDriver/constants/NetworkConst.java b/decompiled/com/honeywell/DisplayDriver/constants/NetworkConst.java new file mode 100644 index 0000000..a8dbaad --- /dev/null +++ b/decompiled/com/honeywell/DisplayDriver/constants/NetworkConst.java @@ -0,0 +1,22 @@ +package com.honeywell.DisplayDriver.constants; + +public interface NetworkConst { + public static final int FAST_RATE = 0; + public static final int HOLD_OFF_SECONDS = 5; + public static final long INTERMESSAGE_DELAY = 125; + public static final int MAX_COMM_MISSES = 5; + public static final int MAX_DEVICES = 4; + public static final int MAX_DEVICE_ADDRESS = 63; + public static final int MIN_DEVICE_ADDRESS = 1; + public static final int RESPONSE_TIMEOUT = 1; + public static final int RETRY_COUNT = 2; + public static final String appsSubdirectory = "applications"; + public static final String configRootORD = "station:|slot:"; + public static final String displayDirectory = "LCD"; + public static final String driverBrand = "Webs"; + public static final String driverFeature = "LCDProgrammable"; + public static final String imagesSubdirectory = "images"; + public static final String moduleName = "honeywellLCD"; + public static final String vendorHoneywell = "Honeywell"; + public static final String vendorTridium = "Tridium"; +} diff --git a/decompiled/com/honeywell/DisplayDriver/constants/ServerConst.java b/decompiled/com/honeywell/DisplayDriver/constants/ServerConst.java new file mode 100644 index 0000000..7e04968 --- /dev/null +++ b/decompiled/com/honeywell/DisplayDriver/constants/ServerConst.java @@ -0,0 +1,38 @@ +package com.honeywell.DisplayDriver.constants; + +public interface ServerConst { + public static final int BUILDER_FAULT = 4; + public static final byte DOWNLOAD_COMMAND = (byte) 33; + public static final int FILE_FAULT = 9; + public static final int FILE_NOT_ASSIGNED = 2; + public static final int FILE_NOT_FOUND = 1; + public static final int FILE_SERVER_ABORT = 99; + public static final int FILE_SERVER_ENDING = 94; + public static final int FILE_SERVER_END_SENT = 95; + public static final int FILE_SERVER_RUNNING = 90; + public static final int FILE_SERVER_SEND_BLOCK = 93; + public static final int FILE_SERVER_STARTING = 92; + public static final int FILE_SERVER_WAITING = 91; + public static final int MALFORMED_REQUEST = 5; + public static final int MODULE_TYPE_MISMATCH = 10; + public static final int NO_ERROR = 0; + public static final int RETRY_LIMIT_EXCEEDED = 6; + public static final int RETRY_LIMIT_OUT_OF_RANGE = 3; + public static final int SERVER_ABORT = 99; + public static final int SERVER_BLOCK = 3; + public static final int SERVER_CONCURRENT = 1; + public static final int SERVER_END = 7; + public static final int SERVER_END_SENT = 8; + public static final int SERVER_EXEC_BLOCK = 5; + public static final int SERVER_EXEC_SENT = 6; + public static final int SERVER_IDLE = 0; + public static final int SERVER_START = 2; + public static final int SERVER_TIMEOUT = 8; + public static final int SERVER_WAIT_NEXT = 4; + public static final byte SUB_BLOCK_REQUEST = (byte) 2; + public static final byte SUB_DATA_BLOCK = (byte) 2; + public static final byte SUB_END_DOWNLOAD = (byte) 3; + public static final byte SUB_EXEC_ADDRESS = (byte) 4; + public static final byte SUB_START_DOWNLOAD = (byte) 1; + public static final int TRANSFER_ABORTED = 7; +} diff --git a/decompiled/com/honeywell/ascot/alarms/IAlarmsInfo.java b/decompiled/com/honeywell/ascot/alarms/IAlarmsInfo.java new file mode 100644 index 0000000..65c13f6 --- /dev/null +++ b/decompiled/com/honeywell/ascot/alarms/IAlarmsInfo.java @@ -0,0 +1,34 @@ +package com.honeywell.ascot.alarms; + +import com.honeywell.ascot.beans.BVavDeviceConfigBean; +import com.honeywell.ascot.device.BDeviceConfigState; +import com.honeywell.ascot.device.BDeviceInfo; +import com.honeywell.ascot.device.INetworkInterfaceInfo; +import java.util.List; +import javax.baja.driver.BDevice; + +public interface IAlarmsInfo { + public static final String UI_0 = "UI_0"; + public static final String UI_1 = "UI_1"; + public static final String UI_2 = "UI_2"; + public static final String UI_3 = "UI_3"; + public static final String UI_4 = "UI_4"; + public static final String ZELENY_HUM = "ZELENY_HUM"; + public static final String ZELENY_TEMP = "ZELENY_TEMP"; + public static final String ZIO_HUM = "ZIO_HUM"; + public static final String ZIO_TEMP = "ZIO_TEMP"; + + void addNetworkSpecificAlarmInhibits(List list, BDevice bDevice, BDeviceInfo bDeviceInfo); + + String[] getComponentListForAlarms(); + + Object[][] getControllerAndCommnAlarmDetails(BDevice bDevice); + + List getOtherControllerAlarms(BDevice bDevice); + + List getSensorAlarmDetails(BDevice bDevice) throws Exception; + + void markModifiedForNetworkSpecificAlarmInhibits(INetworkInterfaceInfo iNetworkInterfaceInfo, BDeviceConfigState bDeviceConfigState); + + void updateAlarmInhibits(List list, BDevice bDevice, BDeviceInfo bDeviceInfo, BVavDeviceConfigBean bVavDeviceConfigBean) throws Exception; +} diff --git a/decompiled/com/honeywell/ascot/async/loader/IAsyncLoadableUI.java b/decompiled/com/honeywell/ascot/async/loader/IAsyncLoadableUI.java new file mode 100644 index 0000000..132903b --- /dev/null +++ b/decompiled/com/honeywell/ascot/async/loader/IAsyncLoadableUI.java @@ -0,0 +1,5 @@ +package com.honeywell.ascot.async.loader; + +public interface IAsyncLoadableUI { + void doLoadUIAsync(AsyncLoader asyncLoader); +} diff --git a/decompiled/com/honeywell/ascot/beans/IAccessoryLoopBean.java b/decompiled/com/honeywell/ascot/beans/IAccessoryLoopBean.java new file mode 100644 index 0000000..964101a --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/IAccessoryLoopBean.java @@ -0,0 +1,12 @@ +package com.honeywell.ascot.beans; + +import com.honeywell.ascot.beans.io.inputs.BInputsConfigurationBean; +import com.honeywell.ascot.beans.io.outputs.BOutputsConfigurationBean; + +public interface IAccessoryLoopBean { + BInputsConfigurationBean getAccLoopInputs(); + + BOutputsConfigurationBean getAccLoopOutputs(); + + BHonString getLoopName(); +} diff --git a/decompiled/com/honeywell/ascot/beans/IAccessoryLoopInputBean.java b/decompiled/com/honeywell/ascot/beans/IAccessoryLoopInputBean.java new file mode 100644 index 0000000..eadcb5d --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/IAccessoryLoopInputBean.java @@ -0,0 +1,11 @@ +package com.honeywell.ascot.beans; + +public interface IAccessoryLoopInputBean { + BHonEnum getMainApplicationOutput(); + + BHonEnum getSharedInput(); + + void setMainApplicationOutput(BHonEnum bHonEnum); + + void setSharedInput(BHonEnum bHonEnum); +} diff --git a/decompiled/com/honeywell/ascot/beans/IAscotBean.java b/decompiled/com/honeywell/ascot/beans/IAscotBean.java new file mode 100644 index 0000000..9a89723 --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/IAscotBean.java @@ -0,0 +1,4 @@ +package com.honeywell.ascot.beans; + +public interface IAscotBean { +} diff --git a/decompiled/com/honeywell/ascot/beans/IDeviceBean.java b/decompiled/com/honeywell/ascot/beans/IDeviceBean.java new file mode 100644 index 0000000..fb17435 --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/IDeviceBean.java @@ -0,0 +1,40 @@ +package com.honeywell.ascot.beans; + +import com.honeywell.ascot.beans.io.inputs.BInputBean; +import com.honeywell.ascot.beans.io.inputs.BInputsConfigurationBean; +import com.honeywell.ascot.beans.io.outputs.BOutputsConfigurationBean; +import com.honeywell.ascot.beans.schedule.BScheduleHolidayBean; + +public interface IDeviceBean extends IAscotBean { + BInputsConfigurationBean getAccLoopInputs(int i); + + BOutputsConfigurationBean getAccLoopOutputs(int i); + + BAscotBean getAccessoryLoop(String str); + + BAscotBean getAccessoryLoopBean(); + + BCustomSensorsBean getCustomSensors(); + + BInputBean[] getInputsArray(); + + BInputsConfigurationBean getInputsConfigurationBean(); + + BOutputsConfigurationBean getOutputsConfigurationBean(); + + BPIDBean getPIDBean(); + + BScheduleHolidayBean getScheduleBean(); + + void setAccessoryLoopBean(BAscotBean bAscotBean); + + void setCustomSensors(BCustomSensorsBean bCustomSensorsBean); + + void setInputsConfigurationBean(BInputsConfigurationBean bInputsConfigurationBean); + + void setOutputsConfigurationBean(BOutputsConfigurationBean bOutputsConfigurationBean); + + void setPIDBean(BPIDBean bPIDBean); + + void setScheduleBean(BScheduleHolidayBean bScheduleHolidayBean); +} diff --git a/decompiled/com/honeywell/ascot/beans/IMainAccessoryLoopBean.java b/decompiled/com/honeywell/ascot/beans/IMainAccessoryLoopBean.java new file mode 100644 index 0000000..c42a5aa --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/IMainAccessoryLoopBean.java @@ -0,0 +1,5 @@ +package com.honeywell.ascot.beans; + +public interface IMainAccessoryLoopBean { + IAccessoryLoopBean getAccessoryLoop(String str); +} diff --git a/decompiled/com/honeywell/ascot/beans/IMainAccessoryLoopDeviceBean.java b/decompiled/com/honeywell/ascot/beans/IMainAccessoryLoopDeviceBean.java new file mode 100644 index 0000000..247cab5 --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/IMainAccessoryLoopDeviceBean.java @@ -0,0 +1,7 @@ +package com.honeywell.ascot.beans; + +public interface IMainAccessoryLoopDeviceBean { + BMainAccessoryLoopBean getAccessoryLoop(); + + void setAccessoryLoop(BMainAccessoryLoopBean bMainAccessoryLoopBean); +} diff --git a/decompiled/com/honeywell/ascot/beans/IManualModeParam.java b/decompiled/com/honeywell/ascot/beans/IManualModeParam.java new file mode 100644 index 0000000..16f243e --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/IManualModeParam.java @@ -0,0 +1,13 @@ +package com.honeywell.ascot.beans; + +import com.honeywell.ascot.network.INetworkParam; + +public interface IManualModeParam { + INetworkParam getObjectId(); + + INetworkParam getObjectRequest(); + + void setObjectId(INetworkParam iNetworkParam); + + void setObjectRequest(INetworkParam iNetworkParam); +} diff --git a/decompiled/com/honeywell/ascot/beans/IPIDDeviceBean.java b/decompiled/com/honeywell/ascot/beans/IPIDDeviceBean.java new file mode 100644 index 0000000..b4629be --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/IPIDDeviceBean.java @@ -0,0 +1,7 @@ +package com.honeywell.ascot.beans; + +public interface IPIDDeviceBean { + BPIDBean getPid(); + + void setPid(BPIDBean bPIDBean); +} diff --git a/decompiled/com/honeywell/ascot/beans/ISessionBean.java b/decompiled/com/honeywell/ascot/beans/ISessionBean.java new file mode 100644 index 0000000..c9ef70f --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/ISessionBean.java @@ -0,0 +1,4 @@ +package com.honeywell.ascot.beans; + +public interface ISessionBean { +} diff --git a/decompiled/com/honeywell/ascot/beans/IStepBean.java b/decompiled/com/honeywell/ascot/beans/IStepBean.java new file mode 100644 index 0000000..511ccd3 --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/IStepBean.java @@ -0,0 +1,7 @@ +package com.honeywell.ascot.beans; + +public interface IStepBean { + BHonBoolean getIsStepModified(); + + void setIsStepModified(BHonBoolean bHonBoolean); +} diff --git a/decompiled/com/honeywell/ascot/beans/SupportsValidationRules.java b/decompiled/com/honeywell/ascot/beans/SupportsValidationRules.java new file mode 100644 index 0000000..3d8f42d --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/SupportsValidationRules.java @@ -0,0 +1,11 @@ +package com.honeywell.ascot.beans; + +public interface SupportsValidationRules { + boolean getIsEnabled(); + + boolean getIsVisible(); + + void setIsEnabled(boolean z); + + void setIsVisible(boolean z); +} diff --git a/decompiled/com/honeywell/ascot/beans/io/IFourPinIO.java b/decompiled/com/honeywell/ascot/beans/io/IFourPinIO.java new file mode 100644 index 0000000..1dcba5b --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/io/IFourPinIO.java @@ -0,0 +1,9 @@ +package com.honeywell.ascot.beans.io; + +import com.honeywell.ascot.beans.BHonInteger; + +public interface IFourPinIO extends IOInterface, IThreePinIO { + BHonInteger getPin4(); + + void setPin4(BHonInteger bHonInteger); +} diff --git a/decompiled/com/honeywell/ascot/beans/io/IOInterface.java b/decompiled/com/honeywell/ascot/beans/io/IOInterface.java new file mode 100644 index 0000000..4295bba --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/io/IOInterface.java @@ -0,0 +1,20 @@ +package com.honeywell.ascot.beans.io; + +import com.honeywell.ascot.beans.BHonInteger; + +public interface IOInterface { + public static final String PIN_1_NAME = "pin"; + public static final String PIN_2_NAME = "pin2"; + public static final String PIN_3_NAME = "pin3"; + public static final String PIN_4_NAME = "pin4"; + + void copyTo(IOInterface iOInterface); + + BHonInteger getPin(); + + String getSelectionBeanRef(); + + boolean isPinChanged(IOInterface iOInterface); + + void setPin(BHonInteger bHonInteger); +} diff --git a/decompiled/com/honeywell/ascot/beans/io/IThreePinIO.java b/decompiled/com/honeywell/ascot/beans/io/IThreePinIO.java new file mode 100644 index 0000000..a83abb6 --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/io/IThreePinIO.java @@ -0,0 +1,13 @@ +package com.honeywell.ascot.beans.io; + +import com.honeywell.ascot.beans.BHonInteger; + +public interface IThreePinIO extends IOInterface { + BHonInteger getPin2(); + + BHonInteger getPin3(); + + void setPin2(BHonInteger bHonInteger); + + void setPin3(BHonInteger bHonInteger); +} diff --git a/decompiled/com/honeywell/ascot/beans/io/ITwoPinIO.java b/decompiled/com/honeywell/ascot/beans/io/ITwoPinIO.java new file mode 100644 index 0000000..e4de2c4 --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/io/ITwoPinIO.java @@ -0,0 +1,9 @@ +package com.honeywell.ascot.beans.io; + +import com.honeywell.ascot.beans.BHonInteger; + +public interface ITwoPinIO extends IOInterface { + BHonInteger getPin2(); + + void setPin2(BHonInteger bHonInteger); +} diff --git a/decompiled/com/honeywell/ascot/beans/onlineOperations/alarms/IAlarmConfigBean.java b/decompiled/com/honeywell/ascot/beans/onlineOperations/alarms/IAlarmConfigBean.java new file mode 100644 index 0000000..7edd659 --- /dev/null +++ b/decompiled/com/honeywell/ascot/beans/onlineOperations/alarms/IAlarmConfigBean.java @@ -0,0 +1,22 @@ +package com.honeywell.ascot.beans.onlineOperations.alarms; + +import com.honeywell.ascot.beans.BHonBoolean; +import com.honeywell.ascot.beans.BHonString; + +public interface IAlarmConfigBean { + BHonString getDetails(); + + BHonString getError(); + + BHonBoolean getState(); + + BHonString getTypeOfError(); + + void setDetails(BHonString bHonString); + + void setError(BHonString bHonString); + + void setState(BHonBoolean bHonBoolean); + + void setTypeOfError(BHonString bHonString); +} diff --git a/decompiled/com/honeywell/ascot/constants/IAscConstants.java b/decompiled/com/honeywell/ascot/constants/IAscConstants.java new file mode 100644 index 0000000..4311176 --- /dev/null +++ b/decompiled/com/honeywell/ascot/constants/IAscConstants.java @@ -0,0 +1,7 @@ +package com.honeywell.ascot.constants; + +public interface IAscConstants { + public static final String ASC_BACNET_TYPE = "ascBacnet"; + public static final String ASC_COMMON_TYPE = "ascCommon"; + public static final String ASC_LON_TYPE = "ascLon"; +} diff --git a/decompiled/com/honeywell/ascot/datasharing/IEndianInputStream.java b/decompiled/com/honeywell/ascot/datasharing/IEndianInputStream.java new file mode 100644 index 0000000..4950af6 --- /dev/null +++ b/decompiled/com/honeywell/ascot/datasharing/IEndianInputStream.java @@ -0,0 +1,45 @@ +package com.honeywell.ascot.datasharing; + +public interface IEndianInputStream { + int position(); + + int readBit(int i, int i2, int i3); + + boolean readBoolean(); + + boolean readBooleanBit(int i, int i2, int i3); + + byte[] readByteArray(); + + byte[] readByteArray(int i); + + String readCharArray(int i); + + double readDouble(); + + float readFloat(); + + int readSigned16(); + + int readSigned32(); + + int readSigned8(); + + int readSignedBit(int i, int i2, int i3); + + String readString(); + + int readUnsigned16(); + + long readUnsigned32(); + + int readUnsigned8(); + + void reset(); + + void reset(int i); + + void resetBitFieldMark(int i); + + int setBitFieldMark(); +} diff --git a/decompiled/com/honeywell/ascot/datasharing/IEndianOutputStream.java b/decompiled/com/honeywell/ascot/datasharing/IEndianOutputStream.java new file mode 100644 index 0000000..fe2db01 --- /dev/null +++ b/decompiled/com/honeywell/ascot/datasharing/IEndianOutputStream.java @@ -0,0 +1,33 @@ +package com.honeywell.ascot.datasharing; + +public interface IEndianOutputStream { + void resetBitFieldMark(int i); + + int setBitFieldMark(); + + void writeBit(int i, int i2, int i3, int i4); + + void writeBoolean(boolean z); + + void writeBooleanBit(boolean z, int i, int i2, int i3); + + void writeByteArray(byte[] bArr, int i); + + void writeCharArray(String str, int i); + + void writeFloat(float f); + + void writeSigned16(int i); + + void writeSigned32(int i); + + void writeSigned8(int i); + + void writeSignedBit(int i, int i2, int i3, int i4); + + void writeUnsigned16(int i); + + void writeUnsigned32(long j); + + void writeUnsigned8(int i); +} diff --git a/decompiled/com/honeywell/ascot/device/IAscotDevice.java b/decompiled/com/honeywell/ascot/device/IAscotDevice.java new file mode 100644 index 0000000..13d4f80 --- /dev/null +++ b/decompiled/com/honeywell/ascot/device/IAscotDevice.java @@ -0,0 +1,120 @@ +package com.honeywell.ascot.device; + +import com.honeywell.ascot.beans.BOnlineOpCheckBean; +import com.honeywell.ascot.exceptions.DeviceIncompatibleException; +import com.honeywell.ascot.network.INetworkParam; +import javax.baja.driver.loadable.BDownloadParameters; +import javax.baja.driver.loadable.BUploadParameters; +import javax.baja.driver.point.BPointDeviceExt; +import javax.baja.naming.BOrd; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BInteger; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; + +public interface IAscotDevice { + public static final String ACTUATOR_TRAVEL_TIME = "actuatorTravelTime"; + public static final String ASCOT_FLOW_BALANCER_TEMPLATE = "ProdFBTemplate"; + public static final String CLEAN_MONITORING_POINTS_FOLDER = "cleanMonitoringFolder"; + public static final String COMMON_FLOW_BALANCER_TEMPLATE = "ComFBTemplate"; + public static final int DEVICE_HW_NOT_COMPATIBLE = 3; + public static final int DEVICE_IN_USE = 2; + public static final int DEVICE_NOT_COMMISIONED = 1; + public static final int DEVICE_OFFLINE = 0; + public static final int DEVICE_SYSTEM_ERROR = 4; + public static final String DOWNLOAD_ACTION = "ascDownload"; + public static final String GET_DEVICE_STATE_ACTION_NAME = "getDeviceStateAction"; + public static final String GET_MONITORING_FOLDER = "getMonitoringFolder"; + public static final String GET_STATION_TIME = "getStationTime"; + public static final String GRAPHICS_SLOT_NAME = "Graphics"; + public static final String MONITORING_POINTS_SLOT_NAME = "monitoringPoints"; + public static final String RESTORE_FLAG = "restoreFlag"; + public static final String SET_DEVICE_STATE_ACTION_NAME = "setDeviceStateAction"; + public static final String TOGGLE_GRAPHICS_ACTION_NAME = "toggleGraphics"; + public static final String UPLOAD_ACTION = "ascUpload"; + public static final int WIZARD_SAVE_INPROGRESS = 5; + + void batchUpdateNetworkConfigs(); + + void checkDeviceCompatibility() throws DeviceIncompatibleException, Exception; + + BInteger checkForOnlineOperations(BOnlineOpCheckBean bOnlineOpCheckBean) throws DeviceIncompatibleException; + + void checkModelCompatibility() throws DeviceIncompatibleException, Exception; + + BDeviceState doGetDeviceStateAction(); + + void doSetDeviceStateAction(BDeviceState bDeviceState); + + void fireConfigurationSavedTopic(); + + BComponent getComponentOnDevice(String str); + + String getDeviceMode(); + + String getDeviceName(); + + BDownloadParameters getDownloadParameters(); + + BString getDownloadStatus(); + + BPointDeviceExt getMonitoringPointFolder(); + + BUploadParameters getUploadParameters(); + + BValue invokeAction(BComponent bComponent, String str, BValue bValue); + + BBoolean isControllerModified(); + + boolean isDeviceCommissioned(); + + BBoolean isDeviceOk(); + + BBoolean isManualMode(); + + void pingTheDevice(); + + void populateNetworkConfigs(); + + BString readControllerType(); + + BString readControllerTypeFromDatabase(); + + BFacets readFacetForNetworkParamOffline(INetworkParam iNetworkParam); + + BFacets readFacetForNetworkParamOnline(INetworkParam iNetworkParam); + + BValue readNetworkParamOffline(INetworkParam iNetworkParam); + + BValue readNetworkParamOfflineFromStation(INetworkParam iNetworkParam); + + BValue readNetworkParamOnline(INetworkParam iNetworkParam); + + BValue[] readNetworkParametersOffline(INetworkParam iNetworkParam, boolean z); + + BValue[] readNetworkParametersOnline(INetworkParam iNetworkParam); + + void removeMonitoringPointFolder(); + + void setDeviceModifiedWhenDeviceNameChanged(int i, BDeviceConfigState bDeviceConfigState, INetworkInterfaceInfo iNetworkInterfaceInfo); + + void setDeviceName(String str); + + void setDeviceStatus(int i); + + void setOverlayPxOrd(BOrd bOrd); + + BBoolean setToAutoMode(); + + void setWiringPxOrd(BOrd bOrd); + + void updateControllerType(); + + void writeFacetsForNetworkParam(INetworkParam iNetworkParam, BFacets bFacets); + + void writeNetworkParamOffline(INetworkParam iNetworkParam, BValue bValue); + + void writeNetworkParamOnline(INetworkParam iNetworkParam, BValue bValue); +} diff --git a/decompiled/com/honeywell/ascot/device/IDeviceModelInfo.java b/decompiled/com/honeywell/ascot/device/IDeviceModelInfo.java new file mode 100644 index 0000000..23b0ca1 --- /dev/null +++ b/decompiled/com/honeywell/ascot/device/IDeviceModelInfo.java @@ -0,0 +1,109 @@ +package com.honeywell.ascot.device; + +import com.honeywell.ascot.beans.io.IOInterface; +import com.honeywell.ascot.beans.io.inputs.BInputBean; +import com.honeywell.ascot.beans.io.outputs.BOutputBean; +import com.honeywell.ascot.network.INetworkParam; + +public interface IDeviceModelInfo { + public static final String UI_1 = "UI-1*"; + public static final String UI_2 = "UI-2"; + public static final String UI_3 = "UI-3"; + public static final String UI_4 = "UI-4"; + + INetworkParam getAdditionalOutputNcis(String str); + + INetworkParam[] getAllCalibrationOffsetParams(); + + INetworkParam getCSInputNetworkParam(String str); + + INetworkParam getCalibarationOffsetParam(BInputBean bInputBean); + + INetworkParam getCalibarationValueParam(BInputBean bInputBean); + + String getCalibrationOffsetNWVariableName(BInputBean bInputBean); + + String getCalibrationValueNWVariableName(BInputBean bInputBean); + + String[] getComponentListForCalibration(); + + String[] getComponentListForDiagnostics(); + + String[] getComponentListForSetTime(); + + INetworkParam getDepedentNetworkParam(int i); + + INetworkParam getDependentOutputNetworkParam(int i); + + INetworkParam[] getDiagnosticsParam(BOutputBean bOutputBean, IAscotDevice iAscotDevice); + + int getEnumerationForInputPin(int i); + + int getEnumerationForInputPinLive(int i); + + int getEnumerationForOutputPins(int[] iArr); + + INetworkParam getFieldOutputNetworkParam(int i, String str, String str2); + + PinDetail[] getFixedPinAssignment(IOInterface iOInterface, boolean z); + + int getHardwareID(); + + PinDetail[] getIOPins(); + + String getInputNameForPin(int i); + + int getInputPinForEnumeration(int i); + + PinDetail[] getInputPins(); + + int getModelNumber(); + + int getNumOfPinsSupported(); + + int getNumberOfAnalogOutputs(); + + int getNumberOfDigitalInputs(); + + int getNumberOfDigitalOutputs(); + + int getNumberOfUniversalInputs(); + + String getOutputNameForPin(int i); + + INetworkParam[] getOutputObjects(); + + PinDetail[] getOutputPins(); + + int[] getOutputPinsForEnumeration(int i); + + PinDetail getPinDetailForCustomWiring(int i); + + int getPinEnumForOutput(BOutputBean bOutputBean); + + PinDetail getPinNumber(int i); + + PinDetail[] getPins(); + + String getTagOfInputEnumeration(int i); + + String getTagOfOutputEnumeration(int i); + + boolean isAnalogOutputPin(int i); + + boolean isDigitalOutputPin(int i); + + boolean isDirectAssignment(String str); + + boolean isFloatOutputPin(int i); + + boolean isMainApplicationOutput(String str); + + boolean isOnBoardPressureSensor(String str); + + boolean isSbusSensor(String str); + + boolean isSensorCalibrationAllowed(BInputBean bInputBean); + + boolean usesFlexibleFloatingOutputs(); +} diff --git a/decompiled/com/honeywell/ascot/device/IInputOutputInfo.java b/decompiled/com/honeywell/ascot/device/IInputOutputInfo.java new file mode 100644 index 0000000..a5157e7 --- /dev/null +++ b/decompiled/com/honeywell/ascot/device/IInputOutputInfo.java @@ -0,0 +1,44 @@ +package com.honeywell.ascot.device; + +import com.honeywell.ascot.beans.io.IOInterface; +import com.honeywell.ascot.network.INetworkParam; + +public interface IInputOutputInfo { + INetworkParam getAdditionalOutputNcis(String str); + + INetworkParam getCSInputNetworkParam(String str); + + INetworkParam getDepedentNetworkParam(int i); + + INetworkParam getDependentOutputNetworkParam(int i); + + INetworkParam getFieldOutputNetworkParam(int i, String str, String str2); + + INetworkParam getFieldOutputNetworkParam(String str, String str2); + + PinDetail[] getFixedPinAssignment(IOInterface iOInterface); + + PinDetail[] getIOPins(); + + PinDetail[] getInputPins(); + + int getNumOfPinsSupported(); + + int[] getOuputPinsForEnumeration(int i); + + PinDetail[] getOutputPins(); + + int getPinForEnumeration(int i); + + PinDetail getPinNumber(int i); + + PinDetail[] getPins(); + + boolean isAnalogOutputPin(int i); + + boolean isDigitalOutputPin(int i); + + boolean isDirectAssignmentPin(int i); + + boolean isFloatOutputPin(int i); +} diff --git a/decompiled/com/honeywell/ascot/device/IMainAppOutputEnumUnitMap.java b/decompiled/com/honeywell/ascot/device/IMainAppOutputEnumUnitMap.java new file mode 100644 index 0000000..23fa303 --- /dev/null +++ b/decompiled/com/honeywell/ascot/device/IMainAppOutputEnumUnitMap.java @@ -0,0 +1,5 @@ +package com.honeywell.ascot.device; + +public interface IMainAppOutputEnumUnitMap { + Object[][] getMainAppEnumUnitMap(); +} diff --git a/decompiled/com/honeywell/ascot/device/INetworkInterfaceInfo.java b/decompiled/com/honeywell/ascot/device/INetworkInterfaceInfo.java new file mode 100644 index 0000000..ca09a94 --- /dev/null +++ b/decompiled/com/honeywell/ascot/device/INetworkInterfaceInfo.java @@ -0,0 +1,81 @@ +package com.honeywell.ascot.device; + +import com.honeywell.ascot.beans.IManualModeParam; +import com.honeywell.ascot.network.INetworkParam; +import java.util.List; + +public interface INetworkInterfaceInfo { + IManualModeParam fetchParamsToSetDeviceToManualMode(); + + List getAccloopInputFields(String str); + + INetworkParam getAlarmParam(); + + INetworkParam[] getAlarmsParam(); + + INetworkParam getAppModeForMonitoring(); + + String getBeanRefsForNetworkParam(INetworkParam iNetworkParam); + + String getBeanRefsForNetworkParamWithFieldName(INetworkParam iNetworkParam); + + INetworkParam getCalOffsetNetworkParamForPin(int i); + + String[] getCalibrationOffsetNetworkParamList(); + + int getConfigBitForNetworkParam(INetworkParam iNetworkParam); + + int[] getConfigBitsForBeanRef(String str); + + INetworkParam getDayParamToWrite(); + + INetworkParam getFloatingNetworkParamForBeanRef(String str); + + INetworkParam[] getHolidaysParam(); + + INetworkParam getHourParamToWrite(); + + List getIOConfigNetworkParams(); + + List getMainAppInputFields(String str); + + INetworkParam getManualModeParam(); + + INetworkParam getManualOccForMonitoring(); + + INetworkParam getMinuteParamToWrite(); + + INetworkParam getMonthParamToWrite(); + + INetworkParam getNetworkParamForConfigBit(int i); + + INetworkParam getNetworkParamForLogicalPin(int i); + + List getNetworkParamListForBeanRef(String str); + + INetworkParam getNetworkParamsForBeanRef(String str); + + List getNetworkParamsThatRequireRestart(); + + int getNoOfBitsInErrors(); + + int getNumberOfNetworkParamsForDownload(); + + INetworkParam getSecondParamToWrite(); + + INetworkParam getTempSetpointForMonitoring(); + + INetworkParam getTimeParamForRead(); + + INetworkParam getYearParamToWrite(); + + boolean isCalibrationOffset(int i); + + boolean isConfigOfflineFlagSet(INetworkParam iNetworkParam); + + boolean isNetworkParamSupported(String str); + + void resetDOLiveValues(BDeviceInfo bDeviceInfo) throws Exception; + + void updateDOLiveValues(BDeviceInfo bDeviceInfo, int[] iArr) throws Exception; +} diff --git a/decompiled/com/honeywell/ascot/device/IRangePrecisionInfo.java b/decompiled/com/honeywell/ascot/device/IRangePrecisionInfo.java new file mode 100644 index 0000000..48c96f3 --- /dev/null +++ b/decompiled/com/honeywell/ascot/device/IRangePrecisionInfo.java @@ -0,0 +1,5 @@ +package com.honeywell.ascot.device; + +public interface IRangePrecisionInfo { + String[][] getRangePrecisionMap(); +} diff --git a/decompiled/com/honeywell/ascot/device/IWiringInfo.java b/decompiled/com/honeywell/ascot/device/IWiringInfo.java new file mode 100644 index 0000000..a6d15ec --- /dev/null +++ b/decompiled/com/honeywell/ascot/device/IWiringInfo.java @@ -0,0 +1,38 @@ +package com.honeywell.ascot.device; + +import javax.baja.gx.BEllipseGeom; +import javax.baja.gx.BLineGeom; +import javax.baja.gx.BRectGeom; +import javax.baja.ui.BLayout; + +public interface IWiringInfo { + BRectGeom getEquipment(int i); + + BLineGeom[] getEquipmentConnector(int i); + + BRectGeom getSylkBusBlocks(); + + BLineGeom[] getSylkBusConnectors(); + + BRectGeom getZeleny1Block(); + + BLineGeom[] getZeleny1Connectors(); + + BEllipseGeom[] getZeleny1Knobs(); + + BRectGeom getZeleny2Block(); + + BLineGeom[] getZeleny2Connectors(); + + BEllipseGeom[] getZeleny2Knobs(); + + BRectGeom getZelenyBlock(int i); + + BLayout getZelenyCenterLayout(int i); + + BLayout getZelenyHumLabelLayout(int i); + + BLayout getZelenyTempLabelLayout(int i); + + BRectGeom getZioBlock(); +} diff --git a/decompiled/com/honeywell/ascot/factory/IDeviceDataModelFactory.java b/decompiled/com/honeywell/ascot/factory/IDeviceDataModelFactory.java new file mode 100644 index 0000000..3c25e0e --- /dev/null +++ b/decompiled/com/honeywell/ascot/factory/IDeviceDataModelFactory.java @@ -0,0 +1,51 @@ +package com.honeywell.ascot.factory; + +import com.honeywell.ascot.alarms.IAlarmsInfo; +import com.honeywell.ascot.beans.IDeviceBean; +import com.honeywell.ascot.device.BDeviceConfigState; +import com.honeywell.ascot.device.IAscotDevice; +import com.honeywell.ascot.device.IDeviceModelInfo; +import com.honeywell.ascot.device.IMainAppOutputEnumUnitMap; +import com.honeywell.ascot.device.INetworkInterfaceInfo; +import com.honeywell.ascot.device.IRangePrecisionInfo; +import com.honeywell.ascot.device.IWiringInfo; +import com.honeywell.ascot.monitoring.IMonitoringInfo; +import com.honeywell.ascot.onlineOperations.diagnostics.DiagnosticsHandler; +import com.honeywell.ascot.onlineOperations.monitoring.MonitoringManager; +import com.honeywell.ascot.util.ITypeMap; +import com.honeywell.ascot.util.ui.GenerateWiringDiagramHandler; +import javax.baja.agent.AgentList; + +public interface IDeviceDataModelFactory { + AgentList getAgents(AgentList agentList); + + IAlarmsInfo getAlarmsInfo(); + + IDeviceBean getDeviceBean(); + + BDeviceConfigState getDeviceConfigState(); + + IDeviceModelInfo getDeviceModel(); + + DiagnosticsHandler getDiagnosticsHandler(IAscotDevice iAscotDevice, IDeviceBean iDeviceBean) throws Exception; + + IMainAppOutputEnumUnitMap getMainAppEnumUnitInfo(); + + IMonitoringInfo getMonitoringInfo(); + + MonitoringManager getMonitoringManager(); + + INetworkInterfaceInfo getNetworkInterfaceInfo(); + + String getOverlayPxPath(); + + IRangePrecisionInfo getRangePrecisionInfo(); + + ITypeMap getTypeMap(); + + GenerateWiringDiagramHandler getWiringDiagramHandler(); + + IWiringInfo getWiringInfo(); + + String getWiringPxPath(); +} diff --git a/decompiled/com/honeywell/ascot/factory/IDeviceNetworkInterfaceFactory.java b/decompiled/com/honeywell/ascot/factory/IDeviceNetworkInterfaceFactory.java new file mode 100644 index 0000000..56e9ee8 --- /dev/null +++ b/decompiled/com/honeywell/ascot/factory/IDeviceNetworkInterfaceFactory.java @@ -0,0 +1,10 @@ +package com.honeywell.ascot.factory; + +import com.honeywell.ascot.device.IAscotDevice; +import com.honeywell.ascot.onlineOperations.monitoring.IMonitoringHandler; + +public interface IDeviceNetworkInterfaceFactory { + IMonitoringHandler getMonitoringHandler(IAscotDevice iAscotDevice) throws Exception; + + NetworkInterfaceFactory getNetworkInterfaceFactory(); +} diff --git a/decompiled/com/honeywell/ascot/factory/IReadWriteFactory.java b/decompiled/com/honeywell/ascot/factory/IReadWriteFactory.java new file mode 100644 index 0000000..4e9053e --- /dev/null +++ b/decompiled/com/honeywell/ascot/factory/IReadWriteFactory.java @@ -0,0 +1,14 @@ +package com.honeywell.ascot.factory; + +import com.honeywell.ascot.network.read.IRead; +import com.honeywell.ascot.network.write.IWrite; + +public interface IReadWriteFactory { + IRead getNetworkInterfaceReadOffline(); + + IRead getNetworkInterfaceReadOnline(); + + IWrite getNetworkInterfaceWriteOffline(); + + IWrite getNetworkInterfaceWriteOnline(); +} diff --git a/decompiled/com/honeywell/ascot/monitoring/IMonitoringInfo.java b/decompiled/com/honeywell/ascot/monitoring/IMonitoringInfo.java new file mode 100644 index 0000000..e3ce1c3 --- /dev/null +++ b/decompiled/com/honeywell/ascot/monitoring/IMonitoringInfo.java @@ -0,0 +1,24 @@ +package com.honeywell.ascot.monitoring; + +import com.honeywell.ascot.beans.onlineOperations.monitoring.MonitoringParamDetails; +import com.honeywell.ascot.device.IAscotDevice; +import com.honeywell.ascot.network.INetworkParam; +import java.util.ArrayList; + +public interface IMonitoringInfo { + ArrayList getBeanRef(String str); + + String[] getComponentListForLease(); + + String getCustomEnumTag(String str); + + String[] getInputsInfoFromWizard(); + + INetworkParam getWritableNetworkParam(String str); + + boolean isParameterInteger(MonitoringParamDetails monitoringParamDetails); + + boolean isPointConfigured(IAscotDevice iAscotDevice, String str); + + boolean isRangeCheckNeeded(String str); +} diff --git a/decompiled/com/honeywell/ascot/network/INetworkParam.java b/decompiled/com/honeywell/ascot/network/INetworkParam.java new file mode 100644 index 0000000..96f15ad --- /dev/null +++ b/decompiled/com/honeywell/ascot/network/INetworkParam.java @@ -0,0 +1,4 @@ +package com.honeywell.ascot.network; + +public interface INetworkParam { +} diff --git a/decompiled/com/honeywell/ascot/network/read/INetworkToSession.java b/decompiled/com/honeywell/ascot/network/read/INetworkToSession.java new file mode 100644 index 0000000..50cc910 --- /dev/null +++ b/decompiled/com/honeywell/ascot/network/read/INetworkToSession.java @@ -0,0 +1,8 @@ +package com.honeywell.ascot.network.read; + +import com.honeywell.ascot.beans.IAscotBean; +import com.honeywell.ascot.device.BDeviceInfo; + +public interface INetworkToSession { + void populateSession(IAscotBean iAscotBean, BDeviceInfo bDeviceInfo, int i) throws Exception; +} diff --git a/decompiled/com/honeywell/ascot/network/read/IRead.java b/decompiled/com/honeywell/ascot/network/read/IRead.java new file mode 100644 index 0000000..f3f5377 --- /dev/null +++ b/decompiled/com/honeywell/ascot/network/read/IRead.java @@ -0,0 +1,16 @@ +package com.honeywell.ascot.network.read; + +import com.honeywell.ascot.network.INetworkParam; +import javax.baja.driver.BDevice; +import javax.baja.sys.BFacets; +import javax.baja.sys.BValue; + +public interface IRead { + BFacets readFacetsForNetworkParam(BDevice bDevice, INetworkParam iNetworkParam); + + BValue readNetworkParam(BDevice bDevice, INetworkParam iNetworkParam); + + BValue readNetworkParamFromStation(BDevice bDevice, INetworkParam iNetworkParam); + + BValue[] readNetworkParamValues(BDevice bDevice, INetworkParam iNetworkParam, boolean z); +} diff --git a/decompiled/com/honeywell/ascot/network/write/ISessionToNetwork.java b/decompiled/com/honeywell/ascot/network/write/ISessionToNetwork.java new file mode 100644 index 0000000..203db78 --- /dev/null +++ b/decompiled/com/honeywell/ascot/network/write/ISessionToNetwork.java @@ -0,0 +1,8 @@ +package com.honeywell.ascot.network.write; + +import com.honeywell.ascot.beans.IAscotBean; +import com.honeywell.ascot.device.BDeviceInfo; + +public interface ISessionToNetwork { + void populateToNetworkInterface(IAscotBean iAscotBean, BDeviceInfo bDeviceInfo, int i) throws Exception; +} diff --git a/decompiled/com/honeywell/ascot/network/write/IWrite.java b/decompiled/com/honeywell/ascot/network/write/IWrite.java new file mode 100644 index 0000000..cfcf888 --- /dev/null +++ b/decompiled/com/honeywell/ascot/network/write/IWrite.java @@ -0,0 +1,12 @@ +package com.honeywell.ascot.network.write; + +import com.honeywell.ascot.network.INetworkParam; +import javax.baja.driver.BDevice; +import javax.baja.sys.BFacets; +import javax.baja.sys.BValue; + +public interface IWrite { + void writeFacetsForNetworkParam(BDevice bDevice, INetworkParam iNetworkParam, BFacets bFacets); + + void writeNetworkParam(BDevice bDevice, INetworkParam iNetworkParam, BValue bValue); +} diff --git a/decompiled/com/honeywell/ascot/objects/IPriorityArrayIndex.java b/decompiled/com/honeywell/ascot/objects/IPriorityArrayIndex.java new file mode 100644 index 0000000..42dd8e2 --- /dev/null +++ b/decompiled/com/honeywell/ascot/objects/IPriorityArrayIndex.java @@ -0,0 +1,7 @@ +package com.honeywell.ascot.objects; + +import com.tridium.bacnet.asn.AsnInputStream; + +public interface IPriorityArrayIndex { + void readFromPriorityArrayIndex(AsnInputStream asnInputStream) throws Exception; +} diff --git a/decompiled/com/honeywell/ascot/onlineOperations/alarms/IAlarmsManager.java b/decompiled/com/honeywell/ascot/onlineOperations/alarms/IAlarmsManager.java new file mode 100644 index 0000000..8984ca9 --- /dev/null +++ b/decompiled/com/honeywell/ascot/onlineOperations/alarms/IAlarmsManager.java @@ -0,0 +1,8 @@ +package com.honeywell.ascot.onlineOperations.alarms; + +import com.honeywell.ascot.beans.onlineOperations.alarms.IAlarmConfigBean; +import com.honeywell.ascot.device.IAscotDevice; + +public interface IAlarmsManager { + IAlarmConfigBean[] getAlarmDetails(IAscotDevice iAscotDevice) throws Exception; +} diff --git a/decompiled/com/honeywell/ascot/onlineOperations/monitoring/IMonitoringHandler.java b/decompiled/com/honeywell/ascot/onlineOperations/monitoring/IMonitoringHandler.java new file mode 100644 index 0000000..8ed9f5d --- /dev/null +++ b/decompiled/com/honeywell/ascot/onlineOperations/monitoring/IMonitoringHandler.java @@ -0,0 +1,22 @@ +package com.honeywell.ascot.onlineOperations.monitoring; + +import com.honeywell.ascot.beans.onlineOperations.monitoring.MonitoringParamDetails; +import com.honeywell.ascot.device.IAscotDevice; +import com.honeywell.ascot.monitoring.IMonitoringInfo; +import com.honeywell.ascot.network.INetworkParam; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.ui.BWidget; +import javax.baja.util.Lexicon; + +public interface IMonitoringHandler { + BComponent[] getComponentsToRegister(IAscotDevice iAscotDevice); + + BComponent getManualModeComponent(); + + BValue readFromController(INetworkParam iNetworkParam) throws Exception; + + void updateMonitoringParamDetails(MonitoringParamDetails[] monitoringParamDetailsArr) throws Exception; + + void updateWritableValues(MonitoringParamDetails monitoringParamDetails, BWidget bWidget, Lexicon lexicon, IMonitoringInfo iMonitoringInfo); +} diff --git a/decompiled/com/honeywell/ascot/onlineOperations/monitoring/IMonitoringManager.java b/decompiled/com/honeywell/ascot/onlineOperations/monitoring/IMonitoringManager.java new file mode 100644 index 0000000..3f8b425 --- /dev/null +++ b/decompiled/com/honeywell/ascot/onlineOperations/monitoring/IMonitoringManager.java @@ -0,0 +1,8 @@ +package com.honeywell.ascot.onlineOperations.monitoring; + +import com.honeywell.ascot.device.IAscotDevice; +import java.util.List; + +public interface IMonitoringManager { + void setMonitoringPoints(IAscotDevice iAscotDevice, List list); +} diff --git a/decompiled/com/honeywell/ascot/util/ITypeMap.java b/decompiled/com/honeywell/ascot/util/ITypeMap.java new file mode 100644 index 0000000..b76dcc9 --- /dev/null +++ b/decompiled/com/honeywell/ascot/util/ITypeMap.java @@ -0,0 +1,17 @@ +package com.honeywell.ascot.util; + +import com.honeywell.ascot.beans.io.inputs.BInputsConfigurationBean; +import com.honeywell.ascot.beans.io.outputs.BOutputsConfigurationBean; +import java.util.List; + +public interface ITypeMap { + List getSourcesForType(String str); + + Class getTypeFor(String str, String str2); + + boolean isPinAssignmentRequired(String str); + + void setBeanFor(BInputsConfigurationBean bInputsConfigurationBean, String str); + + void setBeanFor(BOutputsConfigurationBean bOutputsConfigurationBean, String str); +} diff --git a/decompiled/com/honeywell/ascot/util/ui/SubscriberInterface.java b/decompiled/com/honeywell/ascot/util/ui/SubscriberInterface.java new file mode 100644 index 0000000..6173cf5 --- /dev/null +++ b/decompiled/com/honeywell/ascot/util/ui/SubscriberInterface.java @@ -0,0 +1,7 @@ +package com.honeywell.ascot.util.ui; + +public interface SubscriberInterface { + void loadHolidayTab() throws Exception; + + void updateDay() throws Exception; +} diff --git a/decompiled/com/honeywell/bacnet/datasharing/IBacnetFailDetectSupport.java b/decompiled/com/honeywell/bacnet/datasharing/IBacnetFailDetectSupport.java new file mode 100644 index 0000000..aef7c6b --- /dev/null +++ b/decompiled/com/honeywell/bacnet/datasharing/IBacnetFailDetectSupport.java @@ -0,0 +1,5 @@ +package com.honeywell.bacnet.datasharing; + +public interface IBacnetFailDetectSupport { + void linksChanged(); +} diff --git a/decompiled/com/honeywell/bacnet/datasharing/ui/IStaticReferenceCallback.java b/decompiled/com/honeywell/bacnet/datasharing/ui/IStaticReferenceCallback.java new file mode 100644 index 0000000..360bf33 --- /dev/null +++ b/decompiled/com/honeywell/bacnet/datasharing/ui/IStaticReferenceCallback.java @@ -0,0 +1,7 @@ +package com.honeywell.bacnet.datasharing.ui; + +import javax.baja.ui.BWidget; + +public interface IStaticReferenceCallback { + void makeStaticReferences(BWidget bWidget); +} diff --git a/decompiled/com/honeywell/bacnet/datasharing/ui/a.java b/decompiled/com/honeywell/bacnet/datasharing/ui/a.java new file mode 100644 index 0000000..52095bb --- /dev/null +++ b/decompiled/com/honeywell/bacnet/datasharing/ui/a.java @@ -0,0 +1,4 @@ +package com.honeywell.bacnet.datasharing.ui; + +final class a { +} diff --git a/decompiled/com/honeywell/bacnetSpyder/io/IO_BACnetRelayModel.xml b/decompiled/com/honeywell/bacnetSpyder/io/IO_BACnetRelayModel.xml new file mode 100644 index 0000000..336139c --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/io/IO_BACnetRelayModel.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decompiled/com/honeywell/bacnetSpyder/networkInterface/IBACnetNwObject.java b/decompiled/com/honeywell/bacnetSpyder/networkInterface/IBACnetNwObject.java new file mode 100644 index 0000000..0256ef6 --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/networkInterface/IBACnetNwObject.java @@ -0,0 +1,36 @@ +package com.honeywell.bacnetSpyder.networkInterface; + +import com.honeywell.bacnetSpyder.xl10Controller.datatypes.BBacnetNvConfigurationDescriptor; +import com.honeywell.honeywellXL10NextGen.logicContainers.BIMacro; +import com.honeywell.honeywellXL10NextGen.networkInterface.INetworkObject; +import com.honeywell.honeywellXL10NextGen.points.BIOPointInterface; +import javax.baja.bacnet.enums.BBacnetObjectType; +import javax.baja.util.Array; + +public interface IBACnetNwObject extends INetworkObject { + boolean canObjectBeEdited(); + + boolean canObjectBeExposed(); + + boolean canObjectBeRemoved(); + + void fillNvConfigStructureForCompilation(BBacnetNvConfigurationDescriptor bBacnetNvConfigurationDescriptor); + + int getObjectId(); + + String getObjectName(); + + BBacnetObjectType getObjectType(); + + String mapObjectToPoint(BIMacro bIMacro, BIOPointInterface[] bIOPointInterfaceArr, BIOPointInterface[] bIOPointInterfaceArr2, Array array); + + void setObjectId(int i); + + void setObjectName(String str); + + void setObjectSpecificProperties(BIOPointInterface bIOPointInterface); + + void setObjectType(BBacnetObjectType bBacnetObjectType); + + void updateProperties(BIOPointInterface bIOPointInterface, BIOPointInterface bIOPointInterface2); +} diff --git a/decompiled/com/honeywell/bacnetSpyder/networkInterface/ICovIncrement.java b/decompiled/com/honeywell/bacnetSpyder/networkInterface/ICovIncrement.java new file mode 100644 index 0000000..935c816 --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/networkInterface/ICovIncrement.java @@ -0,0 +1,7 @@ +package com.honeywell.bacnetSpyder.networkInterface; + +public interface ICovIncrement { + float getSenDelta(); + + void setSenDelta(float f); +} diff --git a/decompiled/com/honeywell/bacnetSpyder/networkInterface/IFailDetect.java b/decompiled/com/honeywell/bacnetSpyder/networkInterface/IFailDetect.java new file mode 100644 index 0000000..883e556 --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/networkInterface/IFailDetect.java @@ -0,0 +1,11 @@ +package com.honeywell.bacnetSpyder.networkInterface; + +public interface IFailDetect extends IBACnetNwObject { + boolean getBFailDetect(); + + int getFailDetectTime(); + + void setBFailDetect(boolean z); + + void setFailDetectTime(int i); +} diff --git a/decompiled/com/honeywell/bacnetSpyder/networkInterface/IGpuRefresh.java b/decompiled/com/honeywell/bacnetSpyder/networkInterface/IGpuRefresh.java new file mode 100644 index 0000000..ead9d88 --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/networkInterface/IGpuRefresh.java @@ -0,0 +1,11 @@ +package com.honeywell.bacnetSpyder.networkInterface; + +public interface IGpuRefresh { + boolean getBGPURefresh(); + + int getGpuRefreshTime(); + + void setBGPURefresh(boolean z); + + void setGpuRefreshTime(int i); +} diff --git a/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkInput.java b/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkInput.java new file mode 100644 index 0000000..d27c5b3 --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkInput.java @@ -0,0 +1,4 @@ +package com.honeywell.bacnetSpyder.networkInterface; + +public interface INetworkInput extends IFailDetect, INetworkThrottlingInterval { +} diff --git a/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkOutput.java b/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkOutput.java new file mode 100644 index 0000000..19650d9 --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkOutput.java @@ -0,0 +1,4 @@ +package com.honeywell.bacnetSpyder.networkInterface; + +public interface INetworkOutput extends INetworkThrottlingInterval, IGpuRefresh { +} diff --git a/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkPhysicalInput.java b/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkPhysicalInput.java new file mode 100644 index 0000000..f1fda88 --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkPhysicalInput.java @@ -0,0 +1,4 @@ +package com.honeywell.bacnetSpyder.networkInterface; + +public interface INetworkPhysicalInput extends IGpuRefresh, INetworkThrottlingInterval { +} diff --git a/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkPhysicalOutput.java b/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkPhysicalOutput.java new file mode 100644 index 0000000..2aa4eea --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkPhysicalOutput.java @@ -0,0 +1,4 @@ +package com.honeywell.bacnetSpyder.networkInterface; + +public interface INetworkPhysicalOutput extends IPriorityArray, IGpuRefresh, IFailDetect, INetworkThrottlingInterval { +} diff --git a/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkSetPoint.java b/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkSetPoint.java new file mode 100644 index 0000000..a490834 --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkSetPoint.java @@ -0,0 +1,4 @@ +package com.honeywell.bacnetSpyder.networkInterface; + +public interface INetworkSetPoint extends INetworkThrottlingInterval { +} diff --git a/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkThrottlingInterval.java b/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkThrottlingInterval.java new file mode 100644 index 0000000..c02faab --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/networkInterface/INetworkThrottlingInterval.java @@ -0,0 +1,7 @@ +package com.honeywell.bacnetSpyder.networkInterface; + +public interface INetworkThrottlingInterval { + int getNetworkThrottlingInterval(); + + void setNetworkThrottlingInterval(int i); +} diff --git a/decompiled/com/honeywell/bacnetSpyder/networkInterface/IPriorityArray.java b/decompiled/com/honeywell/bacnetSpyder/networkInterface/IPriorityArray.java new file mode 100644 index 0000000..81a55ac --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/networkInterface/IPriorityArray.java @@ -0,0 +1,15 @@ +package com.honeywell.bacnetSpyder.networkInterface; + +public interface IPriorityArray extends IBACnetNwObject { + int getLogicCommandPriority(); + + float getRelinquishValue(); + + boolean getRelinquishValueChangedFlag(); + + void setLogicCommandPriority(int i); + + void setRelinquishValue(float f); + + void setRelinquishValueChangedFlag(boolean z); +} diff --git a/decompiled/com/honeywell/bacnetSpyder/networkInterface/ITimeObject.java b/decompiled/com/honeywell/bacnetSpyder/networkInterface/ITimeObject.java new file mode 100644 index 0000000..a3d6263 --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/networkInterface/ITimeObject.java @@ -0,0 +1,4 @@ +package com.honeywell.bacnetSpyder.networkInterface; + +public interface ITimeObject { +} diff --git a/decompiled/com/honeywell/bacnetSpyder/networkInterface/IUICalOffset.java b/decompiled/com/honeywell/bacnetSpyder/networkInterface/IUICalOffset.java new file mode 100644 index 0000000..9470faf --- /dev/null +++ b/decompiled/com/honeywell/bacnetSpyder/networkInterface/IUICalOffset.java @@ -0,0 +1,32 @@ +package com.honeywell.bacnetSpyder.networkInterface; + +import com.honeywell.honeywellXL10NextGen.networkInterface.INetworkObject; +import com.honeywell.honeywellXL10NextGen.points.BIOPointInterface; + +public interface IUICalOffset extends IBACnetNwObject { + public static final int UICALOFFSET0 = 37376; + public static final int UICALOFFSET1 = 37377; + public static final int UICALOFFSET2 = 37378; + public static final int UICALOFFSET3 = 37379; + public static final int UICALOFFSET4 = 37380; + public static final int UICALOFFSET5 = 37381; + public static final int UICALOFFSET6 = 37382; + + int getAddressAssignedInMI(); + + INetworkObject getCorrespondingAINetworkObject(); + + int getCorrespondingAINwObjectID(); + + String getCorrespondingAINwObjectName(); + + BIOPointInterface getCorrespondingModulatingInput(); + + int getPVID(); + + String getUnitOfCorrespondingMI(); + + void setCorrespondingAINwObjectID(int i); + + void setCorrespondingAINwObjectName(String str); +} diff --git a/decompiled/com/honeywell/beans/IDayLightSavings.java b/decompiled/com/honeywell/beans/IDayLightSavings.java new file mode 100644 index 0000000..5077d17 --- /dev/null +++ b/decompiled/com/honeywell/beans/IDayLightSavings.java @@ -0,0 +1,33 @@ +package com.honeywell.beans; + +import com.honeywell.ascot.beans.generalsettings.BDayLightSavingBean; +import javax.baja.sys.BEnum; +import javax.baja.sys.BEnumRange; + +public interface IDayLightSavings { + BDayLightSavingBean getDayLightSavingBean(); + + int getEndDayOrdinal(); + + BEnumRange getEndDayRange(); + + int getEndMonthOrdinal(); + + BEnumRange getEndMonthRange(); + + int getStartDayOrdinal(); + + int getStartMonthOrdinal(); + + boolean isDayLightSavingsSelected(); + + void setDayLightSavingsSelected(boolean z); + + void setEndDayOrdinal(BEnum bEnum); + + void setEndMonthOrdinal(BEnum bEnum); + + void setStartDayOrdinal(BEnum bEnum); + + void setStartMonthOrdinal(BEnum bEnum); +} diff --git a/decompiled/com/honeywell/beans/IScheduleDay.java b/decompiled/com/honeywell/beans/IScheduleDay.java new file mode 100644 index 0000000..6c05070 --- /dev/null +++ b/decompiled/com/honeywell/beans/IScheduleDay.java @@ -0,0 +1,9 @@ +package com.honeywell.beans; + +import javax.baja.sys.BTime; + +public interface IScheduleDay { + IScheduleEvent getEvent(int i) throws Exception; + + void setEvent(int i, BTime bTime, int i2) throws Exception; +} diff --git a/decompiled/com/honeywell/beans/IScheduleEvent.java b/decompiled/com/honeywell/beans/IScheduleEvent.java new file mode 100644 index 0000000..6fda8d5 --- /dev/null +++ b/decompiled/com/honeywell/beans/IScheduleEvent.java @@ -0,0 +1,11 @@ +package com.honeywell.beans; + +import javax.baja.sys.BTime; + +public interface IScheduleEvent { + boolean getIsEnabled(); + + BTime getStartTime(); + + int getStateOrdinal(); +} diff --git a/decompiled/com/honeywell/device/templates/a.java b/decompiled/com/honeywell/device/templates/a.java new file mode 100644 index 0000000..efdf39b --- /dev/null +++ b/decompiled/com/honeywell/device/templates/a.java @@ -0,0 +1,4 @@ +package com.honeywell.device.templates; + +final class a { +} diff --git a/decompiled/com/honeywell/field/IDisplayInfo.java b/decompiled/com/honeywell/field/IDisplayInfo.java new file mode 100644 index 0000000..0dcdb18 --- /dev/null +++ b/decompiled/com/honeywell/field/IDisplayInfo.java @@ -0,0 +1,5 @@ +package com.honeywell.field; + +public interface IDisplayInfo { + String getDisplayText(String str); +} diff --git a/decompiled/com/honeywell/field/IStaticReferenceCallback.java b/decompiled/com/honeywell/field/IStaticReferenceCallback.java new file mode 100644 index 0000000..e69453c --- /dev/null +++ b/decompiled/com/honeywell/field/IStaticReferenceCallback.java @@ -0,0 +1,7 @@ +package com.honeywell.field; + +import java.util.Map; + +public interface IStaticReferenceCallback { + void makeStaticReferences(Map map); +} diff --git a/decompiled/com/honeywell/flowbalancer/ui/IBalanceableDevice.java b/decompiled/com/honeywell/flowbalancer/ui/IBalanceableDevice.java new file mode 100644 index 0000000..de2e1aa --- /dev/null +++ b/decompiled/com/honeywell/flowbalancer/ui/IBalanceableDevice.java @@ -0,0 +1,5 @@ +package com.honeywell.flowbalancer.ui; + +public interface IBalanceableDevice { + void loadNetworkObjects(); +} diff --git a/decompiled/com/honeywell/flowbalancer/validator/IFBValidator.java b/decompiled/com/honeywell/flowbalancer/validator/IFBValidator.java new file mode 100644 index 0000000..da4c895 --- /dev/null +++ b/decompiled/com/honeywell/flowbalancer/validator/IFBValidator.java @@ -0,0 +1,9 @@ +package com.honeywell.flowbalancer.validator; + +import com.honeywell.flowbalancer.dynamicbean.DynamicBean; + +public interface IFBValidator { + ValidationError getError(); + + boolean validate(DynamicBean dynamicBean); +} diff --git a/decompiled/com/honeywell/framework/IConfigurationStepContainer.java b/decompiled/com/honeywell/framework/IConfigurationStepContainer.java new file mode 100644 index 0000000..a8909e7 --- /dev/null +++ b/decompiled/com/honeywell/framework/IConfigurationStepContainer.java @@ -0,0 +1,13 @@ +package com.honeywell.framework; + +public interface IConfigurationStepContainer { + BStep[] getSteps(); + + void load(int i) throws StepContainerException; + + void reset(); + + void save(); + + void unload(int i) throws StepContainerException; +} diff --git a/decompiled/com/honeywell/framework/diamondGreen.png b/decompiled/com/honeywell/framework/diamondGreen.png new file mode 100644 index 0000000..1ce89fb Binary files /dev/null and b/decompiled/com/honeywell/framework/diamondGreen.png differ diff --git a/decompiled/com/honeywell/framework/diamondRed.png b/decompiled/com/honeywell/framework/diamondRed.png new file mode 100644 index 0000000..d341c24 Binary files /dev/null and b/decompiled/com/honeywell/framework/diamondRed.png differ diff --git a/decompiled/com/honeywell/framework/dragdrop/IStaticReferenceCallback.java b/decompiled/com/honeywell/framework/dragdrop/IStaticReferenceCallback.java new file mode 100644 index 0000000..744c62d --- /dev/null +++ b/decompiled/com/honeywell/framework/dragdrop/IStaticReferenceCallback.java @@ -0,0 +1,7 @@ +package com.honeywell.framework.dragdrop; + +import javax.baja.ui.BWidget; + +public interface IStaticReferenceCallback { + void makeStaticReferences(BWidget bWidget); +} diff --git a/decompiled/com/honeywell/generic/ui/framework/IUIFwRequest.java b/decompiled/com/honeywell/generic/ui/framework/IUIFwRequest.java new file mode 100644 index 0000000..b798f2c --- /dev/null +++ b/decompiled/com/honeywell/generic/ui/framework/IUIFwRequest.java @@ -0,0 +1,17 @@ +package com.honeywell.generic.ui.framework; + +public interface IUIFwRequest { + void addBean(String str, Object obj); + + void clearBeans(); + + String getActionName(); + + Object getBean(String str); + + int getBeanCount(); + + String[] getBeanNames(); + + IUIFwSession getSession(); +} diff --git a/decompiled/com/honeywell/generic/ui/framework/IUIFwResponse.java b/decompiled/com/honeywell/generic/ui/framework/IUIFwResponse.java new file mode 100644 index 0000000..582f196 --- /dev/null +++ b/decompiled/com/honeywell/generic/ui/framework/IUIFwResponse.java @@ -0,0 +1,19 @@ +package com.honeywell.generic.ui.framework; + +public interface IUIFwResponse { + void addBean(String str, Object obj); + + void clearBeans(); + + Object getBean(String str); + + int getBeanCount(); + + String[] getBeanNames(); + + IUIFwForward getForwardCfg(); + + IUIFwSession getSession(); + + void setForward(String str); +} diff --git a/decompiled/com/honeywell/generic/ui/framework/IUIFwSession.java b/decompiled/com/honeywell/generic/ui/framework/IUIFwSession.java new file mode 100644 index 0000000..431b3d5 --- /dev/null +++ b/decompiled/com/honeywell/generic/ui/framework/IUIFwSession.java @@ -0,0 +1,17 @@ +package com.honeywell.generic.ui.framework; + +public interface IUIFwSession { + void addBean(String str, Object obj); + + void clearBeans(); + + Object getBean(String str); + + int getBeanCount(); + + String[] getBeanNames(); + + long getLastAccessTime(); + + String getSessionId(); +} diff --git a/decompiled/com/honeywell/generic/ui/framework/demo/democfg.xml b/decompiled/com/honeywell/generic/ui/framework/demo/democfg.xml new file mode 100644 index 0000000..95fe8c8 --- /dev/null +++ b/decompiled/com/honeywell/generic/ui/framework/demo/democfg.xml @@ -0,0 +1,46 @@ + + + + 1 + + + name1 + val + + + + name2 + val + + + + name3 + val + + + + + + + + + com.honeywell.generic.ui.framework.demo.MyAction1 + + + + + + + com.honeywell.generic.ui.framework.demo.MyAction2 + Action1Validator1 + + + + + + Action1Validator1 + com.honeywell.generic.ui.framework.demo.MyValidator + + + + diff --git a/decompiled/com/honeywell/honeywellXL10NextGen/deviceModes/common/ui/ISpyderView.java b/decompiled/com/honeywell/honeywellXL10NextGen/deviceModes/common/ui/ISpyderView.java new file mode 100644 index 0000000..41b7a3d --- /dev/null +++ b/decompiled/com/honeywell/honeywellXL10NextGen/deviceModes/common/ui/ISpyderView.java @@ -0,0 +1,5 @@ +package com.honeywell.honeywellXL10NextGen.deviceModes.common.ui; + +public interface ISpyderView { + void validateComplete(); +} diff --git a/decompiled/com/honeywell/honeywellXL10NextGen/deviceModes/common/ui/PointSelectionDialog.xml b/decompiled/com/honeywell/honeywellXL10NextGen/deviceModes/common/ui/PointSelectionDialog.xml new file mode 100644 index 0000000..69e031a --- /dev/null +++ b/decompiled/com/honeywell/honeywellXL10NextGen/deviceModes/common/ui/PointSelectionDialog.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + ")); + htmlWriter.w((Object)("")); + this.writeTableHeader(hxOp, true); + int n = 0; + while (n < array.size()) { + BString bString; + BAlarmRecord bAlarmRecord = (BAlarmRecord)((Object)array.get(n)); + BString bString2 = (BString)bAlarmRecord.getAlarmData().get("sourceName"); + if (bString2 == null) { + bString2 = BString.make((String)bAlarmRecord.getSource().toString()); + } + if ((bString = (BString)bAlarmRecord.getAlarmData().get("msgText")) == null) { + bString = BString.make((String)""); + } + this.writeAlarmRow(hxOp, bAlarmRecord, null); + ++n; + } + } + + protected void writeTableHeader(HxOp hxOp, boolean bl) throws Exception { + HtmlWriter htmlWriter = hxOp.getHtmlWriter(); + htmlWriter.w((Object)""); + htmlWriter.w((Object)""); + htmlWriter.w((Object)""); + htmlWriter.w((Object)""); + htmlWriter.w((Object)" "); + this.writeColumnHeader(hxOp, BAlarmRecord.timestamp, bl); + this.writeColumnHeader(hxOp, BAlarmRecord.source, bl); + this.writeColumnHeader(hxOp, BAlarmRecord.sourceState, bl); + this.writeColumnHeader(hxOp, BAlarmRecord.ackState, bl); + this.writeColumnHeader(hxOp, BAlarmRecord.priority, bl); + this.writeColumnHeader(hxOp, BAlarmRecord.alarmClass, bl); + htmlWriter.w((Object)"Message"); + htmlWriter.w((Object)""); + } + + protected void writeColumnHeader(HxOp hxOp, Property property, boolean bl) throws Exception { + HtmlWriter htmlWriter = hxOp.getHtmlWriter(); + String string = "timestamp"; + boolean bl2 = false; + if (hxOp.getPostBody() != null) { + if (hxOp.getFormValue("sortBy") != null) { + string = hxOp.getFormValue("sortBy"); + } + try { + bl2 = new Boolean(hxOp.getFormValue("sortAscending")); + } + catch (Exception exception) {} + } + htmlWriter.w((Object)""); + boolean bl3 = false; + if (property.getName().equals(string)) { + bl3 = bl2 ^ true; + } + htmlWriter.w((Object)""); + htmlWriter.w((Object)property.getDefaultDisplayName((Context)hxOp)); + if (property.getName().equals(string)) { + if (bl2) { + this.makeImage(sortAsc, hxOp); + } else { + this.makeImage(sortDesc, hxOp); + } + } + htmlWriter.w((Object)""); + htmlWriter.w((Object)""); + } + + protected void writeAlarmRow(HxOp hxOp, BAlarmRecord bAlarmRecord, SourceAlarm sourceAlarm) throws Exception { + BImage bImage; + BString bString; + HtmlWriter htmlWriter = hxOp.getHtmlWriter(); + BString bString2 = (BString)bAlarmRecord.getAlarmData().get("sourceName"); + if (bString2 == null) { + bString2 = BString.make((String)bAlarmRecord.getSource().toString()); + } + if ((bString = (BString)bAlarmRecord.getAlarmData().get("msgText")) == null) { + bString = BString.make((String)""); + } + BFormat bFormat = BFormat.make((String)bString.toString()); + String string = bFormat.format((Object)bAlarmRecord); + BImage bImage2 = greenAlarmImg; + if (bAlarmRecord.getSourceState() == BSourceState.alert) { + bImage2 = orangeAlarmImg; + } else if (bAlarmRecord.isAcknowledged() && !bAlarmRecord.isNormal()) { + bImage2 = yellowAlarmImg; + } else if (!bAlarmRecord.isAcknowledged() && !bAlarmRecord.isNormal()) { + bImage2 = redAlarmImg; + } + htmlWriter.w((Object)""); + String string2 = "hx-AlarmConsole-row"; + htmlWriter.w((Object)("")); + htmlWriter.w((Object)"")); + htmlWriter.w((Object)""); + htmlWriter.w((Object)("")); + if (bAlarmRecord.getAlarmData().get("icon") != null) { + bImage = BImage.make((BOrd)BOrd.make((BOrd)((BComponent)hxOp.get()).getNavOrd(), (String)bAlarmRecord.getAlarmData().get("icon").toString())); + this.makeImage(bImage, hxOp); + } + if (bAlarmRecord.getAlarmData().get("hyperlinkOrd") != null) { + this.makeAlarmHyperlink(bAlarmRecord.getAlarmData().get("hyperlinkOrd").toString(), hxOp); + } else { + this.makeImage(blankImg, hxOp); + } + bImage = this.getVideoImage(bAlarmRecord); + if (bImage != null) { + this.makeImage(bImage, hxOp); + } + this.makeImage(bImage2, hxOp); + htmlWriter.w((Object)""); + htmlWriter.w((Object)("")); + BasicContext basicContext = new BasicContext((Context)hxOp, HX_TIMESTAMP_FACETS); + BHxAlarmConsole.safe(htmlWriter, bAlarmRecord.getTimestamp().toString((Context)basicContext)); + htmlWriter.w((Object)""); + htmlWriter.w((Object)("")); + BHxAlarmConsole.safe(htmlWriter, bString2.toString()); + htmlWriter.w((Object)""); + htmlWriter.w((Object)("")); + BHxAlarmConsole.safe(htmlWriter, bAlarmRecord.getSourceState().toString((Context)hxOp)); + htmlWriter.w((Object)""); + if (sourceAlarm != null) { + if (sourceAlarm.pendingCount == 0) { + htmlWriter.w((Object)("")); + BHxAlarmConsole.safe(htmlWriter, sourceAlarm.ackedCount + " Acked / " + sourceAlarm.unackedCount + " Unacked"); + htmlWriter.w((Object)""); + } else { + htmlWriter.w((Object)("")); + BHxAlarmConsole.safe(htmlWriter, sourceAlarm.ackedCount + " Acked / " + sourceAlarm.unackedCount + " Unacked / " + sourceAlarm.pendingCount + " Ack Pending"); + htmlWriter.w((Object)""); + } + } else { + htmlWriter.w((Object)("")); + BHxAlarmConsole.safe(htmlWriter, bAlarmRecord.getAckState().toString((Context)hxOp)); + htmlWriter.w((Object)""); + } + htmlWriter.w((Object)("")); + BHxAlarmConsole.safe(htmlWriter, "" + bAlarmRecord.getPriority()); + htmlWriter.w((Object)""); + htmlWriter.w((Object)("")); + BHxAlarmConsole.safe(htmlWriter, SlotPath.unescape((String)this.getAlarmService().getAlarmClassDisplayName(BString.make((String)bAlarmRecord.getAlarmClass()), (Context)hxOp).toString())); + htmlWriter.w((Object)""); + htmlWriter.w((Object)("")); + BHxAlarmConsole.safe(htmlWriter, string); + htmlWriter.w((Object)""); + htmlWriter.w((Object)""); + } + + public static void safe(HtmlWriter htmlWriter, Object object) { + if (object == null) { + htmlWriter.w((Object)" "); + } else { + String string = object.toString(); + if (string == null) { + htmlWriter.w((Object)" "); + } + if (string.equals("") || string.equals(" ") || string.equals(" ")) { + htmlWriter.w((Object)" "); + return; + } + htmlWriter.safe(string); + } + } + + public BImage getVideoImage(BAlarmRecord bAlarmRecord) { + return null; + } + + protected void makeAlarmHyperlink(String string, HxOp hxOp) throws Exception { + HtmlWriter htmlWriter = hxOp.getHtmlWriter(); + htmlWriter.w((Object)("")); + this.makeImage(linkImg, "class=\"hx-AlarmConsole-sortImg\"", hxOp); + htmlWriter.w((Object)""); + } + + public void makeImage(BImage bImage, HxOp hxOp) throws Exception { + this.makeImage(bImage, null, hxOp); + } + + public void makeImage(BImage bImage, String string, HxOp hxOp) throws Exception { + String string2; + boolean bl; + HtmlWriter htmlWriter = hxOp.getHtmlWriter(); + String string3 = bImage.getOrdList().get(0).toString(); + boolean bl2 = false; + if (!hxOp.isUpdate() && hxOp.getUserAgent().isIE() && string3.endsWith(".png") && hxOp.getRequest().getMethod().toLowerCase().equals("get")) { + bl2 = bl = true; + } + if (disablePngFixing) { + bl = false; + } + if (bl) { + try { + bImage.sync(); + } + catch (Exception exception) { + bl = false; + } + } + if (bl) { + string2 = Integer.toString((int)bImage.getWidth()); + String string4 = Integer.toString((int)bImage.getHeight()); + htmlWriter.w((Object)""); + } + htmlWriter.w((Object)(" 0) { + htmlWriter.w((Object)" ").w((Object)string); + } + htmlWriter.w((Object)"/>"); + if (bl) { + htmlWriter.w((Object)""); + } + } + + public BAlarmService getAlarmService() { + if (this.alarmService == null) { + this.alarmService = (BAlarmService)Sys.getService((Type)BAlarmService.TYPE); + } + return this.alarmService; + } + + public AlarmCommand[] getCommands(boolean bl, HxOp hxOp) { + Class clazz = class$com$tridium$alarm$hx$BHxAlarmConsole$AlarmCommand; + if (clazz == null) { + clazz = class$com$tridium$alarm$hx$BHxAlarmConsole$AlarmCommand = BHxAlarmConsole.class("[Lcom.tridium.alarm.hx.BHxAlarmConsole$AlarmCommand;", false); + } + Array array = new Array(clazz); + array.add((Object)this.acknowledge); + if (!bl) { + array.add((Object)this.showRecurring); + } else { + array.add((Object)this.showAll); + } + BPermissions bPermissions = hxOp.getPermissionsForTarget(); + if (bPermissions.hasOperatorWrite()) { + array.add((Object)this.addNotes); + } + array.add((Object)this.showDetails); + if (bPermissions.hasAdminWrite() || bPermissions.hasAdminInvoke()) { + array.add((Object)this.forceClear); + } + return (AlarmCommand[])array.trim(); + } + + public Array sortSourceAlarms(Array array, String string, Comparator comparator) { + int n = array.size(); + int n2 = n / 2; + while (n2 >= 1) { + int n3 = n2; + while (n3 < n) { + SourceAlarm sourceAlarm = (SourceAlarm)array.get(n3); + Object object = sourceAlarm.get(string); + int n4 = n3; + while (n4 >= n2 && comparator.compare(object, ((SourceAlarm)array.get(n4 - n2)).get(string)) <= 0) { + if (comparator.compare(object, ((SourceAlarm)array.get(n4 - n2)).get(string)) == 0) { + BAbsTime bAbsTime = (BAbsTime)sourceAlarm.get(BAlarmRecord.timestamp.getName()); + BAbsTime bAbsTime2 = (BAbsTime)((SourceAlarm)array.get(n4 - n2)).get(BAlarmRecord.timestamp.getName()); + if (!bAbsTime2.isBefore(bAbsTime)) break; + array.set(n4, array.get(n4 - n2)); + } else { + array.set(n4, array.get(n4 - n2)); + } + n4 -= n2; + } + array.set(n4, (Object)sourceAlarm); + ++n3; + } + n2 /= 2; + } + return array; + } + + public Array sortAlarms(Array array, String string, Comparator comparator) { + int n = array.size(); + int n2 = n / 2; + while (n2 >= 1) { + int n3 = n2; + while (n3 < n) { + BAlarmRecord bAlarmRecord = (BAlarmRecord)((Object)array.get(n3)); + BValue bValue = bAlarmRecord.get(string); + int n4 = n3; + while (n4 >= n2 && comparator.compare(bValue, ((BAlarmRecord)((Object)array.get(n4 - n2))).get(string)) <= 0) { + if (comparator.compare(bValue, ((BAlarmRecord)((Object)array.get(n4 - n2))).get(string)) == 0) { + BAbsTime bAbsTime = bAlarmRecord.getTimestamp(); + BAbsTime bAbsTime2 = ((BAlarmRecord)((Object)array.get(n4 - n2))).getTimestamp(); + if (!bAbsTime2.isBefore(bAbsTime)) break; + array.set(n4, array.get(n4 - n2)); + } else { + array.set(n4, array.get(n4 - n2)); + } + n4 -= n2; + } + array.set(n4, (Object)bAlarmRecord); + ++n3; + } + n2 /= 2; + } + return array; + } + + public String[] getSelection(HxOp hxOp) { + ArrayList arrayList = new ArrayList(); + String[] stringArray = hxOp.getFormKeys(); + int n = 0; + while (n < stringArray.length) { + if (stringArray[n].startsWith("_")) { + arrayList.add(stringArray[n]); + } + ++n; + } + String[] stringArray2 = new String[arrayList.size()]; + int n2 = 0; + while (n2 < stringArray2.length) { + String string; + stringArray2[n2] = string = ((String)arrayList.get(n2)).substring(1); + ++n2; + } + return stringArray2; + } + + private final String sessionScope(String string, HxOp hxOp) { + String string2 = hxOp.getOrd().relativizeToSession().toString(); + int n = string2.indexOf("|view:"); + if (n > -1) { + string2 = string2.substring(0, n); + } + return string2 + '|' + hxOp.getPath() + '|' + string; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.sheetClass = "window-bg hx-AlarmConsole"; + this.headClass = "window-bg control-border font hx-AlarmConsole-header"; + this.rowClass = "window-bg control-border hx-AlarmConsole-row"; + } + + protected BHxAlarmConsole() { + this.this(); + this.acknowledge = new Acknowledge(this); + this.registerEvent((Event)this.acknowledge); + this.showRecurring = new ShowRecurring(this); + this.registerEvent((Event)this.showRecurring); + this.showAll = new ShowAll(this); + this.registerEvent((Event)this.showAll); + this.showDetails = new ShowDetails(this); + this.registerEvent((Event)this.showDetails); + this.forceClear = new ForceClear(this); + this.registerEvent((Event)this.forceClear); + this.sort = new SortCommand(this); + this.registerEvent((Event)this.sort); + this.addNotes = new AddNotes(this); + this.registerEvent((Event)this.addNotes); + } + + static { + Class clazz = class$com$tridium$alarm$hx$BHxAlarmConsole; + if (clazz == null) { + clazz = class$com$tridium$alarm$hx$BHxAlarmConsole = BHxAlarmConsole.class("[Lcom.tridium.alarm.hx.BHxAlarmConsole;", false); + } + TYPE = Sys.loadType((Class)clazz); + Class clazz2 = class$com$tridium$alarm$hx$BHxAlarmConsole; + if (clazz2 == null) { + clazz2 = class$com$tridium$alarm$hx$BHxAlarmConsole = BHxAlarmConsole.class("[Lcom.tridium.alarm.hx.BHxAlarmConsole;", false); + } + lexicon = Lexicon.make((Class)clazz2); + HX_TIMESTAMP_FACETS = BFacets.make((String)"showSeconds", (BIDataValue)BBoolean.TRUE, (String)"showMilliseconds", (BIDataValue)BBoolean.FALSE); + yellowAlarmImg = BImage.make((String)"module://icons/x16/alarm.png"); + redAlarmImg = BImage.make((String)"module://alarm/com/tridium/alarm/icons/alarmRed.png"); + greenAlarmImg = BImage.make((String)"module://alarm/com/tridium/alarm/icons/alarmGreen.png"); + orangeAlarmImg = BImage.make((String)"module://alarm/com/tridium/alarm/icons/alarmOrange.png"); + sortAsc = BImage.make((BIcon)BIcon.std((String)"moveUp.png")); + sortDesc = BImage.make((BIcon)BIcon.std((String)"moveDown.png")); + arrow = BImage.make((String)"module://icons/x16/doubleArrowRight.png"); + linkImg = BImage.make((BIcon)BIcon.std((String)"link.png")); + blankImg = BImage.make((BIcon)BIcon.std((String)"blank.png")); + disablePngFixing = false; + try { + disablePngFixing = new Boolean(System.getProperty("hx.disablePngFixing", "false")); + } + catch (Exception exception) {} + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class SourceAlarm { + public BAlarmRecord alarm; + public int ackedCount; + public int unackedCount; + public int pendingCount; + + public Object get(String string) { + if (string.equals(BAlarmRecord.ackState.getName())) { + return "" + this.ackedCount + '/' + this.unackedCount + '/' + this.pendingCount; + } + return this.alarm.get(string); + } + + public void update(BAlarmRecord bAlarmRecord) { + if (this.alarm.getTimestamp().isBefore(bAlarmRecord.getTimestamp())) { + this.alarm = bAlarmRecord; + } + if (bAlarmRecord.isAcknowledged()) { + ++this.ackedCount; + } else if (bAlarmRecord.isAckPending()) { + ++this.pendingCount; + } else { + ++this.unackedCount; + } + } + + private final /* synthetic */ void this() { + this.alarm = new BAlarmRecord(); + this.ackedCount = 0; + this.unackedCount = 0; + this.pendingCount = 0; + } + + public SourceAlarm() { + this.this(); + this.alarm.setTimestamp(BAbsTime.NULL); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class AlarmCommand + extends Command { + public BImage getIcon(HxOp hxOp) { + return null; + } + + public AlarmCommand(BHxView bHxView) { + super(bHxView); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class Acknowledge + extends AlarmCommand { + public String getDisplayName(HxOp hxOp) { + return lexicon.getText("hx.acknowledge.label"); + } + + public BImage getIcon(HxOp hxOp) { + return BImage.make((BIcon)BIcon.make((String)lexicon.getText("hx.acknowledge.icon"))); + } + + public void handle(HxOp hxOp) throws Exception { + HtmlWriter htmlWriter; + if (hxOp.getPostBody() == null || hxOp.getFormValue("recurringAlarms") == null) { + htmlWriter = BHxAlarmConsole.this.getSelection(hxOp); + int n = 0; + while (n < ((String[])htmlWriter).length) { + BHxAlarmConsole.this.ackAlarmBySource(hxOp.getFormValue("_" + (String)htmlWriter[n]), null, hxOp); + ++n; + } + } else { + htmlWriter = BHxAlarmConsole.this.getSelection(hxOp); + int n = 0; + while (n < ((String[])htmlWriter).length) { + BHxAlarmConsole.this.ackAlarmByUuid((String)htmlWriter[n], null, hxOp); + ++n; + } + } + htmlWriter = hxOp.getHtmlWriter(); + htmlWriter.w((Object)("document.getElementById('" + hxOp.scope("tableRecords") + "').innerHTML='")); + htmlWriter.w((Object)("")); + if (hxOp.getFormValue("recurringAlarms") == null) { + BHxAlarmConsole.this.showAll(hxOp); + } else { + BHxAlarmConsole.this.showRecurringAlarms(hxOp.getFormValue("source"), hxOp); + } + htmlWriter.w((Object)"';"); + } + + public Acknowledge(BHxView bHxView) { + super(bHxView); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class ShowRecurring + extends AlarmCommand { + public String getDisplayName(HxOp hxOp) { + return lexicon.getText("hx.showRecurring.label"); + } + + public BImage getIcon(HxOp hxOp) { + return BImage.make((BIcon)BIcon.make((String)lexicon.getText("hx.showRecurring.icon"))); + } + + public void handle(HxOp hxOp) throws Exception { + if (BHxAlarmConsole.this.getSelection(hxOp).length == 0) { + return; + } + hxOp.getRequest().getSession().setAttribute(BHxAlarmConsole.this.sessionScope("recurring", hxOp), (Object)"true"); + hxOp.getRequest().getSession().setAttribute(BHxAlarmConsole.this.sessionScope("source", hxOp), (Object)hxOp.getFormValue("_" + BHxAlarmConsole.this.getSelection(hxOp)[0])); + HtmlWriter htmlWriter = hxOp.getHtmlWriter(); + htmlWriter.w((Object)("document.getElementById('" + hxOp.scope("tableTitle") + "').innerHTML='")); + BHxAlarmConsole.this.writeTableTitle(true, hxOp); + htmlWriter.w((Object)"';"); + htmlWriter.w((Object)("document.getElementById('" + hxOp.scope("tableRecords") + "').innerHTML='")); + htmlWriter.w((Object)("
")); + BHxAlarmConsole.this.showRecurringAlarms(hxOp.getFormValue("_" + BHxAlarmConsole.this.getSelection(hxOp)[0]), hxOp); + htmlWriter.w((Object)"';"); + htmlWriter.w((Object)("document.getElementById('" + hxOp.scope("commands") + "').innerHTML='")); + BHxAlarmConsole.this.writeCommands(BHxAlarmConsole.this.getCommands(true, hxOp), hxOp); + htmlWriter.w((Object)"';"); + } + + public ShowRecurring(BHxView bHxView) { + super(bHxView); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class ShowAll + extends AlarmCommand { + public String getDisplayName(HxOp hxOp) { + return lexicon.getText("hx.showAll.label"); + } + + public BImage getIcon(HxOp hxOp) { + return BImage.make((BIcon)BIcon.make((String)lexicon.getText("hx.showAll.icon"))); + } + + public void handle(HxOp hxOp) throws Exception { + hxOp.getRequest().getSession().setAttribute(BHxAlarmConsole.this.sessionScope("recurring", hxOp), null); + hxOp.getRequest().getSession().setAttribute(BHxAlarmConsole.this.sessionScope("source", hxOp), null); + HtmlWriter htmlWriter = hxOp.getHtmlWriter(); + htmlWriter.w((Object)("document.getElementById('" + hxOp.scope("tableTitle") + "').innerHTML='")); + BHxAlarmConsole.this.writeTableTitle(false, hxOp); + htmlWriter.w((Object)"';"); + htmlWriter.w((Object)("document.getElementById('" + hxOp.scope("tableRecords") + "').innerHTML='")); + htmlWriter.w((Object)("
")); + BHxAlarmConsole.this.showAll(hxOp); + htmlWriter.w((Object)"';"); + htmlWriter.w((Object)("document.getElementById('" + hxOp.scope("commands") + "').innerHTML='")); + BHxAlarmConsole.this.writeCommands(BHxAlarmConsole.this.getCommands(false, hxOp), hxOp); + htmlWriter.w((Object)"';"); + } + + public ShowAll(BHxView bHxView) { + super(bHxView); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class ShowDetails + extends AlarmCommand { + DetailsDialog dlg; + + public String getDisplayName(HxOp hxOp) { + return lexicon.getText("hx.showDetails.label"); + } + + public BImage getIcon(HxOp hxOp) { + return BImage.make((BIcon)BIcon.make((String)lexicon.getText("hx.showDetails.icon"))); + } + + public void handle(HxOp hxOp) throws Exception { + String[] stringArray = BHxAlarmConsole.this.getSelection(hxOp); + if (stringArray.length < 1) { + return; + } + if (!this.dlg.isSubmit(hxOp)) { + this.dlg.open(hxOp); + return; + } + } + + public ShowDetails(BHxView bHxView) { + super(bHxView); + this.dlg = new DetailsDialog(this); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class ForceClear + extends AlarmCommand { + public String getDisplayName(HxOp hxOp) { + return lexicon.getText("hx.forceClear.label"); + } + + public BImage getIcon(HxOp hxOp) { + return BImage.make((BIcon)BIcon.make((String)lexicon.getText("hx.forceClear.icon"))); + } + + public void handle(HxOp hxOp) throws Exception { + if (hxOp.getPermissionsForTarget().hasAdminInvoke() || hxOp.getPermissionsForTarget().hasAdminWrite()) { + HtmlWriter htmlWriter; + if (hxOp.getPostBody() == null || hxOp.getFormValue("recurringAlarms") == null) { + htmlWriter = BHxAlarmConsole.this.getSelection(hxOp); + int n = 0; + while (n < ((String[])htmlWriter).length) { + BHxAlarmConsole.this.forceClearBySource(hxOp.getFormValue("_" + (String)htmlWriter[n]), hxOp); + ++n; + } + } else { + htmlWriter = BHxAlarmConsole.this.getSelection(hxOp); + int n = 0; + while (n < ((String[])htmlWriter).length) { + BHxAlarmConsole.this.forceClearByUuid((String)htmlWriter[n], hxOp); + ++n; + } + } + htmlWriter = hxOp.getHtmlWriter(); + htmlWriter.w((Object)("document.getElementById('" + hxOp.scope("tableRecords") + "').innerHTML='")); + htmlWriter.w((Object)("
")); + if (hxOp.getFormValue("recurringAlarms") == null) { + BHxAlarmConsole.this.showAll(hxOp); + } else { + BHxAlarmConsole.this.showRecurringAlarms(hxOp.getFormValue("source"), hxOp); + } + htmlWriter.w((Object)"';"); + } + } + + public ForceClear(BHxView bHxView) { + super(bHxView); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class SortCommand + extends Command { + public String getDisplayName(HxOp hxOp) { + return "sortCommand"; + } + + public void handle(HxOp hxOp) throws Exception { + String string; + HtmlWriter htmlWriter = hxOp.getHtmlWriter(); + boolean bl = true; + Object object = hxOp.getRequest().getSession().getAttribute(BHxAlarmConsole.this.sessionScope("recurring", hxOp)); + Object object2 = hxOp.getRequest().getSession().getAttribute(BHxAlarmConsole.this.sessionScope("source", hxOp)); + if (object != null) { + bl = false; + } + if ((string = hxOp.getFormValue("recurringAlarms")) != null) { + bl = false; + } + if (bl) { + htmlWriter.w((Object)("document.getElementById('" + hxOp.scope("tableRecords") + "').innerHTML='")); + htmlWriter.w((Object)("
")); + BHxAlarmConsole.this.showAll(hxOp); + htmlWriter.w((Object)"';"); + htmlWriter.w((Object)("document.getElementById('" + hxOp.scope("commands") + "').innerHTML='")); + BHxAlarmConsole.this.writeCommands(BHxAlarmConsole.this.getCommands(false, hxOp), hxOp); + htmlWriter.w((Object)"';"); + } else { + htmlWriter.w((Object)("document.getElementById('" + hxOp.scope("tableRecords") + "').innerHTML='")); + htmlWriter.w((Object)("
")); + String string2 = ""; + string2 = object2 != null ? object2.toString() : hxOp.getFormValue("source"); + BHxAlarmConsole.this.showRecurringAlarms(string2, hxOp); + htmlWriter.w((Object)"';"); + htmlWriter.w((Object)("document.getElementById('" + hxOp.scope("commands") + "').innerHTML='")); + BHxAlarmConsole.this.writeCommands(BHxAlarmConsole.this.getCommands(true, hxOp), hxOp); + htmlWriter.w((Object)"';"); + } + } + + public SortCommand(BHxView bHxView) { + super(bHxView); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class AddNotes + extends AlarmCommand { + Dialog dlg; + + public String getDisplayName(HxOp hxOp) { + return lexicon.getText("hx.addNotes.label"); + } + + public BImage getIcon(HxOp hxOp) { + return BImage.make((BIcon)BIcon.make((String)lexicon.getText("hx.notes.icon"))); + } + + public void handle(HxOp hxOp) throws Exception { + int n; + if (!this.dlg.isSubmit(hxOp)) { + this.dlg.open(hxOp); + return; + } + String string = hxOp.getFormValue("notes"); + String[] stringArray = BHxAlarmConsole.this.getSelection(hxOp); + if (hxOp.getPostBody() == null || hxOp.getFormValue("recurringAlarms") == null) { + n = 0; + while (n < stringArray.length) { + String string2 = hxOp.getFormValue("_" + stringArray[n]); + BHxAlarmConsole.this.addAlarmNoteBySource(string2, string, hxOp); + ++n; + } + } else { + n = 0; + while (n < stringArray.length) { + BHxAlarmConsole.this.addAlarmNoteByUuid(stringArray[n], string, hxOp); + ++n; + } + } + HtmlWriter htmlWriter = hxOp.getHtmlWriter(); + htmlWriter.w((Object)("document.getElementById('" + hxOp.scope("tableRecords") + "').innerHTML='")); + htmlWriter.w((Object)("
")); + if (hxOp.getFormValue("recurringAlarms") == null) { + BHxAlarmConsole.this.showAll(hxOp); + } else { + BHxAlarmConsole.this.showRecurringAlarms(hxOp.getFormValue("source"), hxOp); + } + htmlWriter.w((Object)"';"); + } + + public AddNotes(BHxView bHxView) { + super(bHxView); + this.dlg = new AlarmNotesDialog(this); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class DetailsDialog + extends Dialog { + public Command[] getCommands() { + return new Command[]{new Dialog.Submit((Dialog)this)}; + } + + public void writeContent(HxOp hxOp) throws Exception { + HtmlWriter htmlWriter = hxOp.getHtmlWriter(); + String[] stringArray = BHxAlarmConsole.this.getSelection(hxOp); + String string = stringArray[0]; + String string2 = "alarm:|bql:SELECT * FROM openAlarms WHERE uuid='" + string + '\''; + BOrd bOrd = BOrd.make((String)string2); + BICollection bICollection = (BICollection)bOrd.resolve(hxOp.get()).get(); + Cursor cursor = bICollection.cursor(); + if (cursor.next()) { + BAlarmRecord bAlarmRecord = (BAlarmRecord)cursor.get(); + Property[] propertyArray = bAlarmRecord.loadSlots().getPropertiesArray(); + htmlWriter.w((Object)"
"); + String string3 = "hx-AlarmConsole-detailsRow window-bg control-border hx-PropertySheet-row"; + htmlWriter.w((Object)"
"); + int n = 0; + while (n < propertyArray.length) { + if (!Flags.isHidden((BComplex)bAlarmRecord, (Slot)propertyArray[n])) { + htmlWriter.w((Object)""); + htmlWriter.w((Object)(""); + if (propertyArray[n].equals((Object)BAlarmRecord.alarmData)) { + BFacets bFacets = bAlarmRecord.getAlarmData(); + Object[] objectArray = bFacets.list(); + SortUtil.sort((Object[])objectArray, (Object[])objectArray, (Comparator)new Comparator(){ + + public final int compare(Object object, Object object2) { + return ((String)object).compareToIgnoreCase((String)object2); + } + }); + htmlWriter.w((Object)(""); + } else if (propertyArray[n].getType().equals(BAbsTime.TYPE)) { + htmlWriter.w((Object)(""); + } else { + htmlWriter.w((Object)(""); + } + htmlWriter.w((Object)""); + } + ++n; + } + htmlWriter.w((Object)"
")); + BHxAlarmConsole.safe(htmlWriter, propertyArray[n].getDefaultDisplayName((Context)hxOp)); + htmlWriter.w((Object)"")); + htmlWriter.w((Object)""); + int n2 = 0; + while (n2 < objectArray.length) { + String string4; + if (((String)objectArray[n2]).equals("notes") || ((String)objectArray[n2]).equals("instructions")) { + string4 = SlotPath.unescape((String)bFacets.get((String)objectArray[n2]).toString((Context)hxOp)); + String[] stringArray2 = TextUtil.split((String)string4, (char)'\n'); + int n3 = 0; + while (n3 < stringArray2.length) { + stringArray2[n3] = XWriter.safeToString((String)stringArray2[n3], (boolean)true); + ++n3; + } + string4 = TextUtil.join((String[])stringArray2, (char)'\n'); + string4 = TextUtil.replace((String)string4, (String)"\n", (String)"
"); + htmlWriter.w((Object)""); + htmlWriter.w((Object)""); + htmlWriter.w((Object)""); + htmlWriter.w((Object)""); + } else if (propertyArray[n].getName().equals("alarmClass")) { + string4 = bAlarmRecord.get(propertyArray[n]).toString((Context)hxOp); + string4 = BHxAlarmConsole.this.getAlarmService().getAlarmClassDisplayName(BString.make((String)string4), (Context)hxOp).toString(); + htmlWriter.w((Object)(""); + } else { + htmlWriter.w((Object)""); + htmlWriter.w((Object)("")); + htmlWriter.w((Object)""); + htmlWriter.w((Object)""); + } + ++n2; + } + htmlWriter.w((Object)"
"); + BHxAlarmConsole.safe(htmlWriter, objectArray[n2]); + htmlWriter.w((Object)""); + htmlWriter.w((Object)string4); + htmlWriter.w((Object)"
")); + BHxAlarmConsole.safe(htmlWriter, string4); + htmlWriter.w((Object)"
" + (String)objectArray[n2] + ""); + BHxAlarmConsole.safe(htmlWriter, BFormat.format((String)SlotPath.unescape((String)bFacets.get((String)objectArray[n2]).toString((Context)hxOp)), (Object)((Object)bAlarmRecord))); + htmlWriter.w((Object)"
"); + htmlWriter.w((Object)"
")); + BHxAlarmConsole.safe(htmlWriter, SlotPath.unescape((String)bAlarmRecord.get(propertyArray[n]).toString((Context)BFacets.make((BFacets)hxOp.getFacets(), (BFacets)HX_TIMESTAMP_FACETS)))); + htmlWriter.w((Object)"")); + BHxAlarmConsole.safe(htmlWriter, SlotPath.unescape((String)bAlarmRecord.get(propertyArray[n]).toString((Context)hxOp))); + htmlWriter.w((Object)"
"); + htmlWriter.w((Object)""); + } + } + + public DetailsDialog(Command command) { + super("Alarm Details", command); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class AlarmNotesDialog + extends Dialog { + public Command[] getCommands() { + return new Command[]{new Dialog.Submit((Dialog)this), new Dialog.Cancel((Dialog)this)}; + } + + public void writeContent(HxOp hxOp) throws Exception { + String string = this.getAlarmNotes(hxOp); + HtmlWriter htmlWriter = hxOp.getHtmlWriter(); + htmlWriter.w((Object)"
"); + htmlWriter.w((Object)"
"); + htmlWriter.w((Object)"
"); + htmlWriter.w((Object)(""); + } + + private final String getAlarmNotes(HxOp hxOp) { + String[] stringArray = BHxAlarmConsole.this.getSelection(hxOp); + String string = ""; + if (hxOp.getPostBody() == null || hxOp.getFormValue("recurringAlarms") == null) { + int n = 0; + while (n < stringArray.length) { + String string2 = hxOp.getFormValue("_" + stringArray[n]); + string = string + this.getAlarmNotesBySource(hxOp, string2); + ++n; + } + } else { + int n = 0; + while (n < stringArray.length) { + string = string + this.getAlarmNotesByUUID(hxOp, stringArray[n]); + ++n; + } + } + return string; + } + + private final String getAlarmNotesBySource(HxOp hxOp, String string) { + Object object; + if (string == null) { + return ""; + } + BOrd bOrd = BOrd.make((String)("alarm:|bql:select * from openAlarms where source = OrdList '" + string + '\'')); + BICollection bICollection = (BICollection)bOrd.resolve(hxOp.get()).get(); + Cursor cursor = bICollection.cursor(); + Class clazz = class$javax$baja$alarm$BAlarmRecord; + if (clazz == null) { + clazz = class$javax$baja$alarm$BAlarmRecord = BHxAlarmConsole.class("[Ljavax.baja.alarm.BAlarmRecord;", false); + } + Array array = new Array(clazz); + while (cursor.next()) { + object = (BAlarmRecord)cursor.get(); + array.add((Object)object.newCopy()); + } + object = new StringBuffer(); + if (array.size() > 1) { + ((StringBuffer)object).append(lexicon.getText("hx.notes.multiple") + '\n'); + } + int n = 0; + while (n < array.size()) { + BAlarmRecord bAlarmRecord = (BAlarmRecord)((Object)array.get(n)); + BObject bObject = bAlarmRecord.getAlarmData().get("notes"); + if (bObject != null) { + ((StringBuffer)object).append(bObject.toString()); + } + ++n; + } + return ((StringBuffer)object).toString(); + } + + private final String getAlarmNotesByUUID(HxOp hxOp, String string) { + if (string == null) { + return ""; + } + StringBuffer stringBuffer = new StringBuffer(); + BOrd bOrd = BOrd.make((String)("alarm:|bql:select * from openAlarms where uuid = Uuid '" + string + '\'')); + BICollection bICollection = (BICollection)bOrd.resolve(hxOp.get()).get(); + Cursor cursor = bICollection.cursor(); + Class clazz = class$javax$baja$alarm$BAlarmRecord; + if (clazz == null) { + clazz = class$javax$baja$alarm$BAlarmRecord = BHxAlarmConsole.class("[Ljavax.baja.alarm.BAlarmRecord;", false); + } + Array array = new Array(clazz); + while (cursor.next()) { + BAlarmRecord bAlarmRecord = (BAlarmRecord)cursor.get(); + array.add((Object)bAlarmRecord.newCopy()); + } + if (array.size() > 1) { + stringBuffer.append(lexicon.getText("hx.notes.multiple") + '\n'); + } + int n = 0; + while (n < array.size()) { + BAlarmRecord bAlarmRecord = (BAlarmRecord)((Object)array.get(n)); + BObject bObject = bAlarmRecord.getAlarmData().get("notes"); + if (bObject != null) { + stringBuffer.append(bObject.toString()); + } + ++n; + } + return stringBuffer.toString(); + } + + public AlarmNotesDialog(Command command) { + super("Alarm Notes", command); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class LoadThread + extends Thread { + public HxOp op; + + public void run() { + try { + HtmlWriter htmlWriter = this.op.getHtmlWriter(); + htmlWriter.w((Object)("document.getElementById('" + this.op.scope("tableRecords") + "').innerHTML='")); + htmlWriter.w((Object)("")); + BHxAlarmConsole.this.showAll(this.op); + htmlWriter.w((Object)"\";"); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + public LoadThread(HxOp hxOp) { + this.op = hxOp; + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/model/BAlarmConsoleModel.java b/modules/cfr_output/com/tridium/alarm/model/BAlarmConsoleModel.java new file mode 100644 index 0000000..63ab2f7 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/model/BAlarmConsoleModel.java @@ -0,0 +1,419 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.collection.BICollection + * javax.baja.data.BIDataValue + * javax.baja.log.Log + * javax.baja.naming.BOrd + * javax.baja.naming.BOrdList + * javax.baja.naming.SlotPath + * javax.baja.nre.util.Array + * javax.baja.security.BIProtected + * javax.baja.security.BPermissions + * javax.baja.security.PermissionException + * javax.baja.sys.Action + * javax.baja.sys.BAbsTime + * javax.baja.sys.BComplex + * javax.baja.sys.BComponent + * javax.baja.sys.BFacets + * javax.baja.sys.BRelTime + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.BasicContext + * javax.baja.sys.Clock + * javax.baja.sys.Clock$Ticket + * javax.baja.sys.Context + * javax.baja.sys.Cursor + * javax.baja.sys.Property + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.user.BUser + * javax.baja.util.BUuid + */ +package com.tridium.alarm.model; + +import com.tridium.alarm.BConsoleRecipient; +import com.tridium.alarm.model.BAlarmConsoleRow; +import javax.baja.alarm.BAckState; +import javax.baja.alarm.BAlarmClass; +import javax.baja.alarm.BAlarmDatabase; +import javax.baja.alarm.BAlarmRecipient; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.alarm.BAlarmService; +import javax.baja.alarm.BSourceState; +import javax.baja.collection.BICollection; +import javax.baja.data.BIDataValue; +import javax.baja.log.Log; +import javax.baja.naming.BOrd; +import javax.baja.naming.BOrdList; +import javax.baja.naming.SlotPath; +import javax.baja.nre.util.Array; +import javax.baja.security.BIProtected; +import javax.baja.security.BPermissions; +import javax.baja.security.PermissionException; +import javax.baja.sys.Action; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BRelTime; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.BasicContext; +import javax.baja.sys.Clock; +import javax.baja.sys.Context; +import javax.baja.sys.Cursor; +import javax.baja.sys.Property; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.user.BUser; +import javax.baja.util.BUuid; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public final class BAlarmConsoleModel +extends BComponent { + public static final Action routeAlarm = BAlarmConsoleModel.newAction((int)260, (BValue)new BAlarmRecord(), null); + public static final Action ackAlarms = BAlarmConsoleModel.newAction((int)260, (BValue)new BComponent(), null); + public static final Action forceClear = BAlarmConsoleModel.newAction((int)260, (BValue)new BComponent(), null); + public static final Action refresh = BAlarmConsoleModel.newAction((int)260, null); + public static final Action addNotes = BAlarmConsoleModel.newAction((int)260, (BValue)new BComponent(), null); + public static final Action expire = BAlarmConsoleModel.newAction((int)260, null); + public static final Type TYPE; + private static final BRelTime expiryTime; + private static final Log log; + private volatile Context routeAlarmCx; + private final Object alarmMon; + private volatile boolean started; + private volatile Clock.Ticket expireTicket; + static /* synthetic */ Class class$com$tridium$alarm$model$BAlarmConsoleModel; + static /* synthetic */ Class class$com$tridium$alarm$model$BAlarmConsoleRow; + static /* synthetic */ Class class$javax$baja$alarm$BAlarmRecord; + + public final void routeAlarm(BAlarmRecord bAlarmRecord) { + this.invoke(routeAlarm, (BValue)bAlarmRecord, null); + } + + public final void ackAlarms(BComponent bComponent) { + this.invoke(ackAlarms, (BValue)bComponent, null); + } + + public final void forceClear(BComponent bComponent) { + this.invoke(forceClear, (BValue)bComponent, null); + } + + public final void refresh() { + this.invoke(refresh, null, null); + } + + public final void addNotes(BComponent bComponent) { + this.invoke(addNotes, (BValue)bComponent, null); + } + + public final void expire() { + this.invoke(expire, null, null); + } + + public final Type getType() { + return TYPE; + } + + public final void started() { + this.linkTo(this.getConsole(), (Slot)BAlarmRecipient.routeAlarm, (Slot)routeAlarm); + this.expireTicket = Clock.schedule((BComponent)this, (BRelTime)expiryTime, (Action)expire, null); + } + + public final void stopped() throws Exception { + this.expireTicket.cancel(); + } + + public final void subscribed() { + this.expireTicket.cancel(); + } + + public final void unsubscribed() { + if (this.isRunning()) { + this.expireTicket = Clock.schedule((BComponent)this, (BRelTime)expiryTime, (Action)expire, null); + } + } + + public final boolean isParentLegal(BComponent bComponent) { + return bComponent instanceof BConsoleRecipient; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Unable to fully structure code + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public final void doRefresh(Context var1_1) { + if (this.routeAlarmCx == null) { + this.routeAlarmCx = new BasicContext(var1_1.getUser(), var1_1.getLanguage()); + } + this.started = true; + var2_2 = this.alarmMon; + synchronized (var2_2) { + if (BAlarmConsoleModel.log.isTraceOn()) { + BAlarmConsoleModel.log.trace("Refreshing alarm console"); + } + if ((v0 = BAlarmConsoleModel.class$com$tridium$alarm$model$BAlarmConsoleRow) == null) { + v0 = BAlarmConsoleModel.class$com$tridium$alarm$model$BAlarmConsoleRow = BAlarmConsoleModel.class("[Lcom.tridium.alarm.model.BAlarmConsoleRow;", false); + } + var4_3 = (BAlarmConsoleRow[])this.getChildren(v0); + var5_4 = 0; + while (true) { + block8: { + if (var5_4 < var4_3.length) break block8; + var5_5 = this.getConsole().getOpenAlarms(var1_1); + if (true) ** GOTO lbl27 + } + this.remove((BComplex)var4_3[var5_4]); + ++var5_4; + } + do { + if ((var6_6 = (BAlarmRecord)var5_5.get()).getSourceState() == BSourceState.normal && (var6_6.isAcknowledged() || !var6_6.getAckRequired())) continue; + this.doRouteAlarm(var6_6, var1_1); +lbl27: + // 3 sources + + } while (var5_5.next()); + return; + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public final void doRouteAlarm(BAlarmRecord bAlarmRecord, Context context) { + if (!this.started) { + return; + } + if (!this.getConsole().accept(bAlarmRecord)) { + return; + } + BAlarmService bAlarmService = (BAlarmService)Sys.getService((Type)BAlarmService.TYPE); + if (!this.hasPermissions(bAlarmService, bAlarmRecord, BPermissions.operatorRead, this.routeAlarmCx)) { + return; + } + Object object = this.alarmMon; + synchronized (object) { + block11: { + BAlarmConsoleRow bAlarmConsoleRow; + String string; + block10: { + string = SlotPath.escape((String)bAlarmRecord.getSource().toString()); + bAlarmConsoleRow = (BAlarmConsoleRow)this.get(string); + if (bAlarmConsoleRow == null) { + bAlarmConsoleRow = new BAlarmConsoleRow(this.routeAlarmCx); + } + bAlarmConsoleRow.update(bAlarmRecord); + if (!bAlarmConsoleRow.isEmpty()) break block10; + if (bAlarmConsoleRow.getParent() != null) { + this.remove((BComplex)bAlarmConsoleRow); + } + break block11; + } + int n = 258; + if (!this.hasPermissions(bAlarmService, bAlarmRecord, BPermissions.operatorWrite, this.routeAlarmCx)) { + n |= 1; + } + if (bAlarmConsoleRow.getParent() == null) { + this.add(string, (BValue)bAlarmConsoleRow, n); + } + } + return; + } + } + + private final BAlarmRecord[] getAlarmRecords(BAlarmService bAlarmService, BComponent bComponent) throws Exception { + BComponent bComponent2 = (BComponent)bComponent.get("alarmSources"); + Class clazz = class$javax$baja$alarm$BAlarmRecord; + if (clazz == null) { + clazz = class$javax$baja$alarm$BAlarmRecord = BAlarmConsoleModel.class("[Ljavax.baja.alarm.BAlarmRecord;", false); + } + Array array = new Array(clazz); + if (bComponent2 != null) { + Property[] propertyArray = bComponent2.getDynamicPropertiesArray(); + int n = 0; + while (n < propertyArray.length) { + BValue bValue = bComponent2.get(propertyArray[n]); + if (bValue instanceof BOrdList) { + BOrdList bOrdList = (BOrdList)bValue; + BOrd bOrd = BOrd.make((String)("alarm:|bql:select * from openAlarms where source = OrdList '" + SlotPath.escape((String)bOrdList.encodeToString()) + '\'')); + BICollection bICollection = (BICollection)bOrd.get(); + Cursor cursor = bICollection.cursor(); + while (cursor.next()) { + array.add((Object)cursor.get().asValue().newCopy(true)); + } + } + ++n; + } + } else { + BComponent bComponent3 = (BComponent)bComponent.get("alarms"); + Property[] propertyArray = bComponent3.getDynamicPropertiesArray(); + int n = 0; + while (n < propertyArray.length) { + BAlarmRecord bAlarmRecord = bAlarmService.getAlarmDb().getRecord((BUuid)bComponent3.get(propertyArray[n])); + if (bAlarmRecord != null) { + array.add((Object)bAlarmRecord.newCopy(true)); + } + ++n; + } + } + return (BAlarmRecord[])array.trim(); + } + + public final void doAckAlarms(BComponent bComponent, Context context) throws Exception { + if (log.isTraceOn()) { + log.trace("Acknowledging alarms"); + } + BAlarmService bAlarmService = (BAlarmService)Sys.getService((Type)BAlarmService.TYPE); + BAlarmDatabase bAlarmDatabase = bAlarmService.getAlarmDb(); + BAlarmRecord[] bAlarmRecordArray = this.getAlarmRecords(bAlarmService, bComponent); + int n = 0; + while (n < bAlarmRecordArray.length) { + if (this.hasPermissions(bAlarmService, bAlarmRecordArray[n], BPermissions.operatorWrite, context)) { + boolean bl = false; + if (bAlarmRecordArray[n].getAckState() != BAckState.ackPending) { + bl = true; + } + boolean bl2 = bl; + bAlarmRecordArray[n].setUser(context.getUser().getUsername()); + bAlarmRecordArray[n].setAckTime(BAbsTime.now()); + bAlarmRecordArray[n].setAckState(BAckState.ackPending); + if (bl2) { + bAlarmDatabase.update(bAlarmRecordArray[n]); + } + bAlarmService.ackAlarm(bAlarmRecordArray[n]); + } + ++n; + } + } + + public final void doAddNotes(BComponent bComponent, Context context) throws Exception { + if (log.isTraceOn()) { + log.trace("Add Notes to alarms"); + } + BAlarmService bAlarmService = (BAlarmService)Sys.getService((Type)BAlarmService.TYPE); + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("##"); + stringBuffer.append(BAbsTime.now().toString()); + stringBuffer.append(" - "); + stringBuffer.append(context.getUser().getName()); + stringBuffer.append(" ##\n"); + stringBuffer.append(((BString)bComponent.get("notes")).toString()); + BAlarmRecord[] bAlarmRecordArray = this.getAlarmRecords(bAlarmService, bComponent); + int n = 0; + while (n < bAlarmRecordArray.length) { + if (this.hasPermissions(bAlarmService, bAlarmRecordArray[n], BPermissions.operatorWrite, context)) { + String string = bAlarmRecordArray[n].getAlarmData().gets("notes", ""); + bAlarmRecordArray[n].setAlarmData(BFacets.make((BFacets)bAlarmRecordArray[n].getAlarmData(), (String)"notes", (BIDataValue)BString.make((String)(stringBuffer + string)))); + bAlarmRecordArray[n].setLastUpdate(BAbsTime.now()); + bAlarmService.routeAlarm(bAlarmRecordArray[n]); + bAlarmService.doRouteToSource(bAlarmRecordArray[n]); + } + ++n; + } + } + + public final void doExpire(Context context) { + if (log.isTraceOn()) { + log.trace("Expiring Alarm Console Model: " + this.toPathString()); + } + this.getConsole().remove((BComplex)this); + } + + public final void doForceClear(BComponent bComponent, Context context) throws Exception { + if (log.isTraceOn()) { + log.trace("Alarm force clear"); + } + BAlarmService bAlarmService = (BAlarmService)Sys.getService((Type)BAlarmService.TYPE); + BAlarmDatabase bAlarmDatabase = bAlarmService.getAlarmDb(); + BUser bUser = context.getUser(); + BPermissions bPermissions = bUser.getPermissionsFor((BIProtected)this.getConsole()); + if (!bPermissions.has(BPermissions.adminWrite) && !bPermissions.has(BPermissions.adminInvoke)) { + throw new PermissionException(bPermissions + " < " + BPermissions.adminWrite); + } + BAlarmRecord[] bAlarmRecordArray = this.getAlarmRecords(bAlarmService, bComponent); + int n = 0; + while (n < bAlarmRecordArray.length) { + BAlarmRecord bAlarmRecord = bAlarmRecordArray[n]; + BAlarmClass bAlarmClass = bAlarmService.lookupAlarmClass(bAlarmRecord.getAlarmClass()); + if (bAlarmClass == null) { + bAlarmClass = bAlarmService.getDefaultAlarmClass(); + } + if (bUser.getPermissionsFor((BIProtected)bAlarmClass).has(BPermissions.adminWrite)) { + bAlarmRecord.addAlarmFacet("forceCleared", (BIDataValue)BString.make((String)bUser.getUsername())); + if (bAlarmRecord.getAckTime().equals((Object)BAbsTime.NULL)) { + bAlarmRecord.setAckTime(BAbsTime.now()); + } + if (bAlarmRecord.getNormalTime().equals((Object)BAbsTime.NULL)) { + bAlarmRecord.setNormalTime(BAbsTime.now()); + } + if (!bAlarmRecord.getAckState().equals((Object)BAckState.acked)) { + bAlarmRecord.setUser(bUser.getUsername()); + } + bAlarmRecord.setSourceState(BSourceState.normal); + bAlarmRecord.setAckState(BAckState.acked); + bAlarmDatabase.update(bAlarmRecord); + bAlarmService.invoke(BAlarmService.auditForceClear, (BValue)bAlarmRecord, context); + } + ++n; + } + } + + private final boolean hasPermissions(BAlarmService bAlarmService, BAlarmRecord bAlarmRecord, BPermissions bPermissions, Context context) { + BAlarmClass bAlarmClass = bAlarmService.lookupAlarmClass(bAlarmRecord.getAlarmClass()); + if (bAlarmClass == null) { + bAlarmClass = bAlarmService.getDefaultAlarmClass(); + } + return context.getUser().getPermissionsFor((BIProtected)bAlarmClass).has(bPermissions); + } + + private final BConsoleRecipient getConsole() { + return (BConsoleRecipient)this.getParent(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.alarmMon = new Object(); + this.started = false; + this.expireTicket = Clock.expiredTicket; + } + + public BAlarmConsoleModel() { + this.this(); + } + + static { + Class clazz = class$com$tridium$alarm$model$BAlarmConsoleModel; + if (clazz == null) { + clazz = class$com$tridium$alarm$model$BAlarmConsoleModel = BAlarmConsoleModel.class("[Lcom.tridium.alarm.model.BAlarmConsoleModel;", false); + } + TYPE = Sys.loadType((Class)clazz); + expiryTime = BRelTime.makeSeconds((int)60); + log = Log.getLog((String)"alarm.alarmConsoleModel"); + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/model/BAlarmConsoleRow.java b/modules/cfr_output/com/tridium/alarm/model/BAlarmConsoleRow.java new file mode 100644 index 0000000..a0671eb --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/model/BAlarmConsoleRow.java @@ -0,0 +1,191 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BStruct + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.alarm.model; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import javax.baja.alarm.BAckState; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.alarm.BSourceState; +import javax.baja.sys.BStruct; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public final class BAlarmConsoleRow +extends BStruct { + public static final Property alarm = BAlarmConsoleRow.newProperty((int)257, (BValue)new BAlarmRecord(), null); + public static final Property ackState = BAlarmConsoleRow.newProperty((int)257, (String)"", null); + public static final Type TYPE; + private Map openAlarms; + private Context cx; + private int ackedCount; + private int ackPendingCount; + private int unackedCount; + static /* synthetic */ Class class$com$tridium$alarm$model$BAlarmConsoleRow; + + public final BAlarmRecord getAlarm() { + return (BAlarmRecord)this.get(alarm); + } + + public final void setAlarm(BAlarmRecord bAlarmRecord) { + this.set(alarm, (BValue)bAlarmRecord, null); + } + + public final String getAckState() { + return this.getString(ackState); + } + + public final void setAckState(String string) { + this.setString(ackState, string, null); + } + + public final Type getType() { + return TYPE; + } + + public final String toString(Context context) { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(this.getAlarm().getTimestamp().toString()); + stringBuffer.append(" "); + stringBuffer.append(this.getAckStateStr()); + return stringBuffer.toString(); + } + + final void update(BAlarmRecord bAlarmRecord) { + BAlarmRecord bAlarmRecord2 = (BAlarmRecord)((Object)this.openAlarms.get(bAlarmRecord.getUuid())); + bAlarmRecord = (BAlarmRecord)bAlarmRecord.newCopy(true); + this.openAlarms.put(bAlarmRecord.getUuid(), bAlarmRecord); + if (bAlarmRecord2 != null) { + if (!bAlarmRecord2.isAcknowledged() && !bAlarmRecord2.isAckPending() && bAlarmRecord.isAckPending()) { + ++this.ackPendingCount; + --this.unackedCount; + } else if (bAlarmRecord2.isAckPending() && bAlarmRecord.isAcknowledged()) { + --this.ackPendingCount; + ++this.ackedCount; + } else if (bAlarmRecord2.isAckPending() && !bAlarmRecord.isAcknowledged() && !bAlarmRecord.isAckPending()) { + --this.ackPendingCount; + ++this.unackedCount; + } else if (bAlarmRecord2.isAcknowledged() && !bAlarmRecord.isAcknowledged() && !bAlarmRecord.isAckPending()) { + --this.ackedCount; + ++this.unackedCount; + } else if (bAlarmRecord2.isAcknowledged() && bAlarmRecord.isAckPending()) { + --this.ackedCount; + ++this.ackPendingCount; + } else if (bAlarmRecord.isAcknowledged() && !bAlarmRecord2.isAcknowledged() && !bAlarmRecord2.isAckPending()) { + ++this.ackedCount; + --this.unackedCount; + } + } else if (bAlarmRecord.isAcknowledged()) { + ++this.ackedCount; + } else if (bAlarmRecord.isAckPending()) { + ++this.ackPendingCount; + } else { + ++this.unackedCount; + } + if (!(bAlarmRecord.getSourceState() != BSourceState.normal && bAlarmRecord.getSourceState() != BSourceState.alert || !bAlarmRecord.isAcknowledged() && bAlarmRecord.getAckRequired())) { + if (this.openAlarms.get(bAlarmRecord.getUuid()) == null) { + return; + } + this.openAlarms.remove(bAlarmRecord.getUuid()); + if (bAlarmRecord.isAcknowledged()) { + --this.ackedCount; + } else if (bAlarmRecord.getAckState() == BAckState.ackPending) { + --this.ackPendingCount; + } else { + --this.unackedCount; + } + } + this.updateAlarmInfo(); + } + + final boolean isEmpty() { + boolean bl = false; + if (this.openAlarms.size() == 0) { + bl = true; + } + return bl; + } + + private final void updateAlarmInfo() { + BAlarmRecord bAlarmRecord = null; + BAlarmRecord bAlarmRecord2 = null; + Iterator iterator = this.openAlarms.keySet().iterator(); + while (iterator.hasNext()) { + bAlarmRecord2 = (BAlarmRecord)((Object)this.openAlarms.get(iterator.next())); + if (bAlarmRecord == null) { + bAlarmRecord = bAlarmRecord2; + continue; + } + if (!bAlarmRecord2.getTimestamp().isAfter(bAlarmRecord.getTimestamp())) continue; + bAlarmRecord = bAlarmRecord2; + } + if (bAlarmRecord != null) { + this.setAlarm(bAlarmRecord); + } + this.setAckState(this.getAckStateStr()); + } + + private final String getAckStateStr() { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(this.ackedCount).append(" ").append(BAckState.acked.getDisplayTag(this.cx)).append(" / "); + stringBuffer.append(this.unackedCount).append(" ").append(BAckState.unacked.getDisplayTag(this.cx)); + if (this.ackPendingCount > 0) { + stringBuffer.append(" / ").append(this.ackPendingCount).append(" ").append(BAckState.ackPending.getDisplayTag(this.cx)); + } + return stringBuffer.toString(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.openAlarms = new HashMap(); + this.ackedCount = 0; + this.ackPendingCount = 0; + this.unackedCount = 0; + } + + public BAlarmConsoleRow() { + this.this(); + } + + public BAlarmConsoleRow(Context context) { + this.this(); + this.cx = context; + } + + static { + Class clazz = class$com$tridium$alarm$model$BAlarmConsoleRow; + if (clazz == null) { + clazz = class$com$tridium$alarm$model$BAlarmConsoleRow = BAlarmConsoleRow.class("[Lcom.tridium.alarm.model.BAlarmConsoleRow;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/print/BLinePrinterRecipient.java b/modules/cfr_output/com/tridium/alarm/print/BLinePrinterRecipient.java new file mode 100644 index 0000000..60faadd --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/print/BLinePrinterRecipient.java @@ -0,0 +1,293 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.data.BIDataValue + * javax.baja.log.Log + * javax.baja.naming.BOrd + * javax.baja.naming.BOrdList + * javax.baja.naming.SlotPath + * javax.baja.nre.util.TextUtil + * javax.baja.sys.Action + * javax.baja.sys.BBoolean + * javax.baja.sys.BDynamicEnum + * javax.baja.sys.BEnum + * javax.baja.sys.BEnumRange + * javax.baja.sys.BFacets + * javax.baja.sys.BIcon + * javax.baja.sys.BInteger + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.InvalidEnumException + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Topic + * javax.baja.sys.Type + * javax.baja.util.BFormat + * javax.baja.util.Queue + * javax.baja.util.Worker + * javax.baja.util.Worker$ITodo + */ +package com.tridium.alarm.print; + +import java.io.ByteArrayInputStream; +import javax.baja.alarm.AlarmSupport; +import javax.baja.alarm.BAlarmRecipient; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.alarm.BAlarmSourceInfo; +import javax.baja.alarm.BIAlarmSource; +import javax.baja.alarm.BSourceState; +import javax.baja.data.BIDataValue; +import javax.baja.log.Log; +import javax.baja.naming.BOrd; +import javax.baja.naming.BOrdList; +import javax.baja.naming.SlotPath; +import javax.baja.nre.util.TextUtil; +import javax.baja.sys.Action; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BDynamicEnum; +import javax.baja.sys.BEnum; +import javax.baja.sys.BEnumRange; +import javax.baja.sys.BFacets; +import javax.baja.sys.BIcon; +import javax.baja.sys.BInteger; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.InvalidEnumException; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Topic; +import javax.baja.sys.Type; +import javax.baja.util.BFormat; +import javax.baja.util.Queue; +import javax.baja.util.Worker; +import javax.print.DocFlavor; +import javax.print.DocPrintJob; +import javax.print.PrintService; +import javax.print.PrintServiceLookup; +import javax.print.SimpleDoc; +import javax.print.attribute.HashAttributeSet; +import javax.print.attribute.standard.PrinterName; + +public class BLinePrinterRecipient +extends BAlarmRecipient +implements BIAlarmSource { + public static final Property printer = BLinePrinterRecipient.newProperty((int)0, (BValue)BDynamicEnum.DEFAULT, (BFacets)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"alarm:LinePrinterFE"))); + public static final Property language = BLinePrinterRecipient.newProperty((int)0, (String)"", (BFacets)BFacets.make((String)"fieldWidth", (BIDataValue)BInteger.make((int)6))); + public static final Property printFormat = BLinePrinterRecipient.newProperty((int)0, (BValue)BLinePrinterRecipient.makeDefaultPrintFormat(), (BFacets)BFacets.make((String)"multiLine", (BIDataValue)BBoolean.make((boolean)true))); + public static final Property alertOnFailure = BLinePrinterRecipient.newProperty((int)0, (boolean)false, null); + public static final Property alarmSourceInfo = BLinePrinterRecipient.newProperty((int)0, (BValue)new BAlarmSourceInfo(), null); + public static final Action ackAlarm = BLinePrinterRecipient.newAction((int)4, (BValue)new BAlarmRecord(), null); + public static final Action loadPrinters = BLinePrinterRecipient.newAction((int)0, null); + public static final Topic printersLoaded = BLinePrinterRecipient.newTopic((int)0, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$print$BLinePrinterRecipient == null ? (class$com$tridium$alarm$print$BLinePrinterRecipient = BLinePrinterRecipient.class$("com.tridium.alarm.print.BLinePrinterRecipient")) : class$com$tridium$alarm$print$BLinePrinterRecipient)); + private AlarmSupport support; + private Queue printQueue = new Queue(); + private Worker printThread = new Worker((Worker.ITodo)this.printQueue); + private static final BIcon icon = BIcon.make((BIcon)BIcon.std((String)"print.png"), (BIcon)BIcon.std((String)"badges/alarm.png")); + private static final Log log = Log.getLog((String)"alarm.printer"); + static /* synthetic */ Class class$com$tridium$alarm$print$BLinePrinterRecipient; + + public BDynamicEnum getPrinter() { + return (BDynamicEnum)this.get(printer); + } + + public void setPrinter(BDynamicEnum bDynamicEnum) { + this.set(printer, (BValue)bDynamicEnum, null); + } + + public String getLanguage() { + return this.getString(language); + } + + public void setLanguage(String string) { + this.setString(language, string, null); + } + + public BFormat getPrintFormat() { + return (BFormat)this.get(printFormat); + } + + public void setPrintFormat(BFormat bFormat) { + this.set(printFormat, (BValue)bFormat, null); + } + + public boolean getAlertOnFailure() { + return this.getBoolean(alertOnFailure); + } + + public void setAlertOnFailure(boolean bl) { + this.setBoolean(alertOnFailure, bl, null); + } + + public BAlarmSourceInfo getAlarmSourceInfo() { + return (BAlarmSourceInfo)this.get(alarmSourceInfo); + } + + public void setAlarmSourceInfo(BAlarmSourceInfo bAlarmSourceInfo) { + this.set(alarmSourceInfo, (BValue)bAlarmSourceInfo, null); + } + + public BBoolean ackAlarm(BAlarmRecord bAlarmRecord) { + return (BBoolean)this.invoke(ackAlarm, (BValue)bAlarmRecord, null); + } + + public void loadPrinters() { + this.invoke(loadPrinters, null, null); + } + + public void firePrintersLoaded(BValue bValue) { + this.fire(printersLoaded, bValue, null); + } + + public Type getType() { + return TYPE; + } + + public void started() throws Exception { + this.support = new AlarmSupport((BIAlarmSource)this, this.getAlarmSourceInfo()); + this.printThread.start("alarm:printing"); + } + + public void stopped() throws Exception { + this.printThread.stop(); + } + + public static BFormat makeDefaultPrintFormat() { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("Source: %alarmData.sourceName%\n"); + stringBuffer.append("Timestamp: %timestamp%\n"); + stringBuffer.append("State: %sourceState% / %ackState%\n"); + stringBuffer.append("Priority: %priority%\n"); + stringBuffer.append("Alarm Class: %alarmClass%\n"); + stringBuffer.append("Text: %alarmData.msgText%\n"); + stringBuffer.append("\n"); + return BFormat.make((String)stringBuffer.toString()); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void doLoadPrinters() { + PrintService[] printServiceArray = PrintServiceLookup.lookupPrintServices(DocFlavor.INPUT_STREAM.AUTOSENSE, null); + String[] stringArray = new String[printServiceArray.length]; + for (int i = 0; i < printServiceArray.length; ++i) { + stringArray[i] = SlotPath.escape((String)printServiceArray[i].getName()); + } + BEnumRange bEnumRange = BEnumRange.make((String[])stringArray); + try { + BDynamicEnum bDynamicEnum; + BDynamicEnum bDynamicEnum2 = this.getPrinter(); + if (bDynamicEnum2.equals((Object)BDynamicEnum.DEFAULT)) { + bDynamicEnum = BDynamicEnum.make((int)0, (BEnumRange)bEnumRange); + } else { + BEnum bEnum = bEnumRange.get(bDynamicEnum2.getTag()); + bDynamicEnum = BDynamicEnum.make((int)bEnum.getOrdinal(), (BEnumRange)bEnumRange); + } + this.setPrinter(bDynamicEnum); + } + catch (InvalidEnumException invalidEnumException) { + } + finally { + this.firePrintersLoaded(null); + } + } + + public void handleAlarm(BAlarmRecord bAlarmRecord) { + if (bAlarmRecord.getSource().equals((Object)BOrdList.make((BOrd)this.getNavOrd()))) { + return; + } + if (log.isTraceOn()) { + log.trace("Enqueue"); + } + String string = BFormat.make((String)this.getPrintFormat().format((Object)bAlarmRecord)).format((Object)bAlarmRecord); + this.printQueue.enqueue((Object)new PrintJob(string)); + } + + public BBoolean doAckAlarm(BAlarmRecord bAlarmRecord) { + try { + return BBoolean.make((boolean)this.support.ackAlarm(bAlarmRecord)); + } + catch (Exception exception) { + return BBoolean.FALSE; + } + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private class PrintJob + implements Runnable { + String text; + + public PrintJob(String string) { + this.text = string; + } + + public void run() { + if (log.isTraceOn()) { + log.trace("Dequeueing print job for " + SlotPath.unescape((String)BLinePrinterRecipient.this.getPrinter().getTag())); + } + try { + HashAttributeSet hashAttributeSet = new HashAttributeSet(); + hashAttributeSet.add(new PrinterName(SlotPath.unescape((String)BLinePrinterRecipient.this.getPrinter().getTag()), null)); + PrintService[] printServiceArray = PrintServiceLookup.lookupPrintServices(null, hashAttributeSet); + if (printServiceArray.length < 1) { + throw new BajaRuntimeException("Printer '" + SlotPath.unescape((String)BLinePrinterRecipient.this.getPrinter().getTag()) + "' not found."); + } + DocPrintJob docPrintJob = printServiceArray[0].createPrintJob(); + String[] stringArray = TextUtil.replace((String)this.text, (String)"\n", (String)"\n\r").split("\n\r"); + StringBuffer stringBuffer = new StringBuffer(); + for (int i = 0; i < stringArray.length; ++i) { + int n; + if (stringArray[i].length() < 80) { + stringBuffer.append(stringArray[i]); + stringBuffer.append("\n\r"); + continue; + } + for (int j = 0; j < stringArray[i].length(); j += n) { + n = Math.min(80, stringArray[i].length() - j); + int n2 = n; + if (j + n2 < stringArray[i].length()) { + while (stringArray[i].charAt(j + n2 - 1) != ' ' && n2 > 1) { + --n2; + } + if (n2 > 1) { + n = n2; + } + } + stringBuffer.append(stringArray[i].substring(j, j + n)); + stringBuffer.append("\n\r"); + } + } + docPrintJob.print(new SimpleDoc(new ByteArrayInputStream(stringBuffer.toString().getBytes()), DocFlavor.INPUT_STREAM.AUTOSENSE, null), null); + } + catch (Exception exception) { + BFacets bFacets = BLinePrinterRecipient.this.getAlarmSourceInfo().makeAlarmData(BSourceState.offnormal); + bFacets = BFacets.make((BFacets)bFacets, (String)"msgText", (BIDataValue)BString.make((String)(SlotPath.unescape((String)BLinePrinterRecipient.this.getPrinter().getTag()) + " print error."))); + try { + if (BLinePrinterRecipient.this.getAlertOnFailure()) { + BLinePrinterRecipient.this.support.newAlert(bFacets); + } + } + catch (Exception exception2) { + // empty catch block + } + log.error("Print error", (Throwable)exception); + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/print/BPrinterRecipient.java b/modules/cfr_output/com/tridium/alarm/print/BPrinterRecipient.java new file mode 100644 index 0000000..81bc2b9 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/print/BPrinterRecipient.java @@ -0,0 +1,338 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.data.BIDataValue + * javax.baja.gx.BFont + * javax.baja.log.Log + * javax.baja.naming.BOrd + * javax.baja.naming.BOrdList + * javax.baja.sys.Action + * javax.baja.sys.BBoolean + * javax.baja.sys.BFacets + * javax.baja.sys.BIcon + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.BFormat + * javax.baja.util.Queue + * javax.baja.util.Worker + * javax.baja.util.Worker$ITodo + */ +package com.tridium.alarm.print; + +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.font.TextAttribute; +import java.awt.print.PageFormat; +import java.awt.print.Printable; +import java.awt.print.PrinterException; +import java.text.AttributedCharacterIterator; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Map; +import javax.baja.alarm.AlarmSupport; +import javax.baja.alarm.BAlarmRecipient; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.alarm.BAlarmSourceInfo; +import javax.baja.alarm.BIAlarmSource; +import javax.baja.alarm.BSourceState; +import javax.baja.data.BIDataValue; +import javax.baja.gx.BFont; +import javax.baja.log.Log; +import javax.baja.naming.BOrd; +import javax.baja.naming.BOrdList; +import javax.baja.sys.Action; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BFacets; +import javax.baja.sys.BIcon; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.BFormat; +import javax.baja.util.Queue; +import javax.baja.util.Worker; +import javax.print.DocFlavor; +import javax.print.DocPrintJob; +import javax.print.PrintException; +import javax.print.PrintService; +import javax.print.PrintServiceLookup; +import javax.print.SimpleDoc; +import javax.print.attribute.HashAttributeSet; +import javax.print.attribute.standard.PrinterName; + +public class BPrinterRecipient +extends BAlarmRecipient +implements BIAlarmSource { + public static final Property printer = BPrinterRecipient.newProperty((int)0, (String)"", (BFacets)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"alarm:PrinterFE"))); + public static final Property font = BPrinterRecipient.newProperty((int)0, (BValue)BFont.make((String)"12pt Monospaced"), null); + public static final Property printFormat = BPrinterRecipient.newProperty((int)0, (BValue)BPrinterRecipient.makeDefaultPrintFormat(), (BFacets)BFacets.make((String)"multiLine", (BIDataValue)BBoolean.make((boolean)true))); + public static final Property alertOnFailure = BPrinterRecipient.newProperty((int)0, (boolean)false, null); + public static final Property alarmSourceInfo = BPrinterRecipient.newProperty((int)0, (BValue)BPrinterRecipient.makeDefaultAlarmSourceInfo(), null); + public static final Action getPrinters = BPrinterRecipient.newAction((int)0, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$print$BPrinterRecipient == null ? (class$com$tridium$alarm$print$BPrinterRecipient = BPrinterRecipient.class$("com.tridium.alarm.print.BPrinterRecipient")) : class$com$tridium$alarm$print$BPrinterRecipient)); + private static final Log log = Log.getLog((String)"alarm.printer"); + private AlarmSupport support; + private Queue printQueue = new Queue(); + private Worker printThread = new Worker((Worker.ITodo)this.printQueue); + private static final BIcon icon = BIcon.make((BIcon)BIcon.std((String)"print.png"), (BIcon)BIcon.std((String)"badges/alarm.png")); + static /* synthetic */ Class class$com$tridium$alarm$print$BPrinterRecipient; + + public String getPrinter() { + return this.getString(printer); + } + + public void setPrinter(String string) { + this.setString(printer, string, null); + } + + public BFont getFont() { + return (BFont)this.get(font); + } + + public void setFont(BFont bFont) { + this.set(font, (BValue)bFont, null); + } + + public BFormat getPrintFormat() { + return (BFormat)this.get(printFormat); + } + + public void setPrintFormat(BFormat bFormat) { + this.set(printFormat, (BValue)bFormat, null); + } + + public boolean getAlertOnFailure() { + return this.getBoolean(alertOnFailure); + } + + public void setAlertOnFailure(boolean bl) { + this.setBoolean(alertOnFailure, bl, null); + } + + public BAlarmSourceInfo getAlarmSourceInfo() { + return (BAlarmSourceInfo)this.get(alarmSourceInfo); + } + + public void setAlarmSourceInfo(BAlarmSourceInfo bAlarmSourceInfo) { + this.set(alarmSourceInfo, (BValue)bAlarmSourceInfo, null); + } + + public BVector getPrinters() { + return (BVector)this.invoke(getPrinters, null, null); + } + + public Type getType() { + return TYPE; + } + + public void started() throws Exception { + this.support = new AlarmSupport((BIAlarmSource)this, this.getAlarmSourceInfo()); + this.printThread.start("alarm:printing"); + } + + public void stopped() throws Exception { + this.printThread.stop(); + } + + public static BFormat makeDefaultPrintFormat() { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("Source: %alarmData.sourceName%\n"); + stringBuffer.append("Timestamp: %timestamp%\n"); + stringBuffer.append("State: %sourceState% / %ackState%\n"); + stringBuffer.append("Priority: %priority%\n"); + stringBuffer.append("Alarm Class: %alarmClass%\n"); + stringBuffer.append("Text: %alarmData.msgText%\n"); + stringBuffer.append("\n"); + return BFormat.make((String)stringBuffer.toString()); + } + + public static BAlarmSourceInfo makeDefaultAlarmSourceInfo() { + BAlarmSourceInfo bAlarmSourceInfo = new BAlarmSourceInfo(); + bAlarmSourceInfo.setAlarmIcon(BOrd.make((String)"module://icons/x16/print.png")); + return bAlarmSourceInfo; + } + + public BVector doGetPrinters() { + PrintService[] printServiceArray = PrintServiceLookup.lookupPrintServices(DocFlavor.INPUT_STREAM.AUTOSENSE, null); + BVector bVector = new BVector(); + for (int i = 0; i < printServiceArray.length; ++i) { + bVector.add(null, (BValue)BString.make((String)printServiceArray[i].getName())); + } + return bVector; + } + + public void handleAlarm(BAlarmRecord bAlarmRecord) { + if (bAlarmRecord.getSource().equals((Object)BOrdList.make((BOrd)this.getNavOrd()))) { + return; + } + this.printQueue.enqueue((Object)new PrintJob(BFormat.make((String)this.getPrintFormat().format((Object)bAlarmRecord)).format((Object)bAlarmRecord))); + } + + public BBoolean ackAlarm(BAlarmRecord bAlarmRecord) { + try { + return BBoolean.make((boolean)this.support.ackAlarm(bAlarmRecord)); + } + catch (Exception exception) { + return BBoolean.FALSE; + } + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private class PrintJob + implements Runnable, + Printable { + int[] lineNumberAtTopOfPage; + ArrayList textLines = new ArrayList(); + + public PrintJob(String string) { + int n; + String[] stringArray = string.split("\n"); + for (n = 0; n < stringArray.length; ++n) { + this.textLines.add(stringArray[n]); + } + this.lineNumberAtTopOfPage = new int[100]; + this.lineNumberAtTopOfPage[0] = 0; + for (n = 1; n < this.lineNumberAtTopOfPage.length; ++n) { + this.lineNumberAtTopOfPage[n] = -1; + } + } + + public int print(Graphics graphics, PageFormat pageFormat, int n) throws PrinterException { + int n2 = this.lineNumberAtTopOfPage[n]; + if (this.lineNumberAtTopOfPage[n] == -1) { + return 1; + } + if (n != 0) { + while (((String)this.textLines.get(n2)).length() == 0) { + ++n2; + } + } + try { + Object object; + Font font; + int n3; + Object object2; + Graphics2D graphics2D = (Graphics2D)graphics; + graphics2D.translate(pageFormat.getImageableX(), pageFormat.getImageableY()); + if (!BPrinterRecipient.this.getFont().isNull()) { + object2 = BPrinterRecipient.this.getFont(); + n3 = 0; + if (object2.isBold()) { + n3 |= 1; + } + if (object2.isItalic()) { + n3 |= 2; + } + font = new Font(object2.getName(), n3, (int)object2.getSize()); + if (object2.isUnderline()) { + object = new Hashtable(); + object.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON); + font = font.deriveFont((Map)object); + } + graphics.setFont(font); + graphics2D.setFont(font); + } else { + font = graphics2D.getFont(); + } + object2 = graphics2D.getFontMetrics(font); + n3 = ((FontMetrics)object2).getAscent(); + while (n2 < this.textLines.size() && (double)n3 < pageFormat.getImageableHeight()) { + object = (String)this.textLines.get(n2); + if ((double)((FontMetrics)object2).charsWidth(((String)object).toCharArray(), 0, ((String)object).length()) > pageFormat.getImageableWidth()) { + int n4; + ArrayList arrayList = new ArrayList(); + for (int i = 0; i < ((String)object).length(); i += n4) { + n4 = ((String)object).length() - i; + while ((double)((FontMetrics)object2).charsWidth(((String)object).toCharArray(), i, n4) > pageFormat.getImageableWidth()) { + --n4; + } + int n5 = n4; + if (i + n5 < ((String)object).length()) { + while (((String)object).charAt(i + n5 - 1) != ' ' && n5 > 1) { + --n5; + } + if (n5 > 1) { + n4 = n5; + } + } + arrayList.add(((String)object).substring(i, i + n4)); + } + this.textLines.remove(n2); + for (n4 = arrayList.size() - 1; n4 >= 0; --n4) { + this.textLines.add(n2, arrayList.get(n4)); + } + } + graphics2D.drawString((String)object, 0, n3); + n3 += ((FontMetrics)object2).getAscent(); + ++n2; + } + if ((double)n3 >= pageFormat.getImageableHeight()) { + this.lineNumberAtTopOfPage[n + 1] = n2; + } + } + catch (Exception exception) { + log.error("Print failure", (Throwable)exception); + return 1; + } + return 0; + } + + public void run() { + HashAttributeSet hashAttributeSet = new HashAttributeSet(); + hashAttributeSet.add(new PrinterName(BPrinterRecipient.this.getPrinter(), null)); + PrintService[] printServiceArray = PrintServiceLookup.lookupPrintServices(null, hashAttributeSet); + if (printServiceArray.length < 1) { + try { + if (BPrinterRecipient.this.getAlertOnFailure()) { + BFacets bFacets = BPrinterRecipient.this.getAlarmSourceInfo().makeAlarmData(BSourceState.offnormal); + bFacets = BFacets.make((BFacets)bFacets, (String)"msgText", (BIDataValue)BString.make((String)("Printer '" + BPrinterRecipient.this.getPrinter() + "' not found."))); + BPrinterRecipient.this.support.newAlert(bFacets); + } + } + catch (Exception exception) { + log.warning("Printer not found: " + BPrinterRecipient.this.getPrinter(), (Throwable)exception); + } + return; + } + try { + DocPrintJob docPrintJob = printServiceArray[0].createPrintJob(); + docPrintJob.print(new SimpleDoc(this, DocFlavor.SERVICE_FORMATTED.PRINTABLE, null), null); + } + catch (PrintException printException) { + if (BPrinterRecipient.this.getAlertOnFailure()) { + BFacets bFacets = BPrinterRecipient.this.getAlarmSourceInfo().makeAlarmData(BSourceState.offnormal); + bFacets = BFacets.make((BFacets)bFacets, (String)"msgText", (BIDataValue)BString.make((String)("Unable to print to '" + BPrinterRecipient.this.getPrinter() + "'"))); + try { + BPrinterRecipient.this.support.newAlert(bFacets); + } + catch (Exception exception) { + // empty catch block + } + } + log.error("Printer failure", (Throwable)printException); + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/AlarmDbTableModel.java b/modules/cfr_output/com/tridium/alarm/ui/AlarmDbTableModel.java new file mode 100644 index 0000000..9f72362 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/AlarmDbTableModel.java @@ -0,0 +1,105 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nre.util.Array + * javax.baja.nre.util.SortUtil + * javax.baja.sys.Cursor + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.ui.ConsoleColumns; +import com.tridium.alarm.ui.ConsoleTableModel; +import java.util.Comparator; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.nre.util.Array; +import javax.baja.nre.util.SortUtil; +import javax.baja.sys.Cursor; + +public class AlarmDbTableModel +extends ConsoleTableModel { + private Array alarmList = new Array(class$javax$baja$alarm$BAlarmRecord == null ? (class$javax$baja$alarm$BAlarmRecord = AlarmDbTableModel.class$("javax.baja.alarm.BAlarmRecord")) : class$javax$baja$alarm$BAlarmRecord); + static /* synthetic */ Class class$javax$baja$alarm$BAlarmRecord; + + public AlarmDbTableModel(ConsoleColumns consoleColumns) { + super(consoleColumns); + } + + public synchronized void load(Cursor cursor) { + this.clear(); + this.doAdd(cursor); + } + + public int getAlarmCount() { + return this.alarmList.size(); + } + + public int getSourceCount() { + return -1; + } + + private synchronized void doAdd(Cursor cursor) { + while (cursor.next()) { + this.add((BAlarmRecord)cursor.get()); + } + this.updateTable(); + } + + public synchronized void add(BAlarmRecord bAlarmRecord) { + this.alarmList.add((Object)bAlarmRecord); + } + + public synchronized void clear() { + this.alarmList.clear(); + this.updateTable(); + } + + public int getRowCount() { + return this.alarmList.size(); + } + + public BAlarmRecord getRecord(int n) { + if (n < this.getRowCount()) { + return (BAlarmRecord)((Object)this.alarmList.get(n)); + } + return null; + } + + public synchronized void sortByColumn(int n, boolean bl) { + if (n < 0 || n >= super.getColumnCount()) { + return; + } + this.setInitialSort(n, bl); + ConsoleColumns.Column column = this.getColumns().getColumn(n); + if (bl) { + this.sort(column, SortUtil.ASCENDING); + } else { + this.sort(column, SortUtil.DESCENDING); + } + } + + private void sort(ConsoleColumns.Column column, Comparator comparator) { + int n = this.alarmList.size(); + for (int i = n / 2; i >= 1; i /= 2) { + for (int j = i; j < n; ++j) { + int n2; + BAlarmRecord bAlarmRecord = (BAlarmRecord)((Object)this.alarmList.get(j)); + Object object = column.getValue(bAlarmRecord); + for (n2 = j; n2 >= i && comparator.compare(object, column.getValue((BAlarmRecord)((Object)this.alarmList.get(n2 - i)))) < 0; n2 -= i) { + this.alarmList.set(n2, this.alarmList.get(n2 - i)); + } + this.alarmList.set(n2, (Object)bAlarmRecord); + } + } + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/AlarmTableModel.java b/modules/cfr_output/com/tridium/alarm/ui/AlarmTableModel.java new file mode 100644 index 0000000..1715eb3 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/AlarmTableModel.java @@ -0,0 +1,61 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nre.util.SortUtil + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.ui.ConsoleColumns; +import com.tridium.alarm.ui.ConsoleTableModel; +import com.tridium.alarm.ui.SourceTableModel; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.nre.util.SortUtil; + +public class AlarmTableModel +extends ConsoleTableModel { + private SourceTableModel.AlarmList alarmList; + + public AlarmTableModel(ConsoleColumns consoleColumns, SourceTableModel.AlarmList alarmList) { + super(consoleColumns); + this.alarmList = alarmList; + alarmList.setModel(this); + this.sortByColumn(this.getLastSortColumn(), this.getLastSortAscending()); + } + + public int getAlarmCount() { + return this.getRowCount(); + } + + public int getSourceCount() { + return 1; + } + + public int getRowCount() { + return this.alarmList.size(); + } + + public BAlarmRecord getRecord(int n) { + SourceTableModel.AlarmEntry alarmEntry = this.alarmList.getEntry(n); + return alarmEntry.rec; + } + + public void close() { + super.close(); + this.alarmList.setModel(null); + } + + public synchronized void sortByColumn(int n, boolean bl) { + if (n < 0 || n >= super.getColumnCount()) { + return; + } + this.setInitialSort(n, bl); + ConsoleColumns.Column column = this.getColumns().getColumn(n); + if (bl) { + this.alarmList.sort(column, SortUtil.ASCENDING); + } else { + this.alarmList.sort(column, SortUtil.DESCENDING); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassDef.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassDef.java new file mode 100644 index 0000000..1bd4d3b --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassDef.java @@ -0,0 +1,87 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.ui.UiEnv + * javax.baja.naming.BOrd + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.Property + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.alarm.ui; + +import com.tridium.ui.UiEnv; +import javax.baja.naming.BOrd; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.Property; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public class BAlarmClassDef +extends BComponent { + public static final Property defName = BAlarmClassDef.newProperty((int)0, (String)"", null); + public static final Property alarmIcon = BAlarmClassDef.newProperty((int)0, (BValue)BOrd.NULL, null); + public static final Property alarmUrl = BAlarmClassDef.newProperty((int)0, (BValue)BOrd.NULL, null); + public static final Property alarmSound = BAlarmClassDef.newProperty((int)0, (BValue)BOrd.NULL, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmClassDef == null ? (class$com$tridium$alarm$ui$BAlarmClassDef = BAlarmClassDef.class$("com.tridium.alarm.ui.BAlarmClassDef")) : class$com$tridium$alarm$ui$BAlarmClassDef)); + public static BAlarmClassDef DEFAULT = new BAlarmClassDef(); + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmClassDef; + + public String getDefName() { + return this.getString(defName); + } + + public void setDefName(String string) { + this.setString(defName, string, null); + } + + public BOrd getAlarmIcon() { + return (BOrd)this.get(alarmIcon); + } + + public void setAlarmIcon(BOrd bOrd) { + this.set(alarmIcon, (BValue)bOrd, null); + } + + public BOrd getAlarmUrl() { + return (BOrd)this.get(alarmUrl); + } + + public void setAlarmUrl(BOrd bOrd) { + this.set(alarmUrl, (BValue)bOrd, null); + } + + public BOrd getAlarmSound() { + return (BOrd)this.get(alarmSound); + } + + public void setAlarmSound(BOrd bOrd) { + this.set(alarmSound, (BValue)bOrd, null); + } + + public Type getType() { + return TYPE; + } + + public BAlarmClassDef() { + if (UiEnv.get().isMicroEdition()) { + int n = this.getFlags((Slot)alarmSound); + this.setFlags((Slot)alarmSound, n | 4); + } + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassFE.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassFE.java new file mode 100644 index 0000000..1944b79 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassFE.java @@ -0,0 +1,65 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.workbench.fieldeditors.BComponentNamePickerFE + * javax.baja.nre.util.Array + * javax.baja.sys.BComponent + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.alarm.ui; + +import com.tridium.workbench.fieldeditors.BComponentNamePickerFE; +import javax.baja.alarm.BAlarmClassFolder; +import javax.baja.alarm.BAlarmService; +import javax.baja.nre.util.Array; +import javax.baja.sys.BComponent; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public class BAlarmClassFE +extends BComponentNamePickerFE { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmClassFE == null ? (class$com$tridium$alarm$ui$BAlarmClassFE = BAlarmClassFE.class$("com.tridium.alarm.ui.BAlarmClassFE")) : class$com$tridium$alarm$ui$BAlarmClassFE)); + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmClassFE; + static /* synthetic */ Class class$javax$baja$sys$BComponent; + static /* synthetic */ Class class$javax$baja$alarm$BAlarmClass; + static /* synthetic */ Class class$javax$baja$alarm$BAlarmClassFolder; + + public Type getType() { + return TYPE; + } + + public BComponent[] list() throws Exception { + BComponent bComponent = this.loadService(BAlarmService.TYPE); + return this.loadFromFolder(bComponent); + } + + private BComponent[] loadFromFolder(BComponent bComponent) { + Array array = new Array(class$javax$baja$sys$BComponent == null ? (class$javax$baja$sys$BComponent = BAlarmClassFE.class$("javax.baja.sys.BComponent")) : class$javax$baja$sys$BComponent); + bComponent.lease(); + BComponent[] bComponentArray = (BComponent[])bComponent.getChildren(class$javax$baja$alarm$BAlarmClass == null ? (class$javax$baja$alarm$BAlarmClass = BAlarmClassFE.class$("javax.baja.alarm.BAlarmClass")) : class$javax$baja$alarm$BAlarmClass); + for (int i = 0; i < bComponentArray.length; ++i) { + array.add((Object)bComponentArray[i]); + } + BAlarmClassFolder[] bAlarmClassFolderArray = (BAlarmClassFolder[])bComponent.getChildren(class$javax$baja$alarm$BAlarmClassFolder == null ? (class$javax$baja$alarm$BAlarmClassFolder = BAlarmClassFE.class$("javax.baja.alarm.BAlarmClassFolder")) : class$javax$baja$alarm$BAlarmClassFolder); + for (int i = 0; i < bAlarmClassFolderArray.length; ++i) { + this.loadFromFolder((BComponent)bAlarmClassFolderArray[i]); + BComponent[] bComponentArray2 = this.loadFromFolder((BComponent)bAlarmClassFolderArray[i]); + for (int j = 0; j < bComponentArray2.length; ++j) { + array.add((Object)bComponentArray2[j]); + } + } + return (BComponent[])array.trim(); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassMapping.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassMapping.java new file mode 100644 index 0000000..39027e4 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassMapping.java @@ -0,0 +1,68 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.naming.SlotPath + * javax.baja.sys.BComponent + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.ui.BAlarmClassDef; +import javax.baja.naming.SlotPath; +import javax.baja.sys.BComponent; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public class BAlarmClassMapping +extends BComponent { + public static final Property alarmClassDefinitions = BAlarmClassMapping.newProperty((int)4, (BValue)new BComponent(), null); + public static final Property alarmClassDefMapping = BAlarmClassMapping.newProperty((int)4, (BValue)new BComponent(), null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmClassMapping == null ? (class$com$tridium$alarm$ui$BAlarmClassMapping = BAlarmClassMapping.class$("com.tridium.alarm.ui.BAlarmClassMapping")) : class$com$tridium$alarm$ui$BAlarmClassMapping)); + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmClassMapping; + + public BComponent getAlarmClassDefinitions() { + return (BComponent)this.get(alarmClassDefinitions); + } + + public void setAlarmClassDefinitions(BComponent bComponent) { + this.set(alarmClassDefinitions, (BValue)bComponent, null); + } + + public BComponent getAlarmClassDefMapping() { + return (BComponent)this.get(alarmClassDefMapping); + } + + public void setAlarmClassDefMapping(BComponent bComponent) { + this.set(alarmClassDefMapping, (BValue)bComponent, null); + } + + public Type getType() { + return TYPE; + } + + public BAlarmClassDef getAlarmClassDefFor(String string) { + BString bString = (BString)this.getAlarmClassDefMapping().get(string); + if (bString == null) { + return BAlarmClassDef.DEFAULT; + } + return (BAlarmClassDef)this.getAlarmClassDefinitions().get(SlotPath.escape((String)bString.toString())); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassMappingFE.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassMappingFE.java new file mode 100644 index 0000000..62d9976 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassMappingFE.java @@ -0,0 +1,525 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.ui.UiEnv + * com.tridium.workbench.fieldeditors.BOrdFE + * com.tridium.workbench.ord.BFileOrdChooser + * javax.baja.naming.BOrd + * javax.baja.naming.SlotPath + * javax.baja.registry.TypeInfo + * javax.baja.sys.BComplex + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.SlotCursor + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BTextDropDown + * javax.baja.ui.BTextField + * javax.baja.ui.BToolBar + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.enums.BOrientation + * javax.baja.ui.event.BMouseEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.pane.BSplitPane + * javax.baja.ui.table.BTable + * javax.baja.ui.table.DefaultTableModel + * javax.baja.ui.table.TableController + * javax.baja.ui.table.TableModel + * javax.baja.ui.util.BTitlePane + * javax.baja.ui.util.UiLexicon + * javax.baja.workbench.BWbShell + * javax.baja.workbench.fieldeditor.BWbFieldEditor + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.ui.BAlarmClassDef; +import com.tridium.alarm.ui.BAlarmClassFE; +import com.tridium.alarm.ui.BAlarmClassMapping; +import com.tridium.ui.UiEnv; +import com.tridium.workbench.fieldeditors.BOrdFE; +import com.tridium.workbench.ord.BFileOrdChooser; +import javax.baja.alarm.BAlarmService; +import javax.baja.naming.BOrd; +import javax.baja.naming.SlotPath; +import javax.baja.registry.TypeInfo; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.SlotCursor; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BTextDropDown; +import javax.baja.ui.BTextField; +import javax.baja.ui.BToolBar; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.enums.BOrientation; +import javax.baja.ui.event.BMouseEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.pane.BSplitPane; +import javax.baja.ui.table.BTable; +import javax.baja.ui.table.DefaultTableModel; +import javax.baja.ui.table.TableController; +import javax.baja.ui.table.TableModel; +import javax.baja.ui.util.BTitlePane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.workbench.BWbShell; +import javax.baja.workbench.fieldeditor.BWbFieldEditor; + +public class BAlarmClassMappingFE +extends BWbFieldEditor { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmClassMappingFE == null ? (class$com$tridium$alarm$ui$BAlarmClassMappingFE = BAlarmClassMappingFE.class$("com.tridium.alarm.ui.BAlarmClassMappingFE")) : class$com$tridium$alarm$ui$BAlarmClassMappingFE)); + protected BWidget popup; + protected Context context; + protected boolean isMicroEdition = false; + protected Command mapCommand; + protected Command removeMapCommand; + protected Command addDefCommand; + protected Command editDefCommand; + protected Command delDefCommand; + protected MappingTableModel mappingTableModel = new MappingTableModel(); + protected DefaultTableModel defTableModel; + public static final UiLexicon lexicon = new UiLexicon(class$com$tridium$alarm$ui$BAlarmConsole == null ? (class$com$tridium$alarm$ui$BAlarmConsole = BAlarmClassMappingFE.class$("com.tridium.alarm.ui.BAlarmConsole")) : class$com$tridium$alarm$ui$BAlarmConsole); + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmClassMappingFE; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmClassDef; + static /* synthetic */ Class class$javax$baja$sys$BString; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmConsole; + + public Type getType() { + return TYPE; + } + + public BAlarmClassMappingFE() { + if (UiEnv.get().isMicroEdition()) { + this.defTableModel = new DefaultTableModel(new String[]{lexicon.getText("alarmClassMapper.name"), lexicon.getText("alarmClassMapper.icon"), lexicon.getText("alarmClassMapper.hyperlink")}); + this.isMicroEdition = true; + } else { + this.defTableModel = new DefaultTableModel(new String[]{lexicon.getText("alarmClassMapper.name"), lexicon.getText("alarmClassMapper.icon"), lexicon.getText("alarmClassMapper.hyperlink"), lexicon.getText("alarmClassMapper.sound")}); + } + Command command = new Command((BWidget)this, BAlarmClassMappingFE.lexicon.module, "commands.alarmClassMappingFE"){ + + public CommandArtifact doInvoke() { + int n; + if (BAlarmClassMappingFE.this.popup == null) { + BAlarmClassMappingFE.this.popup = BAlarmClassMappingFE.this.createPopup(); + } + if ((n = BDialog.open((BWidget)BAlarmClassMappingFE.this, (String)lexicon.getText("alarmClassMapper.title"), (Object)BAlarmClassMappingFE.this.popup, (int)3)) == 1) { + BAlarmClassMappingFE.this.setModified(); + } + return null; + } + }; + BButton bButton = new BButton(command, false, true); + BGridPane bGridPane = new BGridPane(2); + bGridPane.add("name", (BValue)new BLabel(lexicon.getText("alarmClassMapper.mapping"))); + BToolBar bToolBar = new BToolBar(); + bToolBar.add("btn", (BValue)bButton); + bGridPane.add("button", (BValue)bToolBar); + this.setContent((BWidget)bGridPane); + } + + public BWidget createPopup() { + this.addDefCommand = new Command((BWidget)this, BAlarmClassMappingFE.lexicon.module, "commands.addDef"){ + + public CommandArtifact doInvoke() { + BAlarmClassMappingFE.this.addAlarmClassDef(); + return null; + } + }; + BButton bButton = new BButton(this.addDefCommand); + this.editDefCommand = new Command((BWidget)this, BAlarmClassMappingFE.lexicon.module, "commands.editDef"){ + + public CommandArtifact doInvoke() { + BAlarmClassMappingFE.this.editAlarmClassDef(); + return null; + } + }; + BButton bButton2 = new BButton(this.editDefCommand); + this.editDefCommand.setEnabled(this.defTableModel.getRowCount() > 0); + this.delDefCommand = new Command((BWidget)this, BAlarmClassMappingFE.lexicon.module, "commands.deleteDef"){ + + public CommandArtifact doInvoke() { + BAlarmClassMappingFE.this.delAlarmClassDef(); + return null; + } + }; + BButton bButton3 = new BButton(this.delDefCommand); + this.delDefCommand.setEnabled(this.defTableModel.getRowCount() > 0); + BEdgePane bEdgePane = new BEdgePane(); + BEdgePane bEdgePane2 = new BEdgePane(); + BGridPane bGridPane = new BGridPane(3); + bGridPane.add("add", (BValue)bButton); + bGridPane.add("edit", (BValue)bButton2); + bGridPane.add("del", (BValue)bButton3); + bEdgePane2.setCenter((BWidget)new BBorderPane((BWidget)new BTable((TableModel)this.defTableModel, (TableController)new Controller()))); + bEdgePane2.setBottom((BWidget)new BBorderPane((BWidget)bGridPane)); + this.defTableModel.getTable().setMultipleSelection(false); + bEdgePane.setCenter((BWidget)new BTitlePane(lexicon.getText("alarmClassMapper.alarmClassDefs"), (BWidget)bEdgePane2)); + this.mapCommand = new Command((BWidget)this, BAlarmClassMappingFE.lexicon.module, "commands.mapAlarmClass"){ + + public CommandArtifact doInvoke() { + BAlarmClassMappingFE.this.mapAlarmClass(); + return null; + } + }; + BButton bButton4 = new BButton(this.mapCommand); + this.removeMapCommand = new Command((BWidget)this, BAlarmClassMappingFE.lexicon.module, "commands.deleteAlarmClassMap"){ + + public CommandArtifact doInvoke() { + BAlarmClassMappingFE.this.deleteAlarmClassMap(); + return null; + } + }; + this.removeMapCommand.setEnabled(false); + BButton bButton5 = new BButton(this.removeMapCommand); + BGridPane bGridPane2 = new BGridPane(3); + bGridPane2.add("b1", (BValue)bButton4); + bGridPane2.add("b3", (BValue)bButton5); + BEdgePane bEdgePane3 = new BEdgePane(); + BTable bTable = new BTable((TableModel)this.mappingTableModel, (TableController)new MappingTableController()); + bTable.setPreferredSize(800.0, 800.0); + bEdgePane3.setCenter((BWidget)new BBorderPane((BWidget)bTable)); + bEdgePane3.setBottom((BWidget)new BBorderPane((BWidget)bGridPane2)); + BSplitPane bSplitPane = new BSplitPane(BOrientation.vertical, 50.0); + bSplitPane.setWidget1((BWidget)bEdgePane); + bSplitPane.setWidget2((BWidget)new BTitlePane(lexicon.getText("alarmClassMapper.alarmClassDefMapping"), (BWidget)bEdgePane3)); + return bSplitPane; + } + + protected void doSetReadonly(boolean bl) { + } + + protected void doLoadValue(BObject bObject, Context context) { + BAlarmClassMapping bAlarmClassMapping = (BAlarmClassMapping)bObject; + this.context = context; + BAlarmClassDef[] bAlarmClassDefArray = (BAlarmClassDef[])bAlarmClassMapping.getAlarmClassDefinitions().getChildren(class$com$tridium$alarm$ui$BAlarmClassDef == null ? (class$com$tridium$alarm$ui$BAlarmClassDef = BAlarmClassMappingFE.class$("com.tridium.alarm.ui.BAlarmClassDef")) : class$com$tridium$alarm$ui$BAlarmClassDef); + for (int i = 0; i < bAlarmClassDefArray.length; ++i) { + if (this.isMicroEdition) { + this.defTableModel.addRow(new Object[]{SlotPath.unescape((String)bAlarmClassDefArray[i].getDefName()), bAlarmClassDefArray[i].getAlarmIcon(), bAlarmClassDefArray[i].getAlarmUrl()}); + continue; + } + this.defTableModel.addRow(new Object[]{SlotPath.unescape((String)bAlarmClassDefArray[i].getDefName()), bAlarmClassDefArray[i].getAlarmIcon(), bAlarmClassDefArray[i].getAlarmUrl(), bAlarmClassDefArray[i].getAlarmSound()}); + } + this.defTableModel.updateTable(); + BComponent bComponent = bAlarmClassMapping.getAlarmClassDefMapping(); + SlotCursor slotCursor = bComponent.getProperties(); + boolean bl = false; + while (slotCursor.next(class$javax$baja$sys$BString == null ? BAlarmClassMappingFE.class$("javax.baja.sys.BString") : class$javax$baja$sys$BString)) { + Property property = slotCursor.property(); + String string = property.getName(); + BString bString = (BString)slotCursor.get(); + this.mappingTableModel.addRow(new Object[]{string, bString}); + } + this.mappingTableModel.updateTable(); + } + + protected BObject doSaveValue(BObject object, Context context) { + try { + BOrd bOrd; + String string; + BComponent bComponent = new BComponent(); + for (int i = 0; i < this.defTableModel.getRowCount(); ++i) { + BAlarmClassDef bAlarmClassDef = new BAlarmClassDef(); + string = SlotPath.escape((String)((String)this.defTableModel.getValueAt(i, 0))); + bOrd = (BOrd)this.defTableModel.getValueAt(i, 1); + BOrd bOrd2 = (BOrd)this.defTableModel.getValueAt(i, 2); + bAlarmClassDef.setDefName(string); + bAlarmClassDef.setAlarmIcon(bOrd); + bAlarmClassDef.setAlarmUrl(bOrd2); + if (!this.isMicroEdition) { + BOrd bOrd3 = (BOrd)this.defTableModel.getValueAt(i, 3); + bAlarmClassDef.setAlarmSound(bOrd3); + } + bComponent.add(string, (BValue)bAlarmClassDef); + } + BComponent bComponent2 = new BComponent(); + for (int i = 0; i < this.mappingTableModel.getRowCount(); ++i) { + string = SlotPath.escape((String)this.mappingTableModel.getAlarmClassName(i)); + bOrd = (BString)this.mappingTableModel.getValueAt(i, 1); + bComponent2.add(string, (BValue)bOrd); + } + BAlarmClassMapping bAlarmClassMapping = (BAlarmClassMapping)((Object)object); + bAlarmClassMapping.setAlarmClassDefinitions(bComponent); + bAlarmClassMapping.setAlarmClassDefMapping(bComponent2); + object = bAlarmClassMapping; + return bAlarmClassMapping; + } + catch (Exception exception) { + exception.printStackTrace(); + return null; + } + } + + protected BWidget makeAlarmClassDefPane(String string, BAlarmClassDef bAlarmClassDef) { + if (bAlarmClassDef == null) { + bAlarmClassDef = new BAlarmClassDef(); + } + BGridPane bGridPane = new BGridPane(2); + bGridPane.add("nameLbl", (BValue)new BLabel(lexicon.getText("alarmClassMapper.name"))); + bGridPane.add("nameField", (BValue)new BTextField(string, 20)); + bGridPane.add("iconLbl", (BValue)new BLabel(lexicon.getText("alarmClassMapper.icon"))); + BOrdFE bOrdFE = new BOrdFE(); + bOrdFE.allowLinkButton(false); + bOrdFE.loadMenu(new TypeInfo[]{BFileOrdChooser.TYPE.getTypeInfo()}); + bOrdFE.loadValue((BObject)bAlarmClassDef.getAlarmIcon()); + bGridPane.add("iconField", (BValue)bOrdFE); + bGridPane.add("hyperlinkLbl", (BValue)new BLabel(lexicon.getText("alarmClassMapper.hyperlink"))); + BOrdFE bOrdFE2 = new BOrdFE(); + bOrdFE2.allowLinkButton(false); + bOrdFE2.loadMenu(new TypeInfo[0]); + bOrdFE2.loadValue((BObject)bAlarmClassDef.getAlarmUrl()); + bGridPane.add("hyperlinkField", (BValue)bOrdFE2); + if (!this.isMicroEdition) { + bGridPane.add("soundLbl", (BValue)new BLabel(lexicon.getText("alarmClassMapper.sound"))); + BOrdFE bOrdFE3 = new BOrdFE(); + bOrdFE3.allowLinkButton(false); + bOrdFE3.loadMenu(new TypeInfo[]{BFileOrdChooser.TYPE.getTypeInfo()}); + bOrdFE3.loadValue((BObject)bAlarmClassDef.getAlarmSound()); + bGridPane.add("soundField", (BValue)bOrdFE3); + } + return bGridPane; + } + + protected void addAlarmClassDef() { + BWidget bWidget = this.makeAlarmClassDefPane("", null); + int n = BDialog.open((BWidget)this, (String)lexicon.getText("commands.addDef.label"), (Object)bWidget, (int)3); + if (n == 2) { + return; + } + try { + String string = ((BTextField)bWidget.get("nameField")).getText(); + BOrd bOrd = (BOrd)((BOrdFE)bWidget.get("iconField")).saveValue(); + BOrd bOrd2 = (BOrd)((BOrdFE)bWidget.get("hyperlinkField")).saveValue(); + if (!this.isMicroEdition) { + BOrd bOrd3 = (BOrd)((BOrdFE)bWidget.get("soundField")).saveValue(); + this.defTableModel.addRow(new Object[]{string, bOrd, bOrd2, bOrd3}); + } else { + this.defTableModel.addRow(new Object[]{string, bOrd, bOrd2}); + } + this.defTableModel.updateTable(); + this.editDefCommand.setEnabled(true); + this.delDefCommand.setEnabled(true); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + protected void editAlarmClassDef() { + BWidget bWidget; + int n = this.defTableModel.getTable().getSelection().getRow(); + if (n < 0) { + return; + } + BAlarmClassDef bAlarmClassDef = new BAlarmClassDef(); + String string = (String)this.defTableModel.getValueAt(n, 0); + BOrd bOrd = (BOrd)this.defTableModel.getValueAt(n, 1); + BOrd bOrd2 = (BOrd)this.defTableModel.getValueAt(n, 2); + bAlarmClassDef.setDefName(string); + bAlarmClassDef.setAlarmIcon(bOrd); + bAlarmClassDef.setAlarmUrl(bOrd2); + if (!this.isMicroEdition) { + bWidget = (BOrd)this.defTableModel.getValueAt(n, 3); + bAlarmClassDef.setAlarmSound((BOrd)bWidget); + } + bWidget = this.makeAlarmClassDefPane(bAlarmClassDef.getDefName(), bAlarmClassDef); + int n2 = BDialog.open((BWidget)this, (String)lexicon.getText("commands.editDef.label"), (Object)bWidget, (int)3); + if (n2 == 2) { + return; + } + try { + string = ((BTextField)bWidget.get("nameField")).getText(); + bOrd = (BOrd)((BOrdFE)bWidget.get("iconField")).saveValue(); + bOrd2 = (BOrd)((BOrdFE)bWidget.get("hyperlinkField")).saveValue(); + this.defTableModel.set(n, 0, (Object)string); + this.defTableModel.set(n, 1, (Object)bOrd); + this.defTableModel.set(n, 2, (Object)bOrd2); + if (!this.isMicroEdition) { + BOrd bOrd3 = (BOrd)((BOrdFE)bWidget.get("soundField")).saveValue(); + this.defTableModel.set(n, 3, (Object)bOrd3); + } + this.defTableModel.updateTable(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + protected void delAlarmClassDef() { + int n = this.defTableModel.getTable().getSelection().getRow(); + if (n < 0) { + return; + } + String string = (String)this.defTableModel.getValueAt(n, 0); + this.defTableModel.removeRow(n); + this.defTableModel.updateTable(); + this.delDefCommand.setEnabled(this.defTableModel.getRowCount() > 0); + this.editDefCommand.setEnabled(this.defTableModel.getRowCount() > 0); + try { + int n2 = this.mappingTableModel.getRowCount(); + for (int i = n2 - 1; i >= 0; --i) { + String string2 = this.mappingTableModel.getValueAt(i, 1).toString(); + if (!string.equals(string2)) continue; + this.mappingTableModel.removeRow(n); + this.mappingTableModel.updateTable(); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + protected void mapAlarmClass() { + String string; + BTextDropDown bTextDropDown = new BTextDropDown(false); + for (int i = 0; i < this.defTableModel.getRowCount(); ++i) { + string = (String)this.defTableModel.getValueAt(i, 0); + bTextDropDown.getList().addItem((Object)string); + if (i != 0) continue; + bTextDropDown.setText(string); + } + BAlarmClassFE bAlarmClassFE = new BAlarmClassFE(); + this.add("fe", (BValue)bAlarmClassFE); + bAlarmClassFE.loadValue((BObject)BString.make((String)"defaultAlarmClass")); + this.remove((BComplex)bAlarmClassFE); + string = new BGridPane(2); + string.add("acLbl", (BValue)new BLabel(lexicon.getText("alarm.alarmClass"))); + string.add("ac", (BValue)bAlarmClassFE); + string.add("defLbl", (BValue)new BLabel(lexicon.getText("alarmClassMapper.definition"))); + string.add("def", (BValue)bTextDropDown); + int n = BDialog.open((BWidget)this, (String)lexicon.getText("commands.mapAlarmClass"), (Object)string, (int)3); + if (n == 2) { + return; + } + try { + String string2 = bAlarmClassFE.saveValue().toString(this.context); + String string3 = bTextDropDown.getText(); + for (int i = 0; i < this.mappingTableModel.getRowCount(); ++i) { + String string4 = (String)this.mappingTableModel.getValueAt(i, 0); + if (!string4.equals(string2)) continue; + this.mappingTableModel.removeRow(i); + this.mappingTableModel.updateTable(); + } + this.mappingTableModel.addRow(new Object[]{string2, BString.make((String)string3)}); + this.mappingTableModel.updateTable(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + protected void deleteAlarmClassMap() { + try { + int n = this.mappingTableModel.getTable().getSelection().getRow(); + if (n < 0) { + return; + } + this.mappingTableModel.removeRow(n); + this.mappingTableModel.updateTable(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + class MappingTableController + extends TableController { + MappingTableController() { + } + + public void mouseReleased(BMouseEvent bMouseEvent) { + super.mouseReleased(bMouseEvent); + if (this.getTable().getSelection().getRowCount() > 0) { + BAlarmClassMappingFE.this.removeMapCommand.setEnabled(true); + } else { + BAlarmClassMappingFE.this.removeMapCommand.setEnabled(false); + } + } + } + + class Controller + extends TableController { + Controller() { + } + + public void mouseReleased(BMouseEvent bMouseEvent) { + super.mouseReleased(bMouseEvent); + if (this.getTable().getSelection().getRowCount() > 0) { + BAlarmClassMappingFE.this.editDefCommand.setEnabled(true); + BAlarmClassMappingFE.this.delDefCommand.setEnabled(true); + } else { + BAlarmClassMappingFE.this.editDefCommand.setEnabled(false); + BAlarmClassMappingFE.this.delDefCommand.setEnabled(false); + } + } + + protected void cellReleased(BMouseEvent bMouseEvent, int n, int n2) { + super.cellReleased(bMouseEvent, n, n2); + if (bMouseEvent.getClickCount() == 2) { + BAlarmClassMappingFE.this.editAlarmClassDef(); + } + } + } + + class MappingTableModel + extends DefaultTableModel { + BAlarmService alarmService = null; + + public MappingTableModel() { + super(new String[]{lexicon.getText("alarmClassMapper.alarmClass"), lexicon.getText("alarmClassMapper.definition")}); + } + + public synchronized Object getValueAt(int n, int n2) { + if (n2 == 0) { + String string = super.getValueAt(n, n2).toString(); + return this.getAlarmService().getAlarmClassDisplayName(BString.make((String)string), null).toString(); + } + return super.getValueAt(n, n2); + } + + public String getAlarmClassName(int n) { + return super.getValueAt(n, 0).toString(); + } + + private BAlarmService getAlarmService() { + if (this.alarmService == null) { + BWbShell bWbShell = BAlarmClassMappingFE.this.getWbShell(); + BOrd bOrd = BOrd.make((BOrd)bWbShell.getActiveOrd(), (String)"service:alarm:AlarmService"); + this.alarmService = (BAlarmService)bOrd.get(); + } + return this.alarmService; + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassSummary.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassSummary.java new file mode 100644 index 0000000..2324514 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmClassSummary.java @@ -0,0 +1,302 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.ui.theme.Theme + * com.tridium.workbench.bql.filter.ColumnNameTableModel + * com.tridium.workbench.util.CollectionTableModel + * javax.baja.collection.BICollection + * javax.baja.collection.BITable + * javax.baja.collection.ColumnList + * javax.baja.gx.BBrush + * javax.baja.naming.BOrd + * javax.baja.nre.util.IntHashMap + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BLink + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BMenu + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.ToggleCommand + * javax.baja.ui.event.BMouseEvent + * javax.baja.ui.table.BTable + * javax.baja.ui.table.DynamicTableModel + * javax.baja.ui.table.TableCellRenderer + * javax.baja.ui.table.TableCellRenderer$Cell + * javax.baja.ui.table.TableController + * javax.baja.ui.table.TableModel + * javax.baja.ui.util.BTitlePane + * javax.baja.util.Lexicon + * javax.baja.workbench.BWbShell + * javax.baja.workbench.view.BWbComponentView + */ +package com.tridium.alarm.ui; + +import com.tridium.ui.theme.Theme; +import com.tridium.workbench.bql.filter.ColumnNameTableModel; +import com.tridium.workbench.util.CollectionTableModel; +import javax.baja.collection.BICollection; +import javax.baja.collection.BITable; +import javax.baja.collection.ColumnList; +import javax.baja.gx.BBrush; +import javax.baja.naming.BOrd; +import javax.baja.nre.util.IntHashMap; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BLink; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BMenu; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.ToggleCommand; +import javax.baja.ui.event.BMouseEvent; +import javax.baja.ui.table.BTable; +import javax.baja.ui.table.DynamicTableModel; +import javax.baja.ui.table.TableCellRenderer; +import javax.baja.ui.table.TableController; +import javax.baja.ui.table.TableModel; +import javax.baja.ui.util.BTitlePane; +import javax.baja.util.Lexicon; +import javax.baja.workbench.BWbShell; +import javax.baja.workbench.view.BWbComponentView; + +public class BAlarmClassSummary +extends BWbComponentView { + public static final Action updateCommands = BAlarmClassSummary.newAction((int)4, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmClassSummary == null ? (class$com$tridium$alarm$ui$BAlarmClassSummary = BAlarmClassSummary.class$("com.tridium.alarm.ui.BAlarmClassSummary")) : class$com$tridium$alarm$ui$BAlarmClassSummary)); + private static final String[] ATTRS = new String[]{"displayName", "totalAlarmCount", "openAlarmCount", "inAlarmCount", "unackedAlarmCount", "timeOfLastAlarm", "ackRequired", "priority", "toPathString"}; + private static final int[] DISPLAY = new int[]{0, 1, 2, 3, 4, 5}; + private static Lexicon lex = Lexicon.make((String)"alarm"); + private BTable table = new BTable(); + private BITable itable; + private CollectionTableModel collectionModel; + private ToggleCommand enableToOffnormal; + private ToggleCommand enableToFault; + private Command editAlarmClass; + private IntHashMap nameMap; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmClassSummary; + + public void updateCommands() { + this.invoke(updateCommands, null, null); + } + + public Type getType() { + return TYPE; + } + + public BAlarmClassSummary() { + this.table.setController((TableController)new Controller()); + this.table.setCellRenderer((TableCellRenderer)new CellRenderer()); + this.setContent((BWidget)BTitlePane.makePane((String)TYPE.getDisplayName(null), (BTable)this.table, (String)lex.getText("alarm.alarmClasses"))); + this.add("selectionLink", (BValue)new BLink((BComponent)this.table, (Slot)BTable.selectionModified, (Slot)updateCommands)); + this.nameMap = new IntHashMap(); + this.nameMap.put(0, (Object)"alarmClass.name"); + this.nameMap.put(1, (Object)"alarmClass.totalAlarmCount"); + this.nameMap.put(2, (Object)"alarmClass.openAlarmCount"); + this.nameMap.put(3, (Object)"alarmClass.inAlarmCount"); + this.nameMap.put(4, (Object)"alarmClass.unackedAlarmCount"); + this.nameMap.put(5, (Object)"alarmClass.timeOfLastAlarm"); + this.nameMap.put(6, (Object)"alarmClass.ackRequired"); + this.nameMap.put(7, (Object)"alarmClass.priority"); + } + + protected void doLoadValue(BObject bObject, Context context) throws Exception { + this.updateTable(); + this.table.fireTableModified(null); + } + + private void updateTable() { + BOrd bOrd = ((BWbShell)this.getShell()).getActiveOrd(); + BOrd bOrd2 = BOrd.make((BOrd)bOrd, (String)this.query()).normalize(); + this.itable = ((BICollection)bOrd2.resolve().get()).toTable(); + boolean bl = false; + int n = -1; + boolean bl2 = true; + if (this.table.getModel() instanceof AlarmClassSummaryTableModel) { + bl = true; + n = ((AlarmClassSummaryTableModel)this.table.getModel()).sortCol; + bl2 = ((AlarmClassSummaryTableModel)this.table.getModel()).sortAsc; + } + this.collectionModel = new CollectionTableModel(this.itable, this.getCurrentContext()); + ColumnNameTableModel columnNameTableModel = new ColumnNameTableModel((TableModel)this.collectionModel, this.nameMap, lex); + AlarmClassSummaryTableModel alarmClassSummaryTableModel = new AlarmClassSummaryTableModel((TableModel)columnNameTableModel, DISPLAY); + alarmClassSummaryTableModel.setColumnShowable(1, false); + alarmClassSummaryTableModel.setColumnShowable(6, false); + if (bl && n != -1) { + alarmClassSummaryTableModel.sortByColumn(n, bl2); + } + this.table.setModel((TableModel)alarmClassSummaryTableModel); + this.table.relayout(); + } + + private String query() { + StringBuffer stringBuffer = new StringBuffer(128); + stringBuffer.append("station:|slot:/|bql:select "); + for (int i = 0; i < ATTRS.length; ++i) { + if (i != 0) { + stringBuffer.append(", "); + } + stringBuffer.append(ATTRS[i]); + } + stringBuffer.append(" from alarm:AlarmClass"); + return stringBuffer.toString(); + } + + public void doUpdateCommands() { + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private class CellRenderer + extends TableCellRenderer { + private CellRenderer() { + } + + public BBrush getBackground(TableCellRenderer.Cell cell) { + if (cell.row == this.getTable().getModel().getRowCount() - 2) { + return Theme.table().getGridBrush(); + } + return null; + } + } + + public class AlarmClassSummaryTableModel + extends DynamicTableModel { + public int sortCol = -1; + public boolean sortAsc = true; + + public AlarmClassSummaryTableModel(TableModel tableModel, int[] nArray) { + super(tableModel, nArray); + } + + public AlarmClassSummaryTableModel(TableModel tableModel) { + super(tableModel); + } + + public void sortByColumn(int n, boolean bl) { + this.sortCol = n; + this.sortAsc = bl; + super.sortByColumn(n, bl); + } + + public Object getValueAt(int n, int n2) { + if (n < super.getRowCount()) { + return super.getValueAt(n, n2); + } + if (n == super.getRowCount()) { + return ""; + } + switch (n2) { + case 0: { + return lex.getText("alarmClass.total"); + } + case 1: + case 2: + case 3: + case 4: { + int n3 = 0; + for (int i = 0; i < super.getRowCount(); ++i) { + n3 += Integer.parseInt((String)this.getValueAt(i, n2)); + } + return "" + n3; + } + } + return ""; + } + + public int getRowCount() { + return super.getRowCount() + 2; + } + } + + public class GotoPoint + extends Goto { + public GotoPoint(int n, BITable bITable) { + super("alarmClass.goto.alarmClass", n, bITable); + } + + public BOrd getTargetOrd() { + return BOrd.make((String)("slot:" + BAlarmClassSummary.this.itable.getString(this.row, BAlarmClassSummary.this.itable.getColumns().get("toPathString")))); + } + } + + public abstract class Goto + extends Command { + int row; + BITable itable; + + public Goto(String string, int n, BITable bITable) { + super((BWidget)BAlarmClassSummary.this, Sys.getModuleForClass((Class)(class$com$tridium$alarm$ui$BAlarmClassSummary == null ? (class$com$tridium$alarm$ui$BAlarmClassSummary = BAlarmClassSummary.class$("com.tridium.alarm.ui.BAlarmClassSummary")) : class$com$tridium$alarm$ui$BAlarmClassSummary)), string); + this.row = n; + this.itable = bITable; + } + + public abstract BOrd getTargetOrd(); + + public CommandArtifact doInvoke() { + BOrd bOrd = this.getTargetOrd(); + if (bOrd == null) { + return null; + } + BOrd bOrd2 = ((BWbShell)BAlarmClassSummary.this.getShell()).getActiveOrd(); + BOrd bOrd3 = BOrd.make((BOrd)bOrd2, (BOrd)bOrd).normalize(); + ((BWbShell)this.getShell()).hyperlink(bOrd3); + return null; + } + } + + private class Controller + extends TableController { + private Controller() { + } + + protected void cellDoubleClicked(BMouseEvent bMouseEvent, int n, int n2) { + if (n >= this.getTable().getModel().getRowCount() - 2) { + return; + } + ColumnList columnList = BAlarmClassSummary.this.itable.getColumns(); + BOrd bOrd = null; + String string = BAlarmClassSummary.this.itable.getString(n, columnList.get("toPathString")); + BOrd bOrd2 = ((BWbShell)this.getShell()).getActiveOrd(); + bOrd = BOrd.make((BOrd)bOrd2, (String)("slot:" + string)).normalize(); + if (bOrd != null) { + ((BWbShell)this.getShell()).hyperlink(bOrd); + } + } + + protected void cellPopup(BMouseEvent bMouseEvent, int n, int n2) { + if (n >= this.getTable().getModel().getRowCount() - 2) { + return; + } + ColumnList columnList = BAlarmClassSummary.this.itable.getColumns(); + String string = BAlarmClassSummary.this.itable.getString(n, columnList.get("toPathString")); + BOrd bOrd = ((BWbShell)this.getShell()).getActiveOrd(); + BOrd bOrd2 = BOrd.make((BOrd)bOrd, (String)("slot:" + string)).normalize(); + BComponent bComponent = (BComponent)bOrd2.get(); + BMenu bMenu = new BMenu(); + bMenu.add(null, (Command)new GotoPoint(n, BAlarmClassSummary.this.itable)); + bMenu.open((BWidget)this.getTable(), bMouseEvent.getX(), bMouseEvent.getY()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmConsole.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmConsole.java new file mode 100644 index 0000000..3e722ee --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmConsole.java @@ -0,0 +1,1821 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.bql.filter.BAbsTimeFilter + * com.tridium.bql.filter.BFilterEntry + * com.tridium.bql.filter.BFilterSet + * com.tridium.bql.util.BDynamicTimeRange + * com.tridium.fox.sys.BFoxClientConnection + * com.tridium.fox.sys.BFoxSession + * com.tridium.ui.BOptionDialog + * com.tridium.ui.UiEnv + * com.tridium.ui.theme.Theme + * com.tridium.workbench.bql.filter.BFilterSetEditor + * com.tridium.workbench.fieldeditors.BDynamicTimeRangeFE + * com.tridium.workbench.fieldeditors.gx.BColorFE + * javax.baja.agent.AgentFilter + * javax.baja.agent.AgentList + * javax.baja.bql.BIBqlFilter + * javax.baja.collection.BICollection + * javax.baja.data.BIDataValue + * javax.baja.file.BAbstractFile + * javax.baja.gx.BBrush + * javax.baja.gx.BColor + * javax.baja.gx.BImage + * javax.baja.gx.Graphics + * javax.baja.gx.IRectGeom + * javax.baja.log.Log + * javax.baja.naming.BLocalHost + * javax.baja.naming.BOrd + * javax.baja.naming.BOrdList + * javax.baja.naming.NullOrdException + * javax.baja.naming.SlotPath + * javax.baja.nre.util.Array + * javax.baja.nre.util.IntHashMap + * javax.baja.nre.util.SortUtil + * javax.baja.sys.Action + * javax.baja.sys.BAbsTime + * javax.baja.sys.BBoolean + * javax.baja.sys.BComplex + * javax.baja.sys.BComponent + * javax.baja.sys.BFacets + * javax.baja.sys.BModule + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.Context + * javax.baja.sys.Cursor + * javax.baja.sys.LocalizableRuntimeException + * javax.baja.sys.ModuleException + * javax.baja.sys.ModuleNotFoundException + * javax.baja.sys.Property + * javax.baja.sys.Slot + * javax.baja.sys.SlotCursor + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BListDropDown + * javax.baja.ui.BMenu + * javax.baja.ui.BSeparator + * javax.baja.ui.BTextDropDown + * javax.baja.ui.BToolBar + * javax.baja.ui.BWidget + * javax.baja.ui.BWidgetShell + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.ToggleCommand + * javax.baja.ui.ToggleCommandGroup + * javax.baja.ui.enums.BHalign + * javax.baja.ui.enums.BOrientation + * javax.baja.ui.enums.BValign + * javax.baja.ui.event.BKeyEvent + * javax.baja.ui.event.BMouseEvent + * javax.baja.ui.list.BList + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.pane.BSplitPane + * javax.baja.ui.pane.BTextEditorPane + * javax.baja.ui.table.BTable + * javax.baja.ui.table.DynamicTableModel + * javax.baja.ui.table.TableCellRenderer + * javax.baja.ui.table.TableCellRenderer$Cell + * javax.baja.ui.table.TableController + * javax.baja.ui.table.TableModel + * javax.baja.ui.table.TableSelection + * javax.baja.ui.util.BTitlePane + * javax.baja.ui.util.UiLexicon + * javax.baja.util.BFormat + * javax.baja.workbench.BWbShell + * javax.baja.workbench.fieldeditor.BWbFieldEditor + * javax.baja.workbench.view.BIExportableTableView + * javax.baja.workbench.view.BWbComponentView + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.BAlarmConsoleChannel; +import com.tridium.alarm.BConsoleRecipient; +import com.tridium.alarm.ui.AlarmTableModel; +import com.tridium.alarm.ui.BAlarmClassDef; +import com.tridium.alarm.ui.BAlarmClassMapping; +import com.tridium.alarm.ui.BAlarmClassMappingFE; +import com.tridium.alarm.ui.BAlarmConsoleOptions; +import com.tridium.alarm.ui.BAlarmConsoleUIChannel; +import com.tridium.alarm.ui.BAlarmDetailsDialog; +import com.tridium.alarm.ui.BAlarmReportDialog; +import com.tridium.alarm.ui.BAlarmTitlePane; +import com.tridium.alarm.ui.BIAlarmServiceView; +import com.tridium.alarm.ui.BNotesDialog; +import com.tridium.alarm.ui.BTimeZoneDisplay; +import com.tridium.alarm.ui.ConsoleColumns; +import com.tridium.alarm.ui.ConsoleTableModel; +import com.tridium.alarm.ui.MediaPlayer; +import com.tridium.alarm.ui.SoundPlayer; +import com.tridium.alarm.ui.SourceTableModel; +import com.tridium.bql.filter.BAbsTimeFilter; +import com.tridium.bql.filter.BFilterEntry; +import com.tridium.bql.filter.BFilterSet; +import com.tridium.bql.util.BDynamicTimeRange; +import com.tridium.fox.sys.BFoxClientConnection; +import com.tridium.fox.sys.BFoxSession; +import com.tridium.ui.BOptionDialog; +import com.tridium.ui.UiEnv; +import com.tridium.ui.theme.Theme; +import com.tridium.workbench.bql.filter.BFilterSetEditor; +import com.tridium.workbench.fieldeditors.BDynamicTimeRangeFE; +import com.tridium.workbench.fieldeditors.gx.BColorFE; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.List; +import java.util.ListIterator; +import java.util.StringTokenizer; +import javax.baja.agent.AgentFilter; +import javax.baja.agent.AgentList; +import javax.baja.alarm.BAckState; +import javax.baja.alarm.BAlarmClass; +import javax.baja.alarm.BAlarmInstructions; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.alarm.BAlarmService; +import javax.baja.alarm.BSourceState; +import javax.baja.bql.BIBqlFilter; +import javax.baja.collection.BICollection; +import javax.baja.data.BIDataValue; +import javax.baja.file.BAbstractFile; +import javax.baja.gx.BBrush; +import javax.baja.gx.BColor; +import javax.baja.gx.BImage; +import javax.baja.gx.Graphics; +import javax.baja.gx.IRectGeom; +import javax.baja.log.Log; +import javax.baja.naming.BLocalHost; +import javax.baja.naming.BOrd; +import javax.baja.naming.BOrdList; +import javax.baja.naming.NullOrdException; +import javax.baja.naming.SlotPath; +import javax.baja.nre.util.Array; +import javax.baja.nre.util.IntHashMap; +import javax.baja.nre.util.SortUtil; +import javax.baja.sys.Action; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BModule; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.Context; +import javax.baja.sys.Cursor; +import javax.baja.sys.LocalizableRuntimeException; +import javax.baja.sys.ModuleException; +import javax.baja.sys.ModuleNotFoundException; +import javax.baja.sys.Property; +import javax.baja.sys.Slot; +import javax.baja.sys.SlotCursor; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BListDropDown; +import javax.baja.ui.BMenu; +import javax.baja.ui.BSeparator; +import javax.baja.ui.BTextDropDown; +import javax.baja.ui.BToolBar; +import javax.baja.ui.BWidget; +import javax.baja.ui.BWidgetShell; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.ToggleCommand; +import javax.baja.ui.ToggleCommandGroup; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.enums.BOrientation; +import javax.baja.ui.enums.BValign; +import javax.baja.ui.event.BKeyEvent; +import javax.baja.ui.event.BMouseEvent; +import javax.baja.ui.list.BList; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.pane.BSplitPane; +import javax.baja.ui.pane.BTextEditorPane; +import javax.baja.ui.table.BTable; +import javax.baja.ui.table.DynamicTableModel; +import javax.baja.ui.table.TableCellRenderer; +import javax.baja.ui.table.TableController; +import javax.baja.ui.table.TableModel; +import javax.baja.ui.table.TableSelection; +import javax.baja.ui.util.BTitlePane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.util.BFormat; +import javax.baja.workbench.BWbShell; +import javax.baja.workbench.fieldeditor.BWbFieldEditor; +import javax.baja.workbench.view.BIExportableTableView; +import javax.baja.workbench.view.BWbComponentView; + +public class BAlarmConsole +extends BWbComponentView +implements SoundPlayer.MediaPlayerListener, +BIExportableTableView, +BIAlarmServiceView { + public static final Property title = BAlarmConsole.newProperty((int)0, (String)new UiLexicon(class$com$tridium$alarm$ui$BAlarmConsole == null ? (class$com$tridium$alarm$ui$BAlarmConsole = BAlarmConsole.class$("com.tridium.alarm.ui.BAlarmConsole")) : class$com$tridium$alarm$ui$BAlarmConsole).getText("alarm.openAlarmSources"), null); + public static final Property showTitle = BAlarmConsole.newProperty((int)0, (BValue)BBoolean.TRUE, null); + public static final Action processAlarm = BAlarmConsole.newAction((int)0, (BValue)new BAlarmRecord(), null); + public static final Action timeRangeModified = BAlarmConsole.newAction((int)0, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmConsole == null ? (class$com$tridium$alarm$ui$BAlarmConsole = BAlarmConsole.class$("com.tridium.alarm.ui.BAlarmConsole")) : class$com$tridium$alarm$ui$BAlarmConsole)); + protected BTable sourceTable; + protected SourceTableModel sourceModel; + protected BTable alarmTable; + protected BList instructions; + protected BSplitPane contentPane; + protected BButton filterBtn; + protected BConsoleRecipient recipient; + protected BAlarmService alarmService; + private List remotelyAcknowledgedAlarms; + private List locallyAcknowledgedAlarms; + private BMenu menu; + private ConsoleColumns columns; + private BGridPane toolBar; + BAlarmTitlePane alarmTitlePane; + protected BDynamicTimeRangeFE timeRangeEd; + protected BDynamicTimeRange timeRange; + protected BAlarmDetailsDialog detailsDlg; + protected BAlarmReportDialog alarmReport; + protected Context ctx; + private static SoundPlayer soundPlayer = UiEnv.get().isMicroEdition() ? new SoundPlayer() : new MediaPlayer(); + Hashtable sounds = new Hashtable(); + protected Command ackCommand; + protected Command ackRecentCommand; + private Command silenceCommand; + private Command urlCommand; + protected Command notesCommand; + private Command filterConfigCommand; + private Command showVideoCmd; + private ToggleCommand soundOnCommand; + private ToggleCommand continuousAlarmCommand; + private Command filterCmd; + private Command alarmClassMappingCommand; + private Command priorityColorsCommand; + protected Command addColumnCommand; + protected Command removeColumnCommand; + protected Command detailsCommand; + protected Command forceClear; + private ToggleCommand sourceTimeCommand; + private ToggleCommand consoleTimeCommand; + public BAlarmConsoleOptions options; + public static final Log logger = Log.getLog((String)"alarm"); + public static final UiLexicon lexicon = new UiLexicon(class$com$tridium$alarm$ui$BAlarmConsole == null ? (class$com$tridium$alarm$ui$BAlarmConsole = BAlarmConsole.class$("com.tridium.alarm.ui.BAlarmConsole")) : class$com$tridium$alarm$ui$BAlarmConsole); + public final BImage lnkImg = BImage.make((String)lexicon.get("commands.hyperlink.icon")); + public final BImage ackImg = BImage.make((String)lexicon.get("commands.acknowledge.icon")); + Object dataMutex = new Object(); + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmConsole; + static /* synthetic */ Class class$javax$baja$alarm$BAlarmRecord; + static /* synthetic */ Class class$java$lang$String; + static /* synthetic */ Class class$javax$baja$sys$BString; + static /* synthetic */ Class class$java$lang$Integer; + static /* synthetic */ Class class$com$tridium$bql$filter$BFilterEntry; + + public String getTitle() { + return this.getString(title); + } + + public void setTitle(String string) { + this.setString(title, string, null); + } + + public boolean getShowTitle() { + return this.getBoolean(showTitle); + } + + public void setShowTitle(boolean bl) { + this.setBoolean(showTitle, bl, null); + } + + public void processAlarm(BAlarmRecord bAlarmRecord) { + this.invoke(processAlarm, (BValue)bAlarmRecord, null); + } + + public void timeRangeModified() { + this.invoke(timeRangeModified, null, null); + } + + public Type getType() { + return TYPE; + } + + public BAlarmConsole() { + Object object; + this.sourceTable = new BTable(); + this.sourceTable.setController((TableController)this.getController()); + this.sourceTable.setCellRenderer((TableCellRenderer)new AlarmTableCellRenderer()); + this.options = this.getDefaultOptions(); + BGridPane bGridPane = new BGridPane(1); + bGridPane.setStretchRow(0); + bGridPane.setStretchColumn(0); + bGridPane.setHalign(BHalign.fill); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setValign(BValign.fill); + bGridPane.setRowAlign(BValign.fill); + this.instructions = new BList(); + bGridPane.add(null, (BValue)new BTitlePane(lexicon.getText("alarm.instructions"), (BWidget)this.instructions)); + this.timeRangeEd = new BDynamicTimeRangeFE(); + this.ackCommand = new Command((BWidget)this, BAlarmConsole.lexicon.module, "commands.acknowledge"){ + + public CommandArtifact doInvoke() { + BAlarmConsole.this.acknowledgeAlarms(BAlarmConsole.this.getSelectedAlarmsDeep(BAlarmConsole.this.sourceTable)); + return null; + } + }; + this.ackCommand.setEnabled(false); + this.ackRecentCommand = new Command((BWidget)this, BAlarmConsole.lexicon.module, "commands.acknowledgeRecent"){ + + public CommandArtifact doInvoke() { + BAlarmConsole.this.acknowledgeAlarms(BAlarmConsole.this.getSelectedAlarms(BAlarmConsole.this.sourceTable)); + return null; + } + }; + this.ackRecentCommand.setEnabled(false); + this.silenceCommand = new Command((BWidget)this, BAlarmConsole.lexicon.module, "commands.silence"){ + + public CommandArtifact doInvoke() { + BAlarmConsole.this.alarmSilenceSelected(); + return null; + } + }; + this.silenceCommand.setEnabled(false); + this.urlCommand = new Command((BWidget)this, BAlarmConsole.lexicon.module, "commands.hyperlink"){ + + public CommandArtifact doInvoke() { + int n = BAlarmConsole.this.sourceTable.getSelection().getRow(); + if (n != -1) { + BAlarmConsole.this.hyperlink(BAlarmConsole.this.sourceModel.getRecord(n)); + } + return null; + } + }; + this.urlCommand.setEnabled(false); + this.notesCommand = new Command((BWidget)this, BAlarmConsole.lexicon.module, "commands.notes"){ + + public CommandArtifact doInvoke() { + BAlarmRecord[] bAlarmRecordArray = BAlarmConsole.this.getSelectedAlarmsDeep(BAlarmConsole.this.sourceTable); + BAlarmConsole.this.showNotes((BWidget)BAlarmConsole.this, bAlarmRecordArray); + return null; + } + }; + this.notesCommand.setEnabled(false); + this.detailsCommand = new Command((BWidget)this, BAlarmConsole.lexicon.module, "commands.details"){ + + public CommandArtifact doInvoke() { + BAlarmConsole.this.showDetailsDialog(BAlarmConsole.this.sourceTable, BAlarmConsole.this.sourceTable.getSelection().getRow()); + return null; + } + }; + this.detailsCommand.setEnabled(false); + this.filterCmd = new Command((BWidget)this, BAlarmConsole.lexicon.module, "commands.filter"){ + + public CommandArtifact doInvoke() { + BAlarmConsole.this.configFilters(); + return null; + } + }; + this.showVideoCmd = new Command((BWidget)this, BAlarmConsole.lexicon.module, "commands.showVideo"){ + + public CommandArtifact doInvoke() { + block8: { + try { + Class clazz = Sys.loadClass((String)"videoDriver", (String)"com.tridium.videoDriver.alarm.AlarmConsoleExt"); + if (clazz != null) { + Method method = clazz.getMethod("doShowVideo", class$com$tridium$alarm$ui$BAlarmConsole == null ? (class$com$tridium$alarm$ui$BAlarmConsole = BAlarmConsole.class$("com.tridium.alarm.ui.BAlarmConsole")) : class$com$tridium$alarm$ui$BAlarmConsole, class$javax$baja$alarm$BAlarmRecord == null ? (class$javax$baja$alarm$BAlarmRecord = BAlarmConsole.class$("javax.baja.alarm.BAlarmRecord")) : class$javax$baja$alarm$BAlarmRecord); + if (method != null) { + int n = BAlarmConsole.this.sourceTable.getSelection().getRow(); + ConsoleTableModel consoleTableModel = (ConsoleTableModel)((DynamicTableModel)BAlarmConsole.this.sourceTable.getModel()).getRootModel(); + BAlarmRecord bAlarmRecord = consoleTableModel.getRecord(n); + method.invoke((Object)clazz, new Object[]{BAlarmConsole.this, bAlarmRecord}); + } else { + System.out.println("The 'doShowVideo' method was not found on class AlarmConsoleExt in videoDriver.jar. Please have my program fixed"); + } + break block8; + } + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound"); + } + catch (ClassNotFoundException classNotFoundException) { + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound", (Throwable)classNotFoundException); + } + catch (NoSuchMethodException noSuchMethodException) { + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound", (Throwable)noSuchMethodException); + } + catch (InvocationTargetException invocationTargetException) { + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound", (Throwable)invocationTargetException); + } + catch (IllegalAccessException illegalAccessException) { + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound", (Throwable)illegalAccessException); + } + } + return null; + } + }; + this.showVideoCmd.setEnabled(false); + this.soundOnCommand = new ToggleCommand((BWidget)this, BAlarmConsole.lexicon.module, "commands.soundOn"){ + + public CommandArtifact doInvoke() { + BAlarmConsole.this.options.setSoundsEnabled(this.isSelected()); + BAlarmConsole.this.options.save(); + return null; + } + }; + this.soundOnCommand.setSelected(this.options.getSoundsEnabled()); + this.continuousAlarmCommand = new ToggleCommand((BWidget)this, BAlarmConsole.lexicon.module, "commands.continuousAlarm"){ + + public CommandArtifact doInvoke() { + BAlarmConsole.this.options.setContinuousAlarm(this.isSelected()); + BAlarmConsole.this.options.save(); + return null; + } + }; + this.continuousAlarmCommand.setSelected(this.options.getContinuousAlarm()); + this.continuousAlarmCommand.setEnabled(this.soundOnCommand.isSelected()); + this.alarmClassMappingCommand = new Command((BWidget)this, BAlarmConsole.lexicon.module, "commands.alarmClassMapping"){ + + public CommandArtifact doInvoke() { + BAlarmClassMapping bAlarmClassMapping = BAlarmConsole.this.options.getAlarmClassMapping(); + BAlarmClassMappingFE bAlarmClassMappingFE = new BAlarmClassMappingFE(); + BAlarmConsole.this.add("temp", (BValue)bAlarmClassMappingFE); + bAlarmClassMappingFE.loadValue((BObject)bAlarmClassMapping); + BOptionDialog bOptionDialog = new BOptionDialog((BWidget)BAlarmConsole.this, "AlarmClassMapper", bAlarmClassMappingFE.createPopup(), 3, (BImage)null, (String)null); + bOptionDialog.setBoundsCenteredOnOwner(); + IRectGeom iRectGeom = bOptionDialog.getScreenBounds(); + bOptionDialog.setScreenBounds(iRectGeom.x(), iRectGeom.y(), 500.0, 400.0); + bOptionDialog.open(); + int n = bOptionDialog.getResult(); + if (n == 1) { + try { + bAlarmClassMapping = (BAlarmClassMapping)bAlarmClassMappingFE.doSaveValue((BObject)bAlarmClassMapping, null); + BAlarmConsole.this.options.setAlarmClassMapping(bAlarmClassMapping); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + BAlarmConsole.this.remove((BComplex)bAlarmClassMappingFE); + return null; + } + }; + this.priorityColorsCommand = new Command((BWidget)this, BAlarmConsole.lexicon.module, "commands.priorityColors"){ + + public CommandArtifact doInvoke() { + BColor bColor = BAlarmConsole.this.options.getLowPriorityColor(); + BColor bColor2 = BAlarmConsole.this.options.getMidPriorityColor(); + BColor bColor3 = BAlarmConsole.this.options.getHighPriorityColor(); + BColorFE bColorFE = new BColorFE(); + bColorFE.loadValue((BObject)bColor); + BColorFE bColorFE2 = new BColorFE(); + bColorFE2.loadValue((BObject)bColor2); + BColorFE bColorFE3 = new BColorFE(); + bColorFE3.loadValue((BObject)bColor3); + BGridPane bGridPane = new BGridPane(2); + bGridPane.add("l1", (BValue)new BLabel("Low Priority Color")); + bGridPane.add("f1", (BValue)bColorFE); + bGridPane.add("l2", (BValue)new BLabel("Mid Priority Color")); + bGridPane.add("f2", (BValue)bColorFE2); + bGridPane.add("l3", (BValue)new BLabel("High Priority Color")); + bGridPane.add("f3", (BValue)bColorFE3); + int n = BDialog.open((BWidget)BAlarmConsole.this, (String)lexicon.getText("commands.priorityColors.label"), (Object)bGridPane, (int)3, (BImage)null); + if (n == 1) { + try { + bColor = (BColor)bColorFE.saveValue((BObject)bColor, null); + bColor2 = (BColor)bColorFE2.saveValue((BObject)bColor2, null); + bColor3 = (BColor)bColorFE3.saveValue((BObject)bColor3, null); + BAlarmConsole.this.options.setLowPriorityColor(bColor); + BAlarmConsole.this.options.setMidPriorityColor(bColor2); + BAlarmConsole.this.options.setHighPriorityColor(bColor3); + } + catch (Exception exception) { + exception.printStackTrace(); + } + ((AlarmTableCellRenderer)BAlarmConsole.this.sourceTable.getCellRenderer()).resetPriorityColors(); + BAlarmConsole.this.repaint(); + } + return null; + } + }; + this.addColumnCommand = new Command((BWidget)this, BAlarmConsole.lexicon.module, "commands.addColumn"){ + + public CommandArtifact doInvoke() { + int n; + BGridPane bGridPane = new BGridPane(2); + bGridPane.add("lbl", (BValue)new BLabel("AlarmData.")); + BTextDropDown bTextDropDown = new BTextDropDown(); + Field[] fieldArray = (class$javax$baja$alarm$BAlarmRecord == null ? (class$javax$baja$alarm$BAlarmRecord = BAlarmConsole.class$("javax.baja.alarm.BAlarmRecord")) : class$javax$baja$alarm$BAlarmRecord).getDeclaredFields(); + Array array = new Array(class$java$lang$String == null ? (class$java$lang$String = BAlarmConsole.class$("java.lang.String")) : class$java$lang$String); + for (int i = 0; i < fieldArray.length; ++i) { + try { + if (!(fieldArray[i].get(null) instanceof String)) continue; + array.add(fieldArray[i].get(null)); + continue; + } + catch (IllegalAccessException illegalAccessException) { + // empty catch block + } + } + Object[] objectArray = (String[])array.trim(); + SortUtil.sort((Object[])objectArray, (Object[])objectArray, (Comparator)new Comparator(){ + + public int compare(Object object, Object object2) { + return object.toString().toLowerCase().compareTo(object2.toString().toLowerCase()); + } + }); + for (n = 0; n < objectArray.length; ++n) { + bTextDropDown.getList().addItem(objectArray[n]); + } + bGridPane.add("dataFacet", (BValue)bTextDropDown); + n = BDialog.open((BWidget)BAlarmConsole.this, (String)lexicon.getText("commands.addColumn.label"), (Object)bGridPane, (int)3, (BImage)null); + if (n == 1) { + try { + String string = bTextDropDown.getText(); + BAlarmConsole.this.columns.addDataColumn(null, string); + for (int i = 0; i < 2; ++i) { + DynamicTableModel dynamicTableModel = null; + if (i == 0) { + dynamicTableModel = (DynamicTableModel)BAlarmConsole.this.sourceTable.getModel(); + } else { + if (BAlarmConsole.this.alarmTable == null) break; + dynamicTableModel = (DynamicTableModel)BAlarmConsole.this.alarmTable.getModel(); + } + dynamicTableModel.setColumnShowable(BAlarmConsole.this.columns.getColumnCount() - 1, true); + dynamicTableModel.setShowColumn(BAlarmConsole.this.columns.getColumnCount() - 1, true); + dynamicTableModel.updateTable(); + } + BAlarmConsole.this.options.getAlarmDataCols().add(SlotPath.escape((String)string), (BValue)BString.make((String)string)); + BAlarmConsole.this.options.save(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + return null; + } + }; + this.removeColumnCommand = new Command((BWidget)this, BAlarmConsole.lexicon.module, "commands.removeColumn"){ + + public CommandArtifact doInvoke() { + int n; + BGridPane bGridPane = new BGridPane(2); + bGridPane.add("lbl", (BValue)new BLabel("AlarmData.")); + ArrayList arrayList = new ArrayList(); + BString[] bStringArray = (BString[])BAlarmConsole.this.options.getAlarmDataCols().getChildren(class$javax$baja$sys$BString == null ? (class$javax$baja$sys$BString = BAlarmConsole.class$("javax.baja.sys.BString")) : class$javax$baja$sys$BString); + BListDropDown bListDropDown = new BListDropDown(); + for (n = 0; n < bStringArray.length; ++n) { + bListDropDown.getList().addItem((Object)bStringArray[n].toString()); + } + bGridPane.add("tf", (BValue)bListDropDown); + n = BDialog.open((BWidget)BAlarmConsole.this, (String)lexicon.getText("commands.removeColumn.label"), (Object)bGridPane, (int)3, (BImage)null); + if (n == 1) { + String string = bListDropDown.getSelectedItem().toString(); + int n2 = BAlarmConsole.this.columns.dataColumnIndex(string); + if (n2 == -1) { + return null; + } + for (int i = 0; i < 2; ++i) { + int n3; + DynamicTableModel dynamicTableModel = null; + if (i == 0) { + dynamicTableModel = (DynamicTableModel)BAlarmConsole.this.sourceTable.getModel(); + } else { + if (BAlarmConsole.this.alarmTable == null) break; + dynamicTableModel = (DynamicTableModel)BAlarmConsole.this.alarmTable.getModel(); + } + boolean[] blArray = new boolean[BAlarmConsole.this.columns.getColumnCount()]; + for (n3 = 0; n3 < blArray.length; ++n3) { + blArray[n3] = dynamicTableModel.showColumn(n3); + } + for (n3 = n2; n3 < blArray.length - 1; ++n3) { + blArray[n3] = blArray[n3 + 1]; + } + blArray[blArray.length - 1] = false; + for (n3 = 0; n3 < blArray.length; ++n3) { + dynamicTableModel.setShowColumn(n3, blArray[n3]); + } + } + BAlarmConsole.this.columns.removeDataColumn(string); + BAlarmConsole.this.options.getAlarmDataCols().remove(SlotPath.escape((String)string)); + BAlarmConsole.this.options.save(); + BAlarmConsole.this.sourceModel.updateTable(); + } + return null; + } + }; + this.forceClear = new Command((BWidget)this, BAlarmConsole.lexicon.module, "commands.forceClear"){ + + public CommandArtifact doInvoke() { + BAlarmRecord[] bAlarmRecordArray = BAlarmConsole.this.getSelectedAlarmsDeep(BAlarmConsole.this.sourceTable); + for (int i = 0; i < bAlarmRecordArray.length; ++i) { + BAlarmRecord bAlarmRecord = (BAlarmRecord)bAlarmRecordArray[i].newCopy(); + bAlarmRecord.setSourceState(BSourceState.normal); + bAlarmRecord.setAckState(BAckState.acked); + bAlarmRecord.addAlarmFacet("forceCleared", (BIDataValue)BString.make((String)BAlarmConsole.this.getUsername(bAlarmRecord))); + if (bAlarmRecord.getAckTime().equals((Object)BAbsTime.NULL)) { + bAlarmRecord.setAckTime(BAbsTime.now()); + } + if (bAlarmRecord.getNormalTime().equals((Object)BAbsTime.NULL)) { + bAlarmRecord.setNormalTime(BAbsTime.now()); + } + try { + BAlarmConsole.this.sendUpdatedAlarm(bAlarmRecord); + BAlarmConsole.this.getAlarmService().auditForceClear(bAlarmRecord); + BAlarmConsole.this.removeAlarm(bAlarmRecord); + continue; + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + return null; + } + }; + this.forceClear.setEnabled(false); + this.columns = this.getConsoleColumns(); + BString[] bStringArray = (BString[])this.options.getAlarmDataCols().getChildren(class$javax$baja$sys$BString == null ? (class$javax$baja$sys$BString = BAlarmConsole.class$("javax.baja.sys.BString")) : class$javax$baja$sys$BString); + for (int i = 0; i < bStringArray.length; ++i) { + this.columns.addDataColumn(null, bStringArray[i].toString()); + } + this.sourceModel = this.makeSourceTableModel(this.columns, this.recipient, null); + this.sourceModel.setInitialSort(this.options.getSortColumn(), this.options.getSortAscending()); + String string = this.options.getDisplayColumns(); + StringTokenizer stringTokenizer = new StringTokenizer(string, ","); + Array array = new Array(class$java$lang$Integer == null ? (class$java$lang$Integer = BAlarmConsole.class$("java.lang.Integer")) : class$java$lang$Integer); + while (stringTokenizer.hasMoreTokens()) { + object = stringTokenizer.nextToken(); + array.add((Object)new Integer((String)object)); + } + object = new int[array.size()]; + for (int i = 0; i < array.size(); ++i) { + object[i] = (Integer)array.get(i); + } + this.sourceTable.setModel((TableModel)new DynamicTableModel((TableModel)this.sourceModel, (int[])object)); + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop((BWidget)this.timeRangeEd); + this.toolBar = this.makeToolBar(); + bEdgePane.setBottom((BWidget)new BBorderPane((BWidget)this.toolBar)); + this.alarmTitlePane = BAlarmTitlePane.makePane(this.getTitle(), this.sourceTable); + bEdgePane.setCenter((BWidget)this.alarmTitlePane); + if (this.options.getViewInstructions()) { + double d = this.options.getInstructionsDividerPosition(); + this.contentPane = new BSplitPane(BOrientation.vertical, d); + this.contentPane.setWidget1((BWidget)bEdgePane); + this.contentPane.setWidget2((BWidget)bGridPane); + this.setContent((BWidget)this.contentPane); + } else { + this.setContent((BWidget)bEdgePane); + } + } + + public BTable getExportTable() { + return this.sourceTable; + } + + public BToolBar getViewToolBar() { + BToolBar bToolBar = new BToolBar(); + bToolBar.add("filter", this.filterCmd); + return bToolBar; + } + + public void changed(Property property, Context context) { + if (property.equals(title) && this.alarmTitlePane != null) { + this.alarmTitlePane.setTitle(this.getTitle()); + } + if (property.equals(showTitle) && this.alarmTitlePane != null) { + this.alarmTitlePane.setTitleVisible(this.getShowTitle()); + } + } + + public void stopped() throws Exception { + super.stopped(); + if (this.channel() != null) { + this.channel().unregister(this.recipient); + this.channel().unregister(this); + } + if (soundPlayer != null) { + soundPlayer.stop(); + soundPlayer.removeListener(this); + } + if (this.contentPane != null) { + this.options.setInstructionsDividerPosition(this.contentPane.getDividerPosition()); + } + DynamicTableModel dynamicTableModel = (DynamicTableModel)this.sourceTable.getModel(); + StringBuffer stringBuffer = new StringBuffer(); + for (int i = 0; i < dynamicTableModel.getRootColumnCount(); ++i) { + if (!dynamicTableModel.showColumn(i)) continue; + stringBuffer.append(i + ","); + } + if (dynamicTableModel.getRootColumnCount() > 0) { + this.options.setDisplayColumns(stringBuffer.toString()); + } + this.options.setSortColumn(this.sourceModel.getLastSortColumn()); + this.options.setSortAscending(this.sourceModel.getLastSortAscending()); + this.options.save(); + } + + public BAlarmConsoleOptions getDefaultOptions() { + return BAlarmConsoleOptions.getDefault(); + } + + public ConsoleColumns getConsoleColumns() { + return new ConsoleColumns(); + } + + protected Controller getController() { + return new Controller(); + } + + protected SourceTableModel makeSourceTableModel(ConsoleColumns consoleColumns, BConsoleRecipient bConsoleRecipient, Context context) { + return new SourceTableModel(consoleColumns, bConsoleRecipient, context); + } + + public void doLoadValue(BObject bObject, Context context) throws Exception { + this.recipient = (BConsoleRecipient)bObject; + this.ctx = context; + this.locallyAcknowledgedAlarms = Collections.synchronizedList(new ArrayList()); + this.remotelyAcknowledgedAlarms = new ArrayList(); + this.sourceTable.setMultipleSelection(true); + BWbShell bWbShell = this.getWbShell(); + if (bWbShell == null) { + bWbShell = this.getShell(); + } + this.sourceTimeCommand = new ToggleCommand((BWidget)this, BAlarmConsole.lexicon.module, "commands.sourceTimeZone"); + this.consoleTimeCommand = new ToggleCommand((BWidget)this, BAlarmConsole.lexicon.module, "commands.consoleTimeZone"); + BTimeZoneDisplay bTimeZoneDisplay = this.options.getTimeZoneDisplay(); + RadioGroup radioGroup = new RadioGroup(); + radioGroup.add(this.sourceTimeCommand); + radioGroup.add(this.consoleTimeCommand); + if (bTimeZoneDisplay == BTimeZoneDisplay.console) { + this.consoleTimeCommand.setSelected(true); + } else { + this.sourceTimeCommand.setSelected(true); + } + this.timeRange = this.recipient.getDefaultTimeRange(); + this.timeRangeEd.loadValue((BObject)this.timeRange); + BFilterSet bFilterSet = this.options.getAlarmFilters(); + BFilterEntry[] bFilterEntryArray = (BFilterEntry[])bFilterSet.getChildren(class$com$tridium$bql$filter$BFilterEntry == null ? (class$com$tridium$bql$filter$BFilterEntry = BAlarmConsole.class$("com.tridium.bql.filter.BFilterEntry")) : class$com$tridium$bql$filter$BFilterEntry); + boolean bl = false; + for (int i = 0; i < bFilterEntryArray.length; ++i) { + if (!bFilterEntryArray[i].getActive()) continue; + bl = true; + break; + } + if (bl) { + this.filterBtn.setImage(BImage.make((String)lexicon.getText("commands.filtered.icon"))); + this.filterBtn.setForeground(BBrush.makeSolid((BColor)BColor.red)); + } + this.linkTo("rangeLink", (BComponent)this.timeRangeEd, (Slot)BWbFieldEditor.setModified, (Slot)timeRangeModified); + if (bWbShell instanceof BWbShell) { + new LoadThread().start(); + } + } + + public BGridPane makeToolBar() { + BGridPane bGridPane = new BGridPane(BAlarmConsole.isVideoDriverAvailable() ? 6 : 5); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + BButton bButton = new BButton(this.ackCommand, true, true); + bGridPane.add("ack", (BValue)bButton); + BButton bButton2 = new BButton(this.urlCommand, true, true); + bGridPane.add("hyp", (BValue)bButton2); + BButton bButton3 = new BButton(this.notesCommand, true, true); + bGridPane.add("notes", (BValue)bButton3); + BButton bButton4 = new BButton(this.silenceCommand, true, true); + bGridPane.add("sil", (BValue)bButton4); + this.filterBtn = new BButton(this.filterCmd, true, true); + bGridPane.add("filter", (BValue)this.filterBtn); + if (BAlarmConsole.isVideoDriverAvailable()) { + BButton bButton5 = new BButton(this.showVideoCmd, true, true); + bGridPane.add("showVideo", (BValue)bButton5); + } + return bGridPane; + } + + public BMenu[] getViewMenus() { + BMenu bMenu = lexicon.buildMenu("menu.alarm.label"); + bMenu.add("acknowledge", this.ackCommand); + bMenu.add("hyperlink", this.urlCommand); + bMenu.add("notes", this.notesCommand); + bMenu.add("deatils", this.detailsCommand); + bMenu.add("silence", this.silenceCommand); + bMenu.add("sep0", (BValue)new BSeparator()); + if (this.getRecipientForAlarm(null) == null || this.getRecipientForAlarm(null).getPermissions(this.ctx).hasAdminWrite() || this.getRecipientForAlarm(null).getPermissions(this.ctx).hasAdminInvoke()) { + bMenu.add("forceClear", this.forceClear); + bMenu.add("sep1", (BValue)new BSeparator()); + } + bMenu.add("soundOn", (Command)this.soundOnCommand); + bMenu.add("continuousAlarm", (Command)this.continuousAlarmCommand); + bMenu.add("acMap", this.alarmClassMappingCommand); + bMenu.add("pColors", this.priorityColorsCommand); + bMenu.add("sep2", (BValue)new BSeparator()); + bMenu.add("sourceTime", (Command)this.sourceTimeCommand); + bMenu.add("consoleTime", (Command)this.consoleTimeCommand); + bMenu.add("sep3", (BValue)new BSeparator()); + bMenu.add("addCol", this.addColumnCommand); + bMenu.add("removeCol", this.removeColumnCommand); + return new BMenu[]{bMenu}; + } + + public void doProcessAlarm(BAlarmRecord bAlarmRecord) { + logger.trace("BAlarmConsole.doProcess(): " + this.recipient.getName() + " got alarm: " + bAlarmRecord.getTimestamp() + " : " + (Object)((Object)bAlarmRecord.getSourceState())); + if (!bAlarmRecord.isOpen()) { + this.removeAlarm(bAlarmRecord); + } else { + BAbsTime bAbsTime = BAbsTime.now(); + BAbsTime bAbsTime2 = this.timeRange.getStartTime(bAbsTime); + BAbsTime bAbsTime3 = this.timeRange.getEndTime(bAbsTime); + if (this.options.getAlarmFilters().accept((BComplex)bAlarmRecord) && (bAbsTime2.isNull() || bAbsTime2.isBefore(bAlarmRecord.getTimestamp())) && (bAbsTime3.isNull() || this.timeRange.getEndTime(bAbsTime).isAfter(bAlarmRecord.getTimestamp()))) { + this.updateAlarm(bAlarmRecord, true); + } else { + this.removeAlarm(bAlarmRecord); + } + } + this.options.setSortColumn(this.sourceModel.getLastSortColumn()); + this.options.setSortAscending(this.sourceModel.getLastSortAscending()); + this.sourceModel.sortByColumn(this.sourceModel.getLastSortColumn(), this.sourceModel.getLastSortAscending()); + ((Controller)this.sourceTable.getController()).enableCommands(); + } + + public void doTimeRangeModified() throws Exception { + this.timeRange = (BDynamicTimeRange)this.timeRangeEd.saveValue(); + BWbShell bWbShell = this.getWbShell(); + if (bWbShell == null) { + bWbShell = this.getShell(); + } + if (bWbShell instanceof BWbShell) { + new LoadThread().start(); + } else { + this.load(); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void acknowledgeAlarms(BAlarmRecord[] bAlarmRecordArray) { + Object object = this.dataMutex; + synchronized (object) { + if (this.options.getNotesRequiredOnAck()) { + BTextDropDown bTextDropDown = new BTextDropDown(false); + BEdgePane bEdgePane = new BEdgePane(); + String string = lexicon.getText("alarm.multipleAlarmNotes"); + if (bAlarmRecordArray.length == 1) { + string = bAlarmRecordArray[0].getAlarmData().get("notes") != null ? bAlarmRecordArray[0].getAlarmData().get("notes").toString() : ""; + } + BTextEditorPane bTextEditorPane = new BTextEditorPane(string.toString(), 12, 80, false); + bEdgePane.setTop((BWidget)bTextEditorPane); + BList bList = bTextDropDown.getList(); + BVector bVector = this.options.getAlarmAckResponses(); + BString[] bStringArray = (BString[])bVector.getChildren(class$javax$baja$sys$BString == null ? (class$javax$baja$sys$BString = BAlarmConsole.class$("javax.baja.sys.BString")) : class$javax$baja$sys$BString); + for (int i = 0; i < bStringArray.length; ++i) { + bList.addItem((Object)BFormat.make((String)bStringArray[i].toString()).format((Object)this)); + } + BEdgePane bEdgePane2 = new BEdgePane(); + if (bList.getItemCount() > 0) { + bEdgePane2.setTop((BWidget)bTextDropDown); + } + BTextEditorPane bTextEditorPane2 = new BTextEditorPane("", 8, 80, true); + bEdgePane2.setCenter((BWidget)bTextEditorPane2); + bEdgePane.setCenter((BWidget)bEdgePane2); + bTextEditorPane2.getEditor().requestFocus(); + int n = BDialog.open((BWidget)this, (String)lexicon.getText("commands.notes.label"), (Object)new BBorderPane((BWidget)bEdgePane), (int)3); + if (n == 2) { + return; + } + String string2 = bTextEditorPane2.getText(); + if (bList.getItemCount() > 0) { + string2 = bTextDropDown.getText() + "\n" + bTextEditorPane2.getText(); + } + for (int i = 0; i < bAlarmRecordArray.length; ++i) { + StringBuffer stringBuffer; + BFacets bFacets = bAlarmRecordArray[i].getAlarmData(); + HashMap hashMap = new HashMap(); + String[] stringArray = bFacets.list(); + for (int j = 0; j < stringArray.length; ++j) { + if (stringArray[j].equals("notes")) continue; + stringBuffer = bFacets.get(stringArray[j]); + hashMap.put(stringArray[j], stringBuffer); + } + String string3 = ""; + if (bFacets.get("notes") != null) { + string3 = bFacets.get("notes").toString(); + } + stringBuffer = new StringBuffer(); + stringBuffer.append("## " + BAbsTime.now() + " - " + this.getUsername(bAlarmRecordArray[i]) + " ##\n"); + stringBuffer.append(string2); + stringBuffer.append("\n\n"); + stringBuffer.append(string3); + hashMap.put("notes", (StringBuffer)BString.make((String)stringBuffer.toString())); + BFacets bFacets2 = BFacets.make(hashMap); + bAlarmRecordArray[i].setAlarmData(bFacets2); + } + } + this.ackAlarms(bAlarmRecordArray); + if (bAlarmRecordArray.length > 1) { + this.sourceTable.getSelection().deselectAll(); + } + } + } + + public void alarmSilenceSelected() { + if (soundPlayer != null) { + soundPlayer.stop(); + } + this.mediaPlayerStopped(); + } + + public void mediaPlayerStopped() { + this.silenceCommand.setEnabled(false); + } + + public void showError(String string, Throwable throwable) { + BDialog.error((BWidget)this, (String)"Error", (Object)string, (Throwable)throwable); + } + + public void showNotes(BWidget bWidget, BAlarmRecord[] bAlarmRecordArray) { + if (bAlarmRecordArray.length == 0) { + return; + } + String string = ""; + if (bAlarmRecordArray.length == 1) { + try { + string = ((BString)bAlarmRecordArray[0].getAlarmData().getFacet("notes")).getString(); + } + catch (Exception exception) {} + } else { + string = lexicon.getText("alarm.multipleAlarmNotes"); + } + BNotesDialog bNotesDialog = new BNotesDialog((BWidget)this, string, this.getUsername(bAlarmRecordArray[0]), this.canModifySelectedAlarms()); + bNotesDialog.setBoundsCenteredOnOwner(); + bNotesDialog.open(); + String string2 = bNotesDialog.getNewNotes(); + for (int i = 0; i < bAlarmRecordArray.length; ++i) { + if (string2 == null) continue; + try { + string = string2 + ((BString)bAlarmRecordArray[i].getAlarmData().getFacet("notes")).getString(); + } + catch (Exception exception) { + string = string2; + } + BFacets bFacets = bAlarmRecordArray[i].getAlarmData(); + HashMap hashMap = new HashMap(); + String[] stringArray = bFacets.list(); + for (int j = 0; j < stringArray.length; ++j) { + if (stringArray[j].equals("notes")) continue; + BObject bObject = bFacets.get(stringArray[j]); + hashMap.put(stringArray[j], bObject); + } + hashMap.put("notes", BString.make((String)string)); + BFacets bFacets2 = BFacets.make(hashMap); + bAlarmRecordArray[i].setAlarmData(bFacets2); + try { + this.sendUpdatedAlarm(bAlarmRecordArray[i]); + continue; + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + } + + protected String getUsername(BAlarmRecord bAlarmRecord) { + BFoxSession bFoxSession = (BFoxSession)this.getCurrentValueSession(); + BFoxClientConnection bFoxClientConnection = bFoxSession.getConnection(); + return bFoxClientConnection.getUsername(); + } + + protected boolean canModifySelectedAlarms() { + return this.canModifySelectedAlarms(this.sourceModel.getSelection()); + } + + protected boolean canModifySelectedAlarms(TableSelection tableSelection) { + if (tableSelection == null || tableSelection.isEmpty()) { + return false; + } + int[] nArray = tableSelection.getRows(); + SourceTableModel sourceTableModel = (SourceTableModel)((DynamicTableModel)this.sourceModel.getModel()).getRootModel(); + BAlarmService bAlarmService = this.getAlarmService(); + for (int i = 0; i < nArray.length; ++i) { + BAlarmRecord bAlarmRecord = sourceTableModel.getRecord(nArray[i]); + BAlarmClass bAlarmClass = bAlarmService.lookupAlarmClass(bAlarmRecord.getAlarmClass()); + if (!(bAlarmClass == null ? !bAlarmService.getDefaultAlarmClass().getPermissions(this.ctx).hasOperatorWrite() : !bAlarmClass.getPermissions(this.ctx).hasOperatorWrite())) continue; + return false; + } + return true; + } + + protected void loadComplete() { + this.exitBusy(); + this.exitBusy(); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void load() { + Object object = this.dataMutex; + synchronized (object) { + this.enterBusy(); + try { + String string; + BAbsTimeFilter bAbsTimeFilter; + BDynamicTimeRange bDynamicTimeRange; + StringBuffer stringBuffer = new StringBuffer(this.channel().getInitialAlarmQuery(this, this.recipient).toString()); + BFilterSet bFilterSet = this.options.getAlarmFilters(); + StringBuffer stringBuffer2 = new StringBuffer(64); + String string2 = bFilterSet.getPredicate(); + if (string2 != null && string2.length() > 0) { + if (stringBuffer2.length() != 0) { + stringBuffer2.append(" and "); + } + stringBuffer2.append(string2); + } + if (stringBuffer2.length() != 0) { + stringBuffer.append(" and ").append(stringBuffer2.toString()); + } + if (!(bDynamicTimeRange = (BDynamicTimeRange)this.timeRangeEd.saveValue()).equals((Object)BDynamicTimeRange.DEFAULT)) { + bAbsTimeFilter = new BAbsTimeFilter(); + bAbsTimeFilter.initFromDynamicTimeRange(bDynamicTimeRange); + string = bAbsTimeFilter.getPredicate(BAlarmRecord.timestamp.getName()); + stringBuffer.append(" and ").append(string.toString()); + } + stringBuffer.append(" order by timestamp desc, "); + if (this.options.getSortColumn() < this.sourceModel.getColumns().getColumnCount()) { + stringBuffer.append(this.sourceModel.getColumns().getColumn(this.options.getSortColumn()).getQueryName()); + } else { + stringBuffer.append(this.sourceModel.getColumns().getColumn(0).getQueryName()); + } + if (this.options.getSortAscending()) { + stringBuffer.append(" asc"); + } else { + stringBuffer.append(" desc"); + } + bAbsTimeFilter = BOrd.make((BOrd)this.getCurrentValueSession().getAbsoluteOrd(), (BOrd)BOrd.make((String)stringBuffer.toString())); + string = (BICollection)bAbsTimeFilter.resolve(this.getCurrentValue()).get(); + Cursor cursor = string.cursor(); + this.sourceModel.clear(); + if (cursor.next()) { + BAlarmRecord bAlarmRecord = (BAlarmRecord)cursor.get(); + if (bAlarmRecord.isOpen()) { + this.sourceModel.update(bAlarmRecord); + this.sourceTable.sizeColumnsToFit(); + } + while (cursor.next()) { + bAlarmRecord = (BAlarmRecord)cursor.get(); + if (bAlarmRecord.getSourceState() == BSourceState.normal && (bAlarmRecord.isAcknowledged() || !bAlarmRecord.getAckRequired())) continue; + this.sourceModel.update(bAlarmRecord, false); + } + this.sourceModel.sortByColumn(this.sourceModel.getLastSortColumn(), this.sourceModel.getLastSortAscending()); + this.sourceModel.updateTable(); + this.sourceTable.sizeColumnsToFit(); + } + for (int i = 0; i < this.sourceModel.getRowCount(); ++i) { + if (!this.sourceModel.getRecord(i).isAlarm()) continue; + this.soundAlarmFor(this.sourceModel.getRecord(i)); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + finally { + this.exitBusy(); + this.loadComplete(); + this.sourceModel.init(this, this.ctx); + this.sourceTable.sizeColumnsToFit(); + this.sourceModel.getTable().fireTableModified(null); + } + } + } + + public void configFilters() { + if (this.sourceTable == null) { + return; + } + SlotCursor slotCursor = this.options.getAlarmFilters().getProperties(); + if (!slotCursor.next(class$com$tridium$bql$filter$BFilterEntry == null ? (class$com$tridium$bql$filter$BFilterEntry = BAlarmConsole.class$("com.tridium.bql.filter.BFilterEntry")) : class$com$tridium$bql$filter$BFilterEntry)) { + this.options.setAlarmFilters(this.buildFilterSet()); + } + BFilterSetEditor bFilterSetEditor = new BFilterSetEditor(); + bFilterSetEditor.loadValue((BObject)this.options.getAlarmFilters()); + BBorderPane bBorderPane = new BBorderPane((BWidget)bFilterSetEditor, 10.0, 10.0, 10.0, 10.0); + if (BDialog.open((BWidget)this, (String)"Filters", (Object)bBorderPane, (int)3) != 2) { + try { + BWbShell bWbShell; + if (bFilterSetEditor.isModified()) { + bWbShell = (BFilterSet)bFilterSetEditor.saveValue(); + this.options.setAlarmFilters((BFilterSet)bWbShell); + BFilterEntry[] bFilterEntryArray = (BFilterEntry[])bWbShell.getChildren(class$com$tridium$bql$filter$BFilterEntry == null ? (class$com$tridium$bql$filter$BFilterEntry = BAlarmConsole.class$("com.tridium.bql.filter.BFilterEntry")) : class$com$tridium$bql$filter$BFilterEntry); + boolean bl = false; + for (int i = 0; i < bFilterEntryArray.length; ++i) { + if (!bFilterEntryArray[i].getActive()) continue; + bl = true; + break; + } + if (bl) { + this.filterBtn.setImage(BImage.make((String)lexicon.getText("commands.filtered.icon"))); + this.filterBtn.setForeground(BBrush.makeSolid((BColor)BColor.red)); + } else { + this.filterBtn.setImage(BImage.make((String)lexicon.getText("commands.filter.icon"))); + this.filterBtn.setForeground(BBrush.NULL); + } + } + if ((bWbShell = this.getWbShell()) == null) { + bWbShell = this.getShell(); + } + if (bWbShell instanceof BWbShell) { + new LoadThread().start(); + } else { + this.load(); + } + } + catch (Exception exception) { + exception.printStackTrace(); + return; + } + } + } + + private BFilterSet buildFilterSet() { + BAlarmRecord bAlarmRecord = new BAlarmRecord(); + BFilterSet bFilterSet = new BFilterSet(); + Property[] propertyArray = bAlarmRecord.getPropertiesArray(); + for (int i = 0; i < propertyArray.length; ++i) { + BValue bValue; + AgentList agentList; + if (propertyArray[i].equals(BAlarmRecord.timestamp) || (agentList = (bValue = bAlarmRecord.get(propertyArray[i])).getAgents().filter(AgentFilter.is((Type)BIBqlFilter.TYPE))).size() == 0) continue; + BIBqlFilter bIBqlFilter = (BIBqlFilter)agentList.getDefault().getInstance(); + bIBqlFilter.init((BObject)bValue); + BFilterEntry bFilterEntry = new BFilterEntry(false, propertyArray[i].getDefaultDisplayName(this.getCurrentContext()), bIBqlFilter); + bFilterSet.add(propertyArray[i].getName(), (BValue)bFilterEntry, 0, bAlarmRecord.getSlotFacets((Slot)propertyArray[i]), null); + } + return bFilterSet; + } + + public void updateAlarm(BAlarmRecord bAlarmRecord, boolean bl) { + logger.trace("BAlarmConsole.alarmCreated(): update alarm: uuid = " + bAlarmRecord.getUuid() + ", priority = " + bAlarmRecord.getPriority()); + BAbsTime bAbsTime = BAbsTime.now(); + BAbsTime bAbsTime2 = this.timeRange.getStartTime(bAbsTime); + BAbsTime bAbsTime3 = this.timeRange.getEndTime(bAbsTime); + if (this.options.getAlarmFilters().accept((BComplex)bAlarmRecord) && (bAbsTime2.isNull() || bAbsTime2.isBefore(bAlarmRecord.getTimestamp())) && (bAbsTime3.isNull() || bAbsTime3.isAfter(bAlarmRecord.getTimestamp()))) { + this.sourceModel.update(bAlarmRecord); + this.sourceTable.sizeColumnsToFit(); + } + if (bl && bAlarmRecord.isAlarm()) { + this.soundAlarmFor(bAlarmRecord); + } else if (bl) { + this.silenceAlarm(bAlarmRecord); + } + } + + public void removeAlarm(BAlarmRecord bAlarmRecord) { + this.sourceModel.remove(bAlarmRecord); + this.silenceAlarm(bAlarmRecord); + if (this.detailsDlg != null && this.detailsDlg.alarm.getUuid().equals((Object)bAlarmRecord.getUuid())) { + this.detailsDlg.alarmCleared(); + } + } + + protected void viewAll() { + int n = this.sourceModel.getSelection().getRow(); + if (n == -1) { + return; + } + BAlarmRecord bAlarmRecord = this.sourceModel.getRecord(n); + BOrdList bOrdList = bAlarmRecord.getSource(); + this.alarmTable = new BTable(); + this.alarmTable.setController((TableController)this.getController()); + this.alarmTable.setCellRenderer((TableCellRenderer)new AlarmTableCellRenderer()); + AlarmTableModel alarmTableModel = this.sourceModel.getModelForSource(bOrdList); + DynamicTableModel dynamicTableModel = new DynamicTableModel((TableModel)alarmTableModel); + DynamicTableModel dynamicTableModel2 = (DynamicTableModel)this.sourceTable.getModel(); + int n2 = this.columns.getColumnCount(); + for (int i = 0; i < n2; ++i) { + dynamicTableModel.setShowColumn(i, dynamicTableModel2.showColumn(i)); + dynamicTableModel.setColumnShowable(i, dynamicTableModel2.isColumnShowable(i)); + } + this.alarmTable.setModel((TableModel)dynamicTableModel); + this.alarmReport = new BAlarmReportDialog(this, bOrdList.toString(), this.alarmTable); + IRectGeom iRectGeom = UiEnv.get().getScreenBounds((BWidget)this); + double d = iRectGeom.x() + (iRectGeom.width() - iRectGeom.width() / 1.3) / 2.0; + double d2 = iRectGeom.y() + (iRectGeom.height() - iRectGeom.height() / 2.0) / 2.0; + this.alarmReport.setPreferredSize(iRectGeom.width() / 1.3, iRectGeom.height() / 2.0); + this.alarmReport.setScreenBounds(d, d2, iRectGeom.width() / 1.3, iRectGeom.height() / 2.0); + this.alarmReport.setVisible(true); + this.alarmReport.open(); + alarmTableModel.close(); + this.alarmTable = null; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public BAlarmRecord[] getSelectedAlarms(BTable bTable) { + Object object = this.dataMutex; + synchronized (object) { + ConsoleTableModel consoleTableModel = (ConsoleTableModel)((DynamicTableModel)bTable.getModel()).getRootModel(); + int[] nArray = bTable.getSelection().getRows(); + BAlarmRecord[] bAlarmRecordArray = new BAlarmRecord[nArray.length]; + ConsoleTableModel consoleTableModel2 = consoleTableModel; + synchronized (consoleTableModel2) { + for (int i = 0; i < nArray.length; ++i) { + bAlarmRecordArray[i] = consoleTableModel.getRecord(nArray[i]); + } + } + return bAlarmRecordArray; + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public BAlarmRecord[] getSelectedAlarmsDeep(BTable bTable) { + ConsoleTableModel consoleTableModel = (ConsoleTableModel)((DynamicTableModel)bTable.getModel()).getRootModel(); + if (!(consoleTableModel instanceof SourceTableModel)) { + return this.getSelectedAlarms(bTable); + } + SourceTableModel sourceTableModel = (SourceTableModel)consoleTableModel; + int[] nArray = bTable.getSelection().getRows(); + Array array = new Array(class$javax$baja$alarm$BAlarmRecord == null ? (class$javax$baja$alarm$BAlarmRecord = BAlarmConsole.class$("javax.baja.alarm.BAlarmRecord")) : class$javax$baja$alarm$BAlarmRecord); + SourceTableModel sourceTableModel2 = sourceTableModel; + synchronized (sourceTableModel2) { + for (int i = 0; i < nArray.length; ++i) { + int n = sourceTableModel.getRecordCount(nArray[i]); + for (int j = 0; j < n; ++j) { + array.add((Object)sourceTableModel.getRecordAt(nArray[i], j)); + } + } + } + return (BAlarmRecord[])array.trim(); + } + + public BAlarmService getAlarmService() { + if (this.alarmService == null) { + BOrd bOrd = this.getCurrentValueSession().getAbsoluteOrd(); + try { + BOrd bOrd2 = BOrd.make((BOrd)bOrd, (String)"service:alarm:AlarmService"); + this.alarmService = (BAlarmService)bOrd2.resolve().get(); + } + catch (Exception exception) { + logger.warning("Unable to Audit Force Clear: Cannot find alarm Service", (Throwable)exception); + } + } + return this.alarmService; + } + + protected boolean alarmLocallyAcknowledged(BAlarmRecord bAlarmRecord) { + ListIterator listIterator = this.locallyAcknowledgedAlarms.listIterator(); + BAlarmRecord bAlarmRecord2 = null; + while (listIterator.hasNext()) { + bAlarmRecord2 = (BAlarmRecord)((Object)listIterator.next()); + if (!bAlarmRecord2.getUuid().equals((Object)bAlarmRecord.getUuid())) continue; + return true; + } + return false; + } + + protected boolean alarmRemotelyAcknowledged(BAlarmRecord bAlarmRecord) { + ListIterator listIterator = this.remotelyAcknowledgedAlarms.listIterator(); + BAlarmRecord bAlarmRecord2 = null; + while (listIterator.hasNext()) { + bAlarmRecord2 = (BAlarmRecord)((Object)listIterator.next()); + if (!bAlarmRecord2.getUuid().equals((Object)bAlarmRecord.getUuid())) continue; + return true; + } + return false; + } + + protected void ackAlarms(BAlarmRecord[] bAlarmRecordArray) { + try { + Array array = new Array(class$javax$baja$alarm$BAlarmRecord == null ? (class$javax$baja$alarm$BAlarmRecord = BAlarmConsole.class$("javax.baja.alarm.BAlarmRecord")) : class$javax$baja$alarm$BAlarmRecord); + for (int i = 0; i < bAlarmRecordArray.length; ++i) { + if (bAlarmRecordArray[i].isAcknowledged()) continue; + BAlarmRecord bAlarmRecord = (BAlarmRecord)bAlarmRecordArray[i].newCopy(); + bAlarmRecord.setUser(this.getUsername(bAlarmRecord)); + bAlarmRecord.setAckTime(BAbsTime.now()); + bAlarmRecord.setAckState(BAckState.ackPending); + this.sourceModel.update(bAlarmRecord); + array.add((Object)bAlarmRecord); + } + this.channel().ackAlarms(this.recipient, (BAlarmRecord[])array.trim()); + this.sourceTable.sizeColumnsToFit(); + this.sourceTable.fireTableModified(null); + if (this.alarmTable != null) { + this.alarmTable.fireTableModified(null); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + public void soundAlarmFor(BAlarmRecord bAlarmRecord) { + if (!this.options.getSoundsEnabled()) { + return; + } + try { + BOrd bOrd = BOrd.NULL; + try { + if (bAlarmRecord.getAlarmData().get("soundFile") != null) { + bOrd = BOrd.make((BOrd)BOrd.toSpace((BObject)this.getRecipientForAlarm(bAlarmRecord)).getNavOrd(), (String)bAlarmRecord.getAlarmData().get("soundFile").toString()); + } + } + catch (NullOrdException nullOrdException) { + // empty catch block + } + if (bOrd == null || bOrd.isNull()) { + BAlarmClassMapping bAlarmClassMapping; + BAlarmClassDef bAlarmClassDef = null; + if (this.options != null && (bAlarmClassMapping = this.options.getAlarmClassMapping()) != null && (bAlarmClassDef = bAlarmClassMapping.getAlarmClassDefFor(bAlarmRecord.getAlarmClass())) != null) { + bOrd = bAlarmClassDef.getAlarmSound(); + } + } + if (bOrd == null || bOrd.isNull()) { + this.soundAlarm(bAlarmRecord); + } else { + this.soundAlarm(bAlarmRecord.getSource(), bOrd); + } + } + catch (Exception exception) { + logger.message("Cannot Sound Alarm: ", (Throwable)exception); + } + } + + public void soundAlarm(BAlarmRecord bAlarmRecord) throws Exception { + if (!this.options.getDefaultSoundFile().isNull()) { + if (this.options.getDefaultSoundFile().relativizeToHost().equals((Object)BLocalHost.INSTANCE.getAbsoluteOrd())) { + this.soundAlarm(bAlarmRecord.getSource(), this.options.getDefaultSoundFile()); + } else if (!BOrd.toSpace((BObject)this.getRecipientForAlarm(bAlarmRecord)).getNavOrd().isNull()) { + this.soundAlarm(bAlarmRecord.getSource(), BOrd.make((BOrd)BOrd.toSpace((BObject)this.getRecipientForAlarm(bAlarmRecord)).getNavOrd(), (String)this.options.getDefaultSoundFile().toString())); + } + } + } + + public void soundAlarm(BOrdList bOrdList, BOrd bOrd) { + try { + if (!this.options.getSoundsEnabled() || bOrd.isNull()) { + return; + } + BAbstractFile bAbstractFile = (BAbstractFile)this.sounds.get(bOrd); + if (bAbstractFile == null) { + bAbstractFile = (BAbstractFile)bOrd.get(); + this.sounds.put(bOrd, bAbstractFile); + } + if (soundPlayer == null) { + soundPlayer = UiEnv.get().isMicroEdition() ? new SoundPlayer() : new MediaPlayer(); + soundPlayer.addMediaObject((BValue)bOrdList, bAbstractFile); + soundPlayer.addListener(this); + } + if (soundPlayer.addMediaObject((BValue)bOrdList, bAbstractFile)) { + soundPlayer.play(this.options.getContinuousAlarm(), this.options.getContinuousAlarmDelay()); + } + this.silenceCommand.setEnabled(true); + } + catch (Exception exception) { + logger.warning("Cannot sound alarm: MediaPlayer exception: " + exception); + } + } + + public void silenceAlarm(BAlarmRecord bAlarmRecord) { + if (!this.options.getSoundsEnabled()) { + return; + } + soundPlayer.removeMediaObject((BValue)bAlarmRecord.getSource()); + if (!soundPlayer.hasMediaObjects()) { + this.silenceCommand.setEnabled(false); + } + } + + public void showDetailsDialog(BTable bTable, int n) { + ConsoleTableModel consoleTableModel = (ConsoleTableModel)((DynamicTableModel)bTable.getModel()).getRootModel(); + this.detailsDlg = new BAlarmDetailsDialog(this, this.options.getTimeZoneDisplay(), consoleTableModel.getRecord(n), consoleTableModel, this.ctx); + this.detailsDlg.setBoundsCenteredOnOwner(); + this.detailsDlg.open(); + } + + protected void hyperlink(BAlarmRecord bAlarmRecord) { + BWbShell bWbShell = this.getWbShell(); + if (bWbShell != null) { + BOrd bOrd = BOrd.NULL; + if (bAlarmRecord.getAlarmData().get("hyperlinkOrd") != null) { + bOrd = BOrd.make((String)bAlarmRecord.getAlarmData().get("hyperlinkOrd").toString()); + } + if (bOrd == null || bOrd.isNull()) { + BAlarmClassMapping bAlarmClassMapping = this.options.getAlarmClassMapping(); + BAlarmClassDef bAlarmClassDef = bAlarmClassMapping.getAlarmClassDefFor(bAlarmRecord.getAlarmClass()); + bOrd = bAlarmClassDef.getAlarmUrl(); + } + if (!bOrd.isNull()) { + bWbShell.hyperlink(bOrd); + if (this.detailsDlg != null) { + this.detailsDlg.close(); + } + if (this.alarmReport != null) { + this.alarmReport.close(); + } + } + } + } + + protected BConsoleRecipient getRecipientForAlarm(BAlarmRecord bAlarmRecord) { + return this.recipient; + } + + public BAlarmService getAlarmService(BAlarmRecord bAlarmRecord) { + return this.getAlarmService(); + } + + protected void sendUpdatedAlarm(BAlarmRecord bAlarmRecord) throws Exception { + this.channel().updateAlarm(bAlarmRecord); + } + + public BAlarmConsoleUIChannel channel() { + return this.channel(this.recipient); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public BAlarmConsoleUIChannel channel(BConsoleRecipient bConsoleRecipient) { + try { + if (bConsoleRecipient.getComponentSpace() == null) { + throw new BajaRuntimeException("Console recipient component space is null."); + } + BFoxSession bFoxSession = (BFoxSession)bConsoleRecipient.getSession(); + if (bFoxSession == null) { + throw new BajaRuntimeException("Console recipient session is null."); + } + BFoxClientConnection bFoxClientConnection = bFoxSession.getConnection(); + if (bFoxSession == null) { + throw new BajaRuntimeException("Console recipient connection is null."); + } + Object object = BAlarmConsoleChannel.channelMutex; + synchronized (object) { + BAlarmConsoleChannel bAlarmConsoleChannel = (BAlarmConsoleChannel)bFoxClientConnection.getChannels().get("alarmui"); + if (bAlarmConsoleChannel == null || !(bAlarmConsoleChannel instanceof BAlarmConsoleUIChannel)) { + if (bAlarmConsoleChannel != null) { + ((BFoxSession)bConsoleRecipient.getSession()).getConnection().getChannels().remove("alarmui"); + } + bAlarmConsoleChannel = new BAlarmConsoleUIChannel(); + ((BFoxSession)bConsoleRecipient.getSession()).getConnection().getChannels().add("alarmui", (BValue)bAlarmConsoleChannel); + } + return (BAlarmConsoleUIChannel)bAlarmConsoleChannel; + } + } + catch (Exception exception) { + exception.printStackTrace(); + return null; + } + } + + static boolean isVideoDriverAvailable() { + BModule bModule = null; + try { + bModule = Sys.loadModule((String)"videoDriver"); + } + catch (ModuleNotFoundException moduleNotFoundException) { + bModule = null; + } + catch (ModuleException moduleException) { + bModule = null; + } + return bModule != null; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public class AlarmTableCellRenderer + extends TableCellRenderer { + IntHashMap priorityColors = new IntHashMap(); + IntHashMap priorityFgColors = new IntHashMap(); + + public void resetPriorityColors() { + this.priorityColors.clear(); + } + + public double getPreferredCellWidth(TableCellRenderer.Cell cell) { + if (this.getTable() == null || this.getTable().getModel() == null) { + return 0.0; + } + if (cell.column == 0) { + return super.getPreferredCellWidth(cell) + 18.0 + 18.0 + 18.0; + } + return super.getPreferredCellWidth(cell); + } + + public void paintCell(Graphics graphics, TableCellRenderer.Cell cell) { + Object object; + Object object2; + TableModel tableModel = this.getTable().getModel(); + this.paintCellBackground(graphics, cell); + double d = 2.0; + double d2 = (cell.height - 16.0) / 2.0; + if (cell.column == 0) { + String string; + object2 = null; + try { + object = (ConsoleTableModel)((DynamicTableModel)this.getTable().getModel()).getRootModel(); + object2 = ((ConsoleTableModel)((Object)object)).getRecord(cell.row); + } + catch (Exception exception) { + return; + } + object = ((BAlarmRecord)((Object)object2)).getAlarmClass(); + BAlarmClassMapping bAlarmClassMapping = BAlarmConsole.this.options.getAlarmClassMapping(); + BAlarmClassDef bAlarmClassDef = bAlarmClassMapping.getAlarmClassDefFor((String)object); + BImage bImage = null; + try { + if (((BAlarmRecord)((Object)object2)).getAlarmData().get("icon") != null && BOrd.make((String)((BAlarmRecord)((Object)object2)).getAlarmData().get("icon").toString()) != BOrd.NULL) { + bImage = BImage.make((BOrd)BOrd.make((BOrd)BOrd.toSpace((BObject)BAlarmConsole.this.getRecipientForAlarm((BAlarmRecord)((Object)object2))).getNavOrd(), (String)((BAlarmRecord)((Object)object2)).getAlarmData().get("icon").toString())); + } else if (bAlarmClassDef != null && bAlarmClassDef.getAlarmIcon() != BOrd.NULL) { + bImage = BImage.make((BOrd)bAlarmClassDef.getAlarmIcon()); + } + } + catch (Exception exception) { + // empty catch block + } + if (bImage != null) { + d2 = (cell.height - bImage.getHeight()) / 2.0; + graphics.drawImage(bImage, d, d2); + } + d += 18.0; + BOrd bOrd = BOrd.NULL; + if (((BAlarmRecord)((Object)object2)).getAlarmData().get("hyperlinkOrd") != null && !BOrd.make((String)((BAlarmRecord)((Object)object2)).getAlarmData().get("hyperlinkOrd").toString()).isNull()) { + bOrd = BOrd.make((String)((BAlarmRecord)((Object)object2)).getAlarmData().get("hyperlinkOrd").toString()); + } else if (bAlarmClassDef != null) { + bOrd = bAlarmClassDef.getAlarmUrl(); + } + if (bOrd != null && !bOrd.isNull() && BAlarmConsole.this.lnkImg != null) { + d2 = (cell.height - BAlarmConsole.this.lnkImg.getHeight()) / 2.0; + graphics.drawImage(BAlarmConsole.this.lnkImg, d, d2); + } + d += 18.0; + String string2 = ((BAlarmRecord)((Object)object2)).getAlarmData().gets("cameraOrd", null); + if (string2 != null && !BOrd.make((String)string2).isNull()) { + string = lexicon.getText("commands.showVideo.icon"); + BImage bImage2 = BImage.make((String)string); + d2 = (cell.height - bImage2.getHeight()) / 2.0; + graphics.drawImage(bImage2, d, d2); + } + d += 18.0; + string = tableModel.getRowIcon(cell.row); + if (string != null) { + d2 = (cell.height - string.getHeight()) / 2.0; + graphics.drawImage((BImage)string, d, d2); + d += 18.0; + } + } + object2 = this.getCellText(cell); + object = Theme.table().getCellFont(); + switch (tableModel.getColumnAlignment(cell.column).getOrdinal()) { + case 2: { + d = cell.width - 2.0 - object.width((String)object2); + break; + } + case 1: { + d = (cell.width - object.width((String)object2)) / 2.0; + } + } + graphics.setFont(Theme.table().getCellFont()); + graphics.drawString((String)object2, d, (cell.height + object.getAscent() - object.getDescent()) / 2.0); + } + + public BBrush getBackground(TableCellRenderer.Cell cell) { + try { + BColor bColor; + DynamicTableModel dynamicTableModel = (DynamicTableModel)this.getTable().getModel(); + BAlarmRecord bAlarmRecord = ((ConsoleTableModel)dynamicTableModel.getRootModel()).getRecord(cell.row); + int n = 0; + if (bAlarmRecord != null) { + n = bAlarmRecord.getPriority(); + } + if ((bColor = (BColor)this.priorityColors.get(n)) != null) { + return BBrush.makeSolid((BColor)bColor); + } + bColor = this.solveSpectrum(n, BAlarmConsole.this.options.getLowPriorityColor(), BAlarmConsole.this.options.getMidPriorityColor(), BAlarmConsole.this.options.getHighPriorityColor()); + this.priorityColors.put(n, (Object)bColor); + return BBrush.makeSolid((BColor)bColor); + } + catch (Exception exception) { + return super.getBackground(cell); + } + } + + private BColor solveSpectrum(int n, BColor bColor, BColor bColor2, BColor bColor3) { + int n2; + int n3; + int n4; + int n5; + float f = 128.0f; + float f2 = n; + float f3 = 128.0f; + if (f2 > f) { + if (f2 > f + f3) { + return bColor; + } + float f4 = (float)(bColor.getRed() - bColor2.getRed()) / f3; + float f5 = (float)bColor2.getRed() - f4 * f; + n5 = (int)(f4 * f2 + f5); + float f6 = (float)(bColor.getGreen() - bColor2.getGreen()) / f3; + float f7 = (float)bColor2.getGreen() - f6 * f; + n4 = (int)(f6 * f2 + f7); + float f8 = (float)(bColor.getBlue() - bColor2.getBlue()) / f3; + float f9 = (float)bColor2.getBlue() - f8 * f; + n3 = (int)(f8 * f2 + f9); + float f10 = (float)(bColor.getAlpha() - bColor2.getAlpha()) / f3; + float f11 = (float)bColor2.getAlpha() - f10 * f; + n2 = (int)(f10 * f2 + f11); + } else { + if (f2 < f - f3) { + return bColor3; + } + float f12 = (float)(bColor2.getRed() - bColor3.getRed()) / f3; + float f13 = (float)bColor2.getRed() - f12 * f; + n5 = (int)(f12 * f2 + f13); + float f14 = (float)(bColor2.getGreen() - bColor3.getGreen()) / f3; + float f15 = (float)bColor2.getGreen() - f14 * f; + n4 = (int)(f14 * f2 + f15); + float f16 = (float)(bColor2.getBlue() - bColor3.getBlue()) / f3; + float f17 = (float)bColor2.getBlue() - f16 * f; + n3 = (int)(f16 * f2 + f17); + float f18 = (float)(bColor2.getAlpha() - bColor3.getAlpha()) / f3; + float f19 = (float)bColor2.getAlpha() - f18 * f; + n2 = (int)(f18 * f2 + f19); + } + return BColor.make((int)n5, (int)n4, (int)n3, (int)n2); + } + } + + protected class Controller + extends TableController { + int lastRowEntered = -1; + + protected Controller() { + } + + public void keyReleased(BKeyEvent bKeyEvent) { + super.keyReleased(bKeyEvent); + this.enableCommands(); + } + + public void mouseReleased(BMouseEvent bMouseEvent) { + super.mouseReleased(bMouseEvent); + this.enableCommands(); + } + + void enableCommands() { + TableSelection tableSelection = this.getTable().getSelection(); + boolean bl = tableSelection.getRows().length > 0 && BAlarmConsole.this.canModifySelectedAlarms(tableSelection); + BAlarmConsole.this.ackCommand.setEnabled(bl); + BAlarmConsole.this.ackRecentCommand.setEnabled(bl); + BAlarmConsole.this.forceClear.setEnabled(bl); + if (tableSelection.getRows().length == 1) { + Object object; + BOrd bOrd; + ConsoleTableModel consoleTableModel = (ConsoleTableModel)((DynamicTableModel)this.getTable().getModel()).getRootModel(); + BAlarmRecord bAlarmRecord = consoleTableModel.getRecord(tableSelection.getRow()); + String string = bAlarmRecord.getAlarmData().gets("cameraOrd", null); + if (string != null) { + bOrd = BOrd.make((String)string); + if (!bOrd.equals((Object)BOrd.NULL)) { + BAlarmConsole.this.showVideoCmd.setEnabled(true); + } else { + BAlarmConsole.this.showVideoCmd.setEnabled(false); + } + } else { + BAlarmConsole.this.showVideoCmd.setEnabled(false); + } + bOrd = (BString)bAlarmRecord.getAlarmData().get("hyperlinkOrd"); + BOrd bOrd2 = BOrd.NULL; + if (bOrd != null) { + bOrd2 = BOrd.make((String)bOrd.toString()); + } + if (bOrd2 == null || bOrd2.isNull()) { + object = BAlarmConsole.this.options.getAlarmClassMapping(); + BAlarmClassDef bAlarmClassDef = ((BAlarmClassMapping)((Object)object)).getAlarmClassDefFor(bAlarmRecord.getAlarmClass()); + bOrd2 = bAlarmClassDef.getAlarmUrl(); + } + if (bOrd2 != null && !bOrd2.isNull()) { + BAlarmConsole.this.urlCommand.setEnabled(true); + } else { + BAlarmConsole.this.urlCommand.setEnabled(false); + } + BAlarmConsole.this.notesCommand.setEnabled(true); + BAlarmConsole.this.detailsCommand.setEnabled(true); + BAlarmConsole.this.instructions.removeAllItems(); + if (bAlarmRecord.getAlarmData().get("instructions") != null && (object = BAlarmInstructions.make(bAlarmRecord.getAlarmData().get("instructions").toString())) != null) { + for (int i = 0; i < ((BAlarmInstructions)((Object)object)).size(); ++i) { + BAlarmConsole.this.instructions.addItem((Object)(i + 1 + ". " + ((BAlarmInstructions)((Object)object)).get(i).format((Object)this))); + } + } + } else { + BAlarmConsole.this.urlCommand.setEnabled(false); + BAlarmConsole.this.notesCommand.setEnabled(false); + BAlarmConsole.this.showVideoCmd.setEnabled(false); + BAlarmConsole.this.detailsCommand.setEnabled(false); + BAlarmConsole.this.instructions.removeAllItems(); + } + } + + protected void cellReleased(BMouseEvent bMouseEvent, int n, int n2) { + super.cellReleased(bMouseEvent, n, n2); + if (bMouseEvent.getClickCount() == 2) { + if (this.getTable() == BAlarmConsole.this.sourceTable) { + BAlarmConsole.this.viewAll(); + } else { + BAlarmConsole.this.showDetailsDialog(this.getTable(), n); + } + } + } + + protected void cellPopup(BMouseEvent bMouseEvent, int n, int n2) { + BTable bTable = this.getTable(); + BMenu bMenu = new BMenu(); + bMenu.add("ack", BAlarmConsole.this.ackCommand); + bMenu.add("ackAll", BAlarmConsole.this.ackRecentCommand); + bMenu.add("url", BAlarmConsole.this.urlCommand); + bMenu.add("notes", BAlarmConsole.this.notesCommand); + bMenu.add("details", BAlarmConsole.this.detailsCommand); + if (BAlarmConsole.this.getRecipientForAlarm(null) == null || BAlarmConsole.this.getRecipientForAlarm(null).getPermissions(BAlarmConsole.this.ctx).hasAdminInvoke() || BAlarmConsole.this.getRecipientForAlarm(null).getPermissions(BAlarmConsole.this.ctx).hasAdminWrite()) { + bMenu.add("forceClear", BAlarmConsole.this.forceClear); + } + bMenu.open((BWidget)bTable, bMouseEvent.getX(), bMouseEvent.getY()); + } + + protected void cellEntered(BMouseEvent bMouseEvent, int n, int n2) { + ConsoleTableModel consoleTableModel = (ConsoleTableModel)((DynamicTableModel)this.getTable().getModel()).getRootModel(); + if (consoleTableModel instanceof SourceTableModel) { + int n3 = ((SourceTableModel)consoleTableModel).getRecordCount(n); + BWidgetShell bWidgetShell = BAlarmConsole.this.getShell(); + if (bWidgetShell != null) { + bWidgetShell.showStatus("" + n3 + " Alarm(s)"); + } + } + } + + protected void cellExited(BMouseEvent bMouseEvent, int n, int n2) { + BWidgetShell bWidgetShell = BAlarmConsole.this.getShell(); + if (bWidgetShell != null) { + bWidgetShell.showStatus(null); + } + } + + public BMenu makeOptionsMenu() { + BMenu bMenu = super.makeOptionsMenu(); + bMenu.add("acSep", (BValue)new BSeparator()); + bMenu.add("addColumn", BAlarmConsole.this.addColumnCommand); + bMenu.add("removeColumn", BAlarmConsole.this.removeColumnCommand); + return bMenu; + } + } + + class RadioGroup + extends ToggleCommandGroup { + RadioGroup() { + } + + protected void selected(ToggleCommand toggleCommand) { + super.selected(toggleCommand); + if (toggleCommand == BAlarmConsole.this.sourceTimeCommand) { + BAlarmConsole.this.options.setTimeZoneDisplay(BTimeZoneDisplay.source); + } else { + BAlarmConsole.this.options.setTimeZoneDisplay(BTimeZoneDisplay.console); + } + BAlarmConsole.this.sourceTable.fireTableModified(null); + } + } + + public class LoadThread + extends Thread { + public LoadThread() { + super("AlarmConsole:LoadThread"); + } + + public void run() { + BAlarmConsole.this.load(); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmConsoleOptions.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmConsoleOptions.java new file mode 100644 index 0000000..9fa9bee --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmConsoleOptions.java @@ -0,0 +1,263 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.bql.filter.BFilterEntry + * com.tridium.bql.filter.BFilterSet + * com.tridium.ui.UiEnv + * com.tridium.ui.theme.Theme + * javax.baja.data.BIDataValue + * javax.baja.gx.BBrush$Solid + * javax.baja.gx.BColor + * javax.baja.naming.BOrd + * javax.baja.sys.BFacets + * javax.baja.sys.BRelTime + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.Property + * javax.baja.sys.Slot + * javax.baja.sys.SlotCursor + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BWidget + * javax.baja.ui.options.BUserOptions + * javax.baja.ui.util.UiLexicon + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.ui.BAlarmClassMapping; +import com.tridium.alarm.ui.BAlarmDataCols; +import com.tridium.alarm.ui.BTimeZoneDisplay; +import com.tridium.bql.filter.BFilterEntry; +import com.tridium.bql.filter.BFilterSet; +import com.tridium.ui.UiEnv; +import com.tridium.ui.theme.Theme; +import javax.baja.data.BIDataValue; +import javax.baja.gx.BBrush; +import javax.baja.gx.BColor; +import javax.baja.naming.BOrd; +import javax.baja.sys.BFacets; +import javax.baja.sys.BRelTime; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.Property; +import javax.baja.sys.Slot; +import javax.baja.sys.SlotCursor; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BWidget; +import javax.baja.ui.options.BUserOptions; +import javax.baja.ui.util.UiLexicon; + +public class BAlarmConsoleOptions +extends BUserOptions { + public static final Property notesRequiredOnAck = BAlarmConsoleOptions.newProperty((int)0, (boolean)false, null); + public static final Property soundsEnabled = BAlarmConsoleOptions.newProperty((int)0, (boolean)true, null); + public static final Property defaultSoundFile = BAlarmConsoleOptions.newProperty((int)0, (BValue)BOrd.make((String)"module://alarm/com/tridium/alarm/ui/sounds/smallBeep.wav"), (BFacets)BFacets.make((String)"targetType", (BIDataValue)BString.make((String)"file:AudioFile"))); + public static final Property continuousAlarm = BAlarmConsoleOptions.newProperty((int)0, (boolean)false, null); + public static final Property continuousAlarmDelay = BAlarmConsoleOptions.newProperty((int)0, (BValue)BRelTime.make((long)10000L), null); + public static final Property alarmFilters = BAlarmConsoleOptions.newProperty((int)4, (BValue)new BFilterSet(), null); + public static final Property lowPriorityColor = BAlarmConsoleOptions.newProperty((int)0, (BValue)((BBrush.Solid)Theme.table().getWindowBackground().getPaint()).getColor(), null); + public static final Property midPriorityColor = BAlarmConsoleOptions.newProperty((int)0, (BValue)((BBrush.Solid)Theme.table().getWindowBackground().getPaint()).getColor(), null); + public static final Property highPriorityColor = BAlarmConsoleOptions.newProperty((int)0, (BValue)((BBrush.Solid)Theme.table().getWindowBackground().getPaint()).getColor(), null); + public static final Property timeZoneDisplay = BAlarmConsoleOptions.newProperty((int)0, (BValue)BTimeZoneDisplay.console, null); + public static final Property displayColumns = BAlarmConsoleOptions.newProperty((int)4, (String)"0,2,3,5,6,7,14", null); + public static final Property sortColumn = BAlarmConsoleOptions.newProperty((int)4, (int)7, null); + public static final Property sortAscending = BAlarmConsoleOptions.newProperty((int)4, (boolean)true, null); + public static final Property alarmDataCols = BAlarmConsoleOptions.newProperty((int)4, (BValue)new BAlarmDataCols(new String[]{"msgText"}), null); + public static final Property alarmClassMapping = BAlarmConsoleOptions.newProperty((int)0, (BValue)new BAlarmClassMapping(), (BFacets)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"alarm:AlarmClassMappingFE"))); + public static final Property alarmAckResponses = BAlarmConsoleOptions.newProperty((int)0, (BValue)new BVector(), (BFacets)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"alarm:StringListFE"))); + public static final Property viewInstructions = BAlarmConsoleOptions.newProperty((int)0, (boolean)false, null); + public static final Property instructionsDividerPosition = BAlarmConsoleOptions.newProperty((int)4, (int)80, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmConsoleOptions == null ? (class$com$tridium$alarm$ui$BAlarmConsoleOptions = BAlarmConsoleOptions.class$("com.tridium.alarm.ui.BAlarmConsoleOptions")) : class$com$tridium$alarm$ui$BAlarmConsoleOptions)); + private static BAlarmConsoleOptions options; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmConsoleOptions; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmConsole; + static /* synthetic */ Class class$com$tridium$bql$filter$BFilterEntry; + + public boolean getNotesRequiredOnAck() { + return this.getBoolean(notesRequiredOnAck); + } + + public void setNotesRequiredOnAck(boolean bl) { + this.setBoolean(notesRequiredOnAck, bl, null); + } + + public boolean getSoundsEnabled() { + return this.getBoolean(soundsEnabled); + } + + public void setSoundsEnabled(boolean bl) { + this.setBoolean(soundsEnabled, bl, null); + } + + public BOrd getDefaultSoundFile() { + return (BOrd)this.get(defaultSoundFile); + } + + public void setDefaultSoundFile(BOrd bOrd) { + this.set(defaultSoundFile, (BValue)bOrd, null); + } + + public boolean getContinuousAlarm() { + return this.getBoolean(continuousAlarm); + } + + public void setContinuousAlarm(boolean bl) { + this.setBoolean(continuousAlarm, bl, null); + } + + public BRelTime getContinuousAlarmDelay() { + return (BRelTime)this.get(continuousAlarmDelay); + } + + public void setContinuousAlarmDelay(BRelTime bRelTime) { + this.set(continuousAlarmDelay, (BValue)bRelTime, null); + } + + public BFilterSet getAlarmFilters() { + return (BFilterSet)this.get(alarmFilters); + } + + public void setAlarmFilters(BFilterSet bFilterSet) { + this.set(alarmFilters, (BValue)bFilterSet, null); + } + + public BColor getLowPriorityColor() { + return (BColor)this.get(lowPriorityColor); + } + + public void setLowPriorityColor(BColor bColor) { + this.set(lowPriorityColor, (BValue)bColor, null); + } + + public BColor getMidPriorityColor() { + return (BColor)this.get(midPriorityColor); + } + + public void setMidPriorityColor(BColor bColor) { + this.set(midPriorityColor, (BValue)bColor, null); + } + + public BColor getHighPriorityColor() { + return (BColor)this.get(highPriorityColor); + } + + public void setHighPriorityColor(BColor bColor) { + this.set(highPriorityColor, (BValue)bColor, null); + } + + public BTimeZoneDisplay getTimeZoneDisplay() { + return (BTimeZoneDisplay)this.get(timeZoneDisplay); + } + + public void setTimeZoneDisplay(BTimeZoneDisplay bTimeZoneDisplay) { + this.set(timeZoneDisplay, (BValue)bTimeZoneDisplay, null); + } + + public String getDisplayColumns() { + return this.getString(displayColumns); + } + + public void setDisplayColumns(String string) { + this.setString(displayColumns, string, null); + } + + public int getSortColumn() { + return this.getInt(sortColumn); + } + + public void setSortColumn(int n) { + this.setInt(sortColumn, n, null); + } + + public boolean getSortAscending() { + return this.getBoolean(sortAscending); + } + + public void setSortAscending(boolean bl) { + this.setBoolean(sortAscending, bl, null); + } + + public BVector getAlarmDataCols() { + return (BVector)this.get(alarmDataCols); + } + + public void setAlarmDataCols(BVector bVector) { + this.set(alarmDataCols, (BValue)bVector, null); + } + + public BAlarmClassMapping getAlarmClassMapping() { + return (BAlarmClassMapping)this.get(alarmClassMapping); + } + + public void setAlarmClassMapping(BAlarmClassMapping bAlarmClassMapping) { + this.set(alarmClassMapping, (BValue)bAlarmClassMapping, null); + } + + public BVector getAlarmAckResponses() { + return (BVector)this.get(alarmAckResponses); + } + + public void setAlarmAckResponses(BVector bVector) { + this.set(alarmAckResponses, (BValue)bVector, null); + } + + public boolean getViewInstructions() { + return this.getBoolean(viewInstructions); + } + + public void setViewInstructions(boolean bl) { + this.setBoolean(viewInstructions, bl, null); + } + + public double getInstructionsDividerPosition() { + return this.getDouble(instructionsDividerPosition); + } + + public void setInstructionsDividerPosition(double d) { + this.setDouble(instructionsDividerPosition, d, null); + } + + public Type getType() { + return TYPE; + } + + public BAlarmConsoleOptions() { + if (UiEnv.get().isMicroEdition()) { + int n = this.getFlags((Slot)defaultSoundFile); + this.setFlags((Slot)defaultSoundFile, n | 4); + } + } + + public static BAlarmConsoleOptions getDefault() { + if (options == null) { + options = BWidget.getApplication() == null ? new BAlarmConsoleOptions() : (BAlarmConsoleOptions)BAlarmConsoleOptions.load((Type)TYPE); + UiLexicon uiLexicon = new UiLexicon(class$com$tridium$alarm$ui$BAlarmConsole == null ? (class$com$tridium$alarm$ui$BAlarmConsole = BAlarmConsoleOptions.class$("com.tridium.alarm.ui.BAlarmConsole")) : class$com$tridium$alarm$ui$BAlarmConsole); + SlotCursor slotCursor = options.getAlarmFilters().getProperties(); + while (slotCursor.next(class$com$tridium$bql$filter$BFilterEntry == null ? BAlarmConsoleOptions.class$("com.tridium.bql.filter.BFilterEntry") : class$com$tridium$bql$filter$BFilterEntry)) { + BFilterEntry bFilterEntry = (BFilterEntry)slotCursor.get(); + bFilterEntry.setLabel(uiLexicon.getText(bFilterEntry.getName())); + } + } + return options; + } + + public void save() { + if (BWidget.getApplication() != null) { + super.save(); + } + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmConsoleToPdf.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmConsoleToPdf.java new file mode 100644 index 0000000..c8b0807 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmConsoleToPdf.java @@ -0,0 +1,294 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.pdf.BPdfFlowPane + * com.tridium.pdf.BWidgetToPdf + * com.tridium.pdf.gx.PdfDocument + * javax.baja.gx.BFont + * javax.baja.gx.Insets + * javax.baja.pdf.BPdfExporter + * javax.baja.pdf.PdfOp + * javax.baja.sys.BAbsTime + * javax.baja.sys.BFacets + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.table.BTable + * javax.baja.ui.table.TableModel + * javax.baja.ui.table.TableSelection + * javax.baja.util.BFormat + * javax.baja.util.Lexicon + * javax.baja.workbench.view.BIWbViewExporter + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.BConsoleRecipient; +import com.tridium.alarm.ui.BAlarmConsole; +import com.tridium.pdf.BPdfFlowPane; +import com.tridium.pdf.BWidgetToPdf; +import com.tridium.pdf.gx.PdfDocument; +import java.util.ArrayList; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.gx.BFont; +import javax.baja.gx.Insets; +import javax.baja.pdf.BPdfExporter; +import javax.baja.pdf.PdfOp; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BFacets; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.table.BTable; +import javax.baja.ui.table.TableModel; +import javax.baja.ui.table.TableSelection; +import javax.baja.util.BFormat; +import javax.baja.util.Lexicon; +import javax.baja.workbench.view.BIWbViewExporter; + +public class BAlarmConsoleToPdf +extends BPdfExporter +implements BIWbViewExporter { + public static final Property showAllColumns = BAlarmConsoleToPdf.newProperty((int)0, (boolean)false, null); + public static final Property showOnlySelectedRows = BAlarmConsoleToPdf.newProperty((int)0, (boolean)false, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmConsoleToPdf == null ? (class$com$tridium$alarm$ui$BAlarmConsoleToPdf = BAlarmConsoleToPdf.class$("com.tridium.alarm.ui.BAlarmConsoleToPdf")) : class$com$tridium$alarm$ui$BAlarmConsoleToPdf)); + private BPdfFlowPane pane; + private PdfDocument doc; + private PdfOp op; + private String msgTxt = null; + private String notesTxt = null; + private boolean showAlarmData = false; + private static Lexicon lex = Lexicon.make((String)"alarm"); + private static final int MAXSTR = 70; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmConsoleToPdf; + + public boolean getShowAllColumns() { + return this.getBoolean(showAllColumns); + } + + public void setShowAllColumns(boolean bl) { + this.setBoolean(showAllColumns, bl, null); + } + + public boolean getShowOnlySelectedRows() { + return this.getBoolean(showOnlySelectedRows); + } + + public void setShowOnlySelectedRows(boolean bl) { + this.setBoolean(showOnlySelectedRows, bl, null); + } + + public Type getType() { + return TYPE; + } + + public void export(PdfOp pdfOp) throws Exception { + this.op = pdfOp; + BAlarmConsole bAlarmConsole = (BAlarmConsole)pdfOp.get(); + TableModel tableModel = bAlarmConsole.sourceTable.getModel(); + TableSelection tableSelection = bAlarmConsole.sourceTable.getController().getSelection(); + BWidgetToPdf bWidgetToPdf = new BWidgetToPdf(); + this.doc = new PdfDocument(pdfOp.getOutputStream(), pdfOp.getWidth(), pdfOp.getHeight()); + this.pane = new BPdfFlowPane(); + this.makeHeader(bAlarmConsole.recipient); + for (int i = 0; i < tableModel.getRowCount(); ++i) { + if (this.getShowOnlySelectedRows() && (!this.getShowOnlySelectedRows() || !tableSelection.isSelected(i))) continue; + this.makeRecord(tableModel, i); + } + this.pane.setupPane(); + bWidgetToPdf.renderDocument((BWidget)this.pane, this.doc, pdfOp); + } + + private void makeHeader(BConsoleRecipient bConsoleRecipient) { + BFont bFont = BFont.make((String)lex.getText("alarmConsoleToPdf.font.reportHeader")); + BFont bFont2 = BFont.make((String)lex.getText("alarmConsoleToPdf.font.normal")); + BLabel bLabel = new BLabel(lex.getText("alarmConsoleToPdf.header") + " " + bConsoleRecipient.getDisplayName((Context)this.op)); + bLabel.setHalign(BHalign.left); + bLabel.setFont(bFont); + this.pane.add(null, (BValue)bLabel); + BLabel bLabel2 = new BLabel(BAbsTime.now().toString((Context)this.op), bFont2, BHalign.left); + this.pane.add(null, (BValue)bLabel2); + } + + private void makeRecord(TableModel tableModel, int n) { + BFacets bFacets; + this.notesTxt = null; + this.msgTxt = null; + BAlarmRecord bAlarmRecord = (BAlarmRecord)((Object)tableModel.getSubject(n)); + StringBuffer stringBuffer = new StringBuffer(); + BString bString = (BString)bAlarmRecord.getAlarmData().get("sourceName"); + if (bString != null && bString != BString.DEFAULT) { + stringBuffer.append(BFormat.make((String)bString.toString((Context)this.op)).format((Object)bAlarmRecord)); + } else { + stringBuffer.append(bAlarmRecord.get(BAlarmRecord.source).toString((Context)this.op)); + } + stringBuffer.append(" - ").append(bAlarmRecord.getSourceState().toString((Context)this.op)).append(" / "); + stringBuffer.append(bAlarmRecord.getAckState().toString((Context)this.op)); + BLabel bLabel = new BLabel(stringBuffer.toString(), BFont.make((String)lex.getText("alarmConsoleToPdf.font.source")), BHalign.left); + bLabel.setImage(tableModel.getRowIcon(n)); + ArrayList arrayList = new ArrayList(); + ArrayList arrayList2 = new ArrayList(); + this.buildColumnsAndValues(arrayList, arrayList2, tableModel, n); + if (this.showAlarmData) { + bFacets = bAlarmRecord.getAlarmData(); + String[] stringArray = bFacets.list(); + arrayList.add(""); + arrayList2.add(""); + for (int i = 0; i < stringArray.length; ++i) { + String string = bFacets.get(stringArray[i]).toString((Context)this.op); + if (stringArray[i].equals("notes")) { + this.notesTxt = string; + continue; + } + arrayList.add("Alarm Data (" + stringArray[i] + ")"); + if (stringArray[i].equals("msgText") && string.length() > 70) { + string = string.substring(0, 68) + "..."; + } + arrayList2.add(string); + } + } + bFacets = new BTable((TableModel)new Model(arrayList, arrayList2)); + this.pane.add(null, (BValue)new BLabel("")); + this.pane.add(null, (BValue)bLabel); + this.pane.add(null, (BValue)bFacets); + if (this.msgTxt != null) { + this.buildMultiLineLabels("Message", this.msgTxt, ' '); + } + if (this.notesTxt != null) { + this.pane.add(null, (BValue)new BLabel("")); + this.buildMultiLineLabels("Note", this.notesTxt, ' '); + } + } + + private void buildColumnsAndValues(ArrayList arrayList, ArrayList arrayList2, TableModel tableModel, int n) { + if (this.getShowAllColumns()) { + String[] stringArray = tableModel.getColumnNames(); + for (int i = 0; i < stringArray.length; ++i) { + String string = stringArray[i]; + if (string.equals("Msg Text")) { + this.msgTxt = tableModel.getRowValues(n)[i].toString(); + if (this.msgTxt.length() > 70 || this.msgTxt.length() == 0) continue; + this.msgTxt = null; + } else if (string.equals("Alarm Data")) { + this.showAlarmData = true; + continue; + } + arrayList.add(string); + arrayList2.add(tableModel.getRowValues(n)[i]); + } + } else { + for (int i = 0; i < tableModel.getColumnCount(); ++i) { + String string = tableModel.getColumnName(i); + if (string.equals("Msg Text")) { + this.msgTxt = tableModel.getValueAt(n, i).toString(); + if (this.msgTxt.length() > 70 || this.msgTxt.length() == 0) continue; + this.msgTxt = null; + } else if (string.equals("Alarm Data")) { + this.showAlarmData = true; + continue; + } + arrayList.add(string); + arrayList2.add(tableModel.getValueAt(n, i)); + } + } + } + + private void buildMultiLineLabels(String string, String string2, char c) { + if (string2 == null || string2.length() == 0) { + return; + } + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(string).append(": ").append(string2); + BLabel[] bLabelArray = this.split(stringBuffer.toString(), c); + for (int i = 0; i < bLabelArray.length; ++i) { + this.pane.add(null, (BValue)bLabelArray[i]); + } + } + + private BLabel[] split(String string, char c) { + BFont bFont = BFont.make((String)lex.getText("alarmConsoleToPdf.font.normal")); + Insets insets = this.doc.getMargins(); + double d = this.doc.getPageSize().width - insets.right; + ArrayList arrayList = new ArrayList(); + String string2 = string; + while (bFont.width(string2) > d) { + int n; + int n2 = string2.indexOf(c, 0); + boolean bl = false; + if (n2 == -1 || bFont.width(string2.substring(0, n2)) > d) { + bl = true; + n = 1; + while (bFont.width(string2.substring(0, n)) < d) { + ++n; + } + n2 = n - 2; + } else { + n = n2; + String string3 = string2.substring(0, n2 + 1); + while (bFont.width(string3) < d && n != -1) { + n2 = n; + n = string2.indexOf(c, n + 1); + string3 = string2.substring(0, n + 1); + } + } + String string4 = string2.substring(0, n2 + 1); + if (bl) { + string4 = string4 + "-"; + } + string2 = string2.substring(n2 + 1); + arrayList.add(new BLabel(string4, bFont, BHalign.left)); + } + arrayList.add(new BLabel(string2, bFont, BHalign.left)); + return arrayList.toArray(new BLabel[arrayList.size()]); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + class Model + extends TableModel { + private String[] cols = new String[]{"Attribute", "Value"}; + private ArrayList names = new ArrayList(); + private ArrayList values = new ArrayList(); + + public Model(ArrayList arrayList, ArrayList arrayList2) { + this.names = arrayList; + this.values = arrayList2; + } + + public int getRowCount() { + return this.names.size(); + } + + public int getColumnCount() { + return this.cols.length; + } + + public String getColumnName(int n) { + return this.cols[n]; + } + + public Object getValueAt(int n, int n2) { + return n2 == 0 ? this.names.get(n) : this.values.get(n); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmConsoleUIChannel.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmConsoleUIChannel.java new file mode 100644 index 0000000..cc2cece --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmConsoleUIChannel.java @@ -0,0 +1,269 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.fox.message.FoxMessage + * com.tridium.fox.message.FoxTuple + * com.tridium.fox.session.FoxRequest + * com.tridium.fox.session.FoxResponse + * com.tridium.fox.session.InvalidCommandException + * javax.baja.naming.BOrd + * javax.baja.naming.BOrdList + * javax.baja.nre.util.Array + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.BAlarmConsoleChannel; +import com.tridium.alarm.BConsoleRecipient; +import com.tridium.alarm.fox.FoxAlarmCodec; +import com.tridium.alarm.ui.BAlarmConsole; +import com.tridium.alarm.ui.portal.BAlarmPortalTool; +import com.tridium.alarm.ui.portal.BPortalAlarmConsole; +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.InvalidCommandException; +import java.io.IOException; +import java.io.InterruptedIOException; +import java.util.HashMap; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.naming.BOrd; +import javax.baja.naming.BOrdList; +import javax.baja.nre.util.Array; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public class BAlarmConsoleUIChannel +extends BAlarmConsoleChannel { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmConsoleUIChannel == null ? (class$com$tridium$alarm$ui$BAlarmConsoleUIChannel = BAlarmConsoleUIChannel.class$("com.tridium.alarm.ui.BAlarmConsoleUIChannel")) : class$com$tridium$alarm$ui$BAlarmConsoleUIChannel)); + private Array recips = new Array(class$java$lang$String == null ? (class$java$lang$String = BAlarmConsoleUIChannel.class$("java.lang.String")) : class$java$lang$String); + private Array consoles = new Array(class$com$tridium$alarm$ui$BAlarmConsole == null ? (class$com$tridium$alarm$ui$BAlarmConsole = BAlarmConsoleUIChannel.class$("com.tridium.alarm.ui.BAlarmConsole")) : class$com$tridium$alarm$ui$BAlarmConsole); + private HashMap recipOrdMap = new HashMap(); + private BAlarmPortalTool tool; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmConsoleUIChannel; + static /* synthetic */ Class class$java$lang$String; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmConsole; + + public Type getType() { + return TYPE; + } + + public BAlarmConsoleUIChannel() { + super("alarmui"); + } + + public FoxResponse process(FoxRequest foxRequest) throws Exception { + String string = foxRequest.command; + if (this.isTraceOn()) { + this.trace("AlarmConsoleChannel: command = " + string); + } + if (string == "new") { + return this.newAlarms(foxRequest); + } + if (string == "error") { + return this.error(foxRequest); + } + throw new InvalidCommandException(string); + } + + private FoxResponse newAlarms(FoxRequest foxRequest) { + if (this.isTraceOn()) { + this.trace("recieved: new"); + foxRequest.dump(); + } + FoxTuple[] foxTupleArray = foxRequest.list("alarmRec"); + for (int i = 0; i < foxTupleArray.length; ++i) { + try { + BAlarmRecord bAlarmRecord = FoxAlarmCodec.decodeAlarm(((FoxMessage)foxTupleArray[i]).getMessage("alarm")); + String string = ((FoxMessage)foxTupleArray[i]).getString("ord"); + BAlarmConsole[] bAlarmConsoleArray = this.getConsolesRegisteredOn(string); + for (int j = 0; j < bAlarmConsoleArray.length; ++j) { + BOrd bOrd; + BAlarmRecord bAlarmRecord2; + BOrdList bOrdList; + if (bAlarmConsoleArray[j] == null) { + bOrdList = bAlarmRecord.getSource(); + bAlarmRecord2 = (BAlarmRecord)bAlarmRecord.newCopy(); + bOrd = (BOrd)this.recipOrdMap.get(string); + if (bOrd == null) continue; + bOrdList = BOrdList.add((BOrdList)bOrdList, (BOrd)bOrd); + bAlarmRecord2.setSource(bOrdList); + this.tool.processAlarm(bAlarmRecord2); + continue; + } + if (bAlarmConsoleArray[j] instanceof BPortalAlarmConsole) { + bOrdList = bAlarmRecord.getSource(); + bAlarmRecord2 = (BAlarmRecord)bAlarmRecord.newCopy(); + bOrd = (BOrd)this.recipOrdMap.get(string); + if (bOrd == null) continue; + bOrdList = BOrdList.add((BOrdList)bOrdList, (BOrd)bOrd); + bAlarmRecord2.setSource(bOrdList); + bAlarmConsoleArray[j].processAlarm(bAlarmRecord2); + continue; + } + bAlarmConsoleArray[j].processAlarm(bAlarmRecord); + } + continue; + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + return null; + } + + public void ackAlarms(BConsoleRecipient bConsoleRecipient, BAlarmRecord[] bAlarmRecordArray) throws Exception { + int n; + int n2 = 100; + int n3 = 0; + int n4 = n = n2 < bAlarmRecordArray.length ? n2 : bAlarmRecordArray.length; + while (n3 < bAlarmRecordArray.length) { + int n5; + FoxRequest foxRequest = this.makeRequest("ack"); + foxRequest.add("ord", bConsoleRecipient.getOrdInSession().encodeToString()); + int n6 = 0; + for (n5 = n3; n5 < n; ++n5) { + ++n6; + foxRequest.add("alarm", FoxAlarmCodec.encodeAlarm(bAlarmRecordArray[n5])); + } + if (this.isTraceOn()) { + this.trace("sending: ack"); + } + n5 = foxRequest.list("alarm").length; + this.sendAsync(foxRequest); + n3 = n; + n = (n += n2) < bAlarmRecordArray.length ? n : bAlarmRecordArray.length; + } + } + + public String getInitialAlarmQuery(BAlarmConsole bAlarmConsole, BConsoleRecipient bConsoleRecipient) throws Exception { + return this.getInitialAlarmQuery(bAlarmConsole, bConsoleRecipient, BOrd.NULL); + } + + public String getInitialAlarmQuery(BAlarmPortalTool bAlarmPortalTool, BConsoleRecipient bConsoleRecipient) throws Exception { + this.tool = bAlarmPortalTool; + return this.getInitialAlarmQuery(null, bConsoleRecipient, BOrd.NULL); + } + + public String getInitialAlarmQuery(BAlarmConsole bAlarmConsole, BConsoleRecipient bConsoleRecipient, BOrd bOrd) throws Exception { + FoxRequest foxRequest = this.makeRequest("getInitialAlarmQuery"); + String string = bConsoleRecipient.getOrdInSession().encodeToString(); + foxRequest.add("ord", string); + if (bOrd != null && !bOrd.isNull()) { + this.recipOrdMap.put(string, bOrd); + } + try { + FoxResponse foxResponse = this.sendSync(foxRequest); + String string2 = foxResponse.getString("error", null); + if (string2 != null) { + throw new Exception(string2); + } + this.register(bAlarmConsole, string); + return foxResponse.getString("query"); + } + catch (InterruptedIOException interruptedIOException) { + } + catch (IOException iOException) { + // empty catch block + } + return ""; + } + + private FoxResponse error(FoxRequest foxRequest) { + try { + String string = foxRequest.getString("msg"); + Exception exception = new Exception(foxRequest.getString("error")); + String string2 = foxRequest.getString("ord"); + BAlarmConsole[] bAlarmConsoleArray = this.getConsolesRegisteredOn(string2); + for (int i = 0; i < bAlarmConsoleArray.length; ++i) { + if (bAlarmConsoleArray[i] == null) continue; + bAlarmConsoleArray[i].showError(string, exception); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + return null; + } + + public void unregister(BConsoleRecipient bConsoleRecipient) throws Exception { + FoxRequest foxRequest = this.makeRequest("unregister"); + String string = bConsoleRecipient.getOrdInSession().encodeToString(); + foxRequest.add("ord", string); + try { + FoxResponse foxResponse = this.sendSync(foxRequest); + String string2 = foxResponse.getString("error", null); + if (string2 != null) { + throw new Exception(string2); + } + } + catch (InterruptedIOException interruptedIOException) { + } + catch (IOException iOException) { + // empty catch block + } + } + + public void updateAlarm(BAlarmRecord bAlarmRecord) throws Exception { + FoxRequest foxRequest = this.makeRequest("updateAlarm"); + foxRequest.add("alarm", FoxAlarmCodec.encodeAlarm(bAlarmRecord)); + if (this.isTraceOn()) { + this.trace("sending: update : timestamp: " + bAlarmRecord.getTimestamp()); + this.trace(" source: " + bAlarmRecord.getSource().encodeToString()); + } + try { + FoxResponse foxResponse = this.sendSync(foxRequest); + String string = foxResponse.getString("error", null); + if (string != null) { + throw new Exception(string); + } + } + catch (InterruptedIOException interruptedIOException) { + } + catch (IOException iOException) { + } + catch (Exception exception) { + throw exception; + } + } + + private void register(BAlarmConsole bAlarmConsole, String string) { + this.recips.add((Object)string); + this.consoles.add((Object)bAlarmConsole); + } + + public void unregister(BAlarmConsole bAlarmConsole) { + int n = this.consoles.indexOf((Object)bAlarmConsole); + if (n < 0) { + return; + } + if (this.consoles.size() > n) { + this.consoles.remove(n); + } + if (this.recips.size() > n) { + this.recips.remove(n); + } + } + + private BAlarmConsole[] getConsolesRegisteredOn(String string) { + Array array = new Array(class$com$tridium$alarm$ui$BAlarmConsole == null ? (class$com$tridium$alarm$ui$BAlarmConsole = BAlarmConsoleUIChannel.class$("com.tridium.alarm.ui.BAlarmConsole")) : class$com$tridium$alarm$ui$BAlarmConsole); + for (int i = 0; i < this.recips.size(); ++i) { + if (!this.recips.get(i).equals(string)) continue; + array.add(this.consoles.get(i)); + } + return (BAlarmConsole[])array.trim(); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmDataCols.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmDataCols.java new file mode 100644 index 0000000..45ca0c8 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmDataCols.java @@ -0,0 +1,46 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.alarm.ui; + +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public class BAlarmDataCols +extends BVector { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmDataCols == null ? (class$com$tridium$alarm$ui$BAlarmDataCols = BAlarmDataCols.class$("com.tridium.alarm.ui.BAlarmDataCols")) : class$com$tridium$alarm$ui$BAlarmDataCols)); + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmDataCols; + + public BAlarmDataCols() { + } + + public BAlarmDataCols(String[] stringArray) { + for (int i = 0; i < stringArray.length; ++i) { + this.add(stringArray[i], (BValue)BString.make((String)stringArray[i])); + } + } + + public Type getType() { + return TYPE; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmDbMaintenance.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmDbMaintenance.java new file mode 100644 index 0000000..15e6025 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmDbMaintenance.java @@ -0,0 +1,252 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BAbsTime + * javax.baja.sys.BMonth + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.Clock + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BRadioButton + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.ToggleCommand + * javax.baja.ui.ToggleCommandGroup + * javax.baja.ui.enums.BHalign + * javax.baja.ui.enums.BValign + * javax.baja.ui.event.BMouseEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BFlowPane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.table.TableController + * javax.baja.util.Lexicon + * javax.baja.workbench.BWbEditor + * javax.baja.workbench.fieldeditor.BWbFieldEditor + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.ui.BAlarmDbView; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BMonth; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Clock; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BRadioButton; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.ToggleCommand; +import javax.baja.ui.ToggleCommandGroup; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.enums.BValign; +import javax.baja.ui.event.BMouseEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BFlowPane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.table.TableController; +import javax.baja.util.Lexicon; +import javax.baja.workbench.BWbEditor; +import javax.baja.workbench.fieldeditor.BWbFieldEditor; + +public class BAlarmDbMaintenance +extends BAlarmDbView { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmDbMaintenance == null ? (class$com$tridium$alarm$ui$BAlarmDbMaintenance = BAlarmDbMaintenance.class$("com.tridium.alarm.ui.BAlarmDbMaintenance")) : class$com$tridium$alarm$ui$BAlarmDbMaintenance)); + private static Lexicon lex = Lexicon.make((String)"alarm"); + private ToggleCommand clearRecordsBeforeSelected; + private ToggleCommand clearAllRecords; + private ToggleCommand clearOldRecords; + private Command runMaintenance; + private BWbEditor dateEditor; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmDbMaintenance; + + public Type getType() { + return TYPE; + } + + public void doLoadValue(BObject bObject, Context context) { + super.doLoadValue(bObject, context); + BWidget bWidget = this.getContent(); + this.setContent((BWidget)new BLabel("")); + BGridPane bGridPane = new BGridPane(2); + bGridPane.setHalign(BHalign.left); + bGridPane.setValign(BValign.top); + OptionGroup optionGroup = new OptionGroup(); + this.clearOldRecords = new ClearOldRecords(); + optionGroup.add(this.clearOldRecords); + bGridPane.add("clearOld", (BValue)new BRadioButton(this.clearOldRecords)); + this.dateEditor = BWbFieldEditor.makeFor((BObject)BAbsTime.DEFAULT); + BAbsTime bAbsTime = Clock.time(); + BAbsTime bAbsTime2 = BAbsTime.make((int)(bAbsTime.getYear() - 5), (BMonth)bAbsTime.getMonth(), (int)bAbsTime.getDay()); + this.dateEditor.loadValue((BObject)bAbsTime2); + BFlowPane bFlowPane = new BFlowPane(); + bFlowPane.add("before", (BValue)new BLabel(lex.getText("before"))); + bFlowPane.add("dateEditor", (BValue)this.dateEditor); + bGridPane.add("date", (BValue)new BBorderPane((BWidget)bFlowPane, 0.0, 0.0, 0.0, 10.0)); + this.clearRecordsBeforeSelected = new ClearRecordsBeforeSelected(); + optionGroup.add(this.clearRecordsBeforeSelected); + bGridPane.add("clearBeforeSelected", (BValue)new BRadioButton(this.clearRecordsBeforeSelected)); + bGridPane.add(null, (BValue)new BLabel("")); + this.clearAllRecords = new ClearAllRecords(); + optionGroup.add(this.clearAllRecords); + bGridPane.add("clearAll", (BValue)new BRadioButton(this.clearAllRecords)); + bGridPane.add(null, (BValue)new BLabel("")); + this.runMaintenance = new RunMaintenance(); + BButton bButton = new BButton(this.runMaintenance); + BGridPane bGridPane2 = new BGridPane(1); + bGridPane2.add("run", (BValue)bButton); + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setCenter((BWidget)new BBorderPane((BWidget)bGridPane)); + bEdgePane.setBottom((BWidget)bGridPane2); + BEdgePane bEdgePane2 = new BEdgePane(); + bEdgePane2.setCenter(bWidget); + bEdgePane2.setBottom((BWidget)bEdgePane); + this.setContent((BWidget)bEdgePane2); + this.query(); + } + + public void runMaintenance() { + try { + if (this.clearAllRecords.isSelected()) { + String string; + String string2 = lex.getText("confirmClear.title"); + if (BDialog.confirm((BWidget)this, (String)string2, (Object)(string = lex.getText("confirmClear"))) != 4) { + return; + } + } else if (this.clearRecordsBeforeSelected.isSelected()) { + int n = this.table.getSelection().getRow(); + if (n == -1) { + BDialog.error((BWidget)this, (String)lex.getText("confirmClear.title"), (Object)lex.getText("alarm.noRecordSelected")); + } else { + String string; + BAbsTime bAbsTime = this.model.getRecord(n).getTimestamp(); + String string3 = lex.getText("confirmClear.title"); + if (BDialog.confirm((BWidget)this, (String)string3, (Object)(string = lex.getText("confirmClear"))) != 4) { + return; + } + } + } else if (this.clearOldRecords.isSelected()) { + BAbsTime bAbsTime = (BAbsTime)this.dateEditor.saveValue(); + String string = lex.getText("confirmClear.title"); + String string4 = lex.getText("confirmClear.before", new Object[]{bAbsTime.toString()}); + if (BDialog.confirm((BWidget)this, (String)string, (Object)string4) != 4) { + return; + } + } + this.query(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + new MaintenanceThread().start(); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + class Controller + extends TableController { + Controller() { + } + + protected void cellReleased(BMouseEvent bMouseEvent, int n, int n2) { + super.cellReleased(bMouseEvent, n, n2); + if (bMouseEvent.getClickCount() == 2) { + BAlarmDbMaintenance.this.showDetailsDialog(BAlarmDbMaintenance.this.model.getRecord(n)); + } + } + } + + private class RunMaintenance + extends Command { + public RunMaintenance() { + super((BWidget)BAlarmDbMaintenance.this, Sys.getModuleForClass((Class)(class$com$tridium$alarm$ui$BAlarmDbMaintenance == null ? (class$com$tridium$alarm$ui$BAlarmDbMaintenance = BAlarmDbMaintenance.class$("com.tridium.alarm.ui.BAlarmDbMaintenance")) : class$com$tridium$alarm$ui$BAlarmDbMaintenance)), "command.runMaintenance"); + } + + public CommandArtifact doInvoke() { + BAlarmDbMaintenance.this.runMaintenance(); + return null; + } + } + + private class ClearOldRecords + extends ToggleCommand { + public ClearOldRecords() { + super((BWidget)BAlarmDbMaintenance.this, Sys.getModuleForClass((Class)(class$com$tridium$alarm$ui$BAlarmDbMaintenance == null ? (class$com$tridium$alarm$ui$BAlarmDbMaintenance = BAlarmDbMaintenance.class$("com.tridium.alarm.ui.BAlarmDbMaintenance")) : class$com$tridium$alarm$ui$BAlarmDbMaintenance)), "command.clearOldRecords"); + } + } + + private class ClearRecordsBeforeSelected + extends ToggleCommand { + public ClearRecordsBeforeSelected() { + super((BWidget)BAlarmDbMaintenance.this, Sys.getModuleForClass((Class)(class$com$tridium$alarm$ui$BAlarmDbMaintenance == null ? (class$com$tridium$alarm$ui$BAlarmDbMaintenance = BAlarmDbMaintenance.class$("com.tridium.alarm.ui.BAlarmDbMaintenance")) : class$com$tridium$alarm$ui$BAlarmDbMaintenance)), "command.clearRecordsBeforeSelected"); + } + } + + private class ClearAllRecords + extends ToggleCommand { + public ClearAllRecords() { + super((BWidget)BAlarmDbMaintenance.this, Sys.getModuleForClass((Class)(class$com$tridium$alarm$ui$BAlarmDbMaintenance == null ? (class$com$tridium$alarm$ui$BAlarmDbMaintenance = BAlarmDbMaintenance.class$("com.tridium.alarm.ui.BAlarmDbMaintenance")) : class$com$tridium$alarm$ui$BAlarmDbMaintenance)), "command.clearAllRecords"); + } + } + + private class OptionGroup + extends ToggleCommandGroup { + private OptionGroup() { + } + + public void selected(ToggleCommand toggleCommand) { + if (BAlarmDbMaintenance.this.dateEditor != null) { + BAlarmDbMaintenance.this.dateEditor.setReadonly(toggleCommand != BAlarmDbMaintenance.this.clearOldRecords); + } + } + } + + private class MaintenanceThread + extends Thread { + public void run() { + BAlarmDbMaintenance.this.enterBusy(); + try { + if (BAlarmDbMaintenance.this.clearAllRecords.isSelected()) { + BAlarmDbMaintenance.this.getAlarmDbChannel().clearAllRecords(); + } else if (BAlarmDbMaintenance.this.clearRecordsBeforeSelected.isSelected()) { + int n = BAlarmDbMaintenance.this.table.getSelection().getRow(); + BAbsTime bAbsTime = BAlarmDbMaintenance.this.model.getRecord(n).getTimestamp(); + BAlarmDbMaintenance.this.getAlarmDbChannel().clearOldRecords(bAbsTime); + BAlarmDbMaintenance.this.model.getSelection().deselectAll(); + } else if (BAlarmDbMaintenance.this.clearOldRecords.isSelected()) { + BAbsTime bAbsTime = (BAbsTime)BAlarmDbMaintenance.this.dateEditor.saveValue(); + BAlarmDbMaintenance.this.getAlarmDbChannel().clearOldRecords(bAbsTime); + } + BAlarmDbMaintenance.this.query(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + finally { + BAlarmDbMaintenance.this.exitBusy(); + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmDbView.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmDbView.java new file mode 100644 index 0000000..5d78676 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmDbView.java @@ -0,0 +1,584 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.bql.filter.BAbsTimeFilter + * com.tridium.bql.filter.BFilterEntry + * com.tridium.bql.filter.BFilterSet + * com.tridium.bql.util.BDynamicTimeRange + * com.tridium.fox.sys.BFoxClientConnection + * com.tridium.fox.sys.BFoxSession + * com.tridium.workbench.bql.filter.BFilterSetEditor + * com.tridium.workbench.fieldeditors.BDynamicTimeRangeFE + * com.tridium.workbench.fieldeditors.BFrozenEnumFE + * javax.baja.agent.AgentFilter + * javax.baja.agent.AgentList + * javax.baja.bql.BIBqlFilter + * javax.baja.bql.BqlQuery + * javax.baja.collection.BICollection + * javax.baja.gx.BImage + * javax.baja.naming.BOrd + * javax.baja.naming.SlotPath + * javax.baja.nre.util.Array + * javax.baja.sys.Action + * javax.baja.sys.BComplex + * javax.baja.sys.BComponent + * javax.baja.sys.BFacets + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BMenu + * javax.baja.ui.BSeparator + * javax.baja.ui.BTextDropDown + * javax.baja.ui.BTextField + * javax.baja.ui.BToolBar + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BMouseEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.table.BTable + * javax.baja.ui.table.DynamicTableModel + * javax.baja.ui.table.TableController + * javax.baja.ui.table.TableModel + * javax.baja.ui.util.BTitlePane + * javax.baja.ui.util.UiLexicon + * javax.baja.workbench.BWbShell + * javax.baja.workbench.fieldeditor.BWbFieldEditor + * javax.baja.workbench.view.BWbComponentView + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.fox.BAlarmDbChannel; +import com.tridium.alarm.ui.AlarmDbTableModel; +import com.tridium.alarm.ui.BAlarmConsoleOptions; +import com.tridium.alarm.ui.BAlarmDetailsDialog; +import com.tridium.alarm.ui.BIAlarmServiceView; +import com.tridium.alarm.ui.BNotesDialog; +import com.tridium.alarm.ui.BTimeZoneDisplay; +import com.tridium.alarm.ui.ConsoleColumns; +import com.tridium.alarm.ui.ConsoleTableModel; +import com.tridium.bql.filter.BAbsTimeFilter; +import com.tridium.bql.filter.BFilterEntry; +import com.tridium.bql.filter.BFilterSet; +import com.tridium.bql.util.BDynamicTimeRange; +import com.tridium.fox.sys.BFoxClientConnection; +import com.tridium.fox.sys.BFoxSession; +import com.tridium.workbench.bql.filter.BFilterSetEditor; +import com.tridium.workbench.fieldeditors.BDynamicTimeRangeFE; +import com.tridium.workbench.fieldeditors.BFrozenEnumFE; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.StringTokenizer; +import javax.baja.agent.AgentFilter; +import javax.baja.agent.AgentList; +import javax.baja.alarm.BAlarmDatabase; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.alarm.BAlarmService; +import javax.baja.bql.BIBqlFilter; +import javax.baja.bql.BqlQuery; +import javax.baja.collection.BICollection; +import javax.baja.gx.BImage; +import javax.baja.naming.BOrd; +import javax.baja.naming.SlotPath; +import javax.baja.nre.util.Array; +import javax.baja.sys.Action; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BMenu; +import javax.baja.ui.BSeparator; +import javax.baja.ui.BTextDropDown; +import javax.baja.ui.BTextField; +import javax.baja.ui.BToolBar; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BMouseEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.table.BTable; +import javax.baja.ui.table.DynamicTableModel; +import javax.baja.ui.table.TableController; +import javax.baja.ui.table.TableModel; +import javax.baja.ui.util.BTitlePane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.workbench.BWbShell; +import javax.baja.workbench.fieldeditor.BWbFieldEditor; +import javax.baja.workbench.view.BWbComponentView; + +public class BAlarmDbView +extends BWbComponentView +implements BIAlarmServiceView { + public static final Property defaultTimeRange = BAlarmDbView.newProperty((int)0, (BValue)BDynamicTimeRange.DEFAULT, null); + public static final Property timeZoneDisplay = BAlarmDbView.newProperty((int)0, (BValue)BTimeZoneDisplay.console, null); + public static final Action query = BAlarmDbView.newAction((int)16, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmDbView == null ? (class$com$tridium$alarm$ui$BAlarmDbView = BAlarmDbView.class$("com.tridium.alarm.ui.BAlarmDbView")) : class$com$tridium$alarm$ui$BAlarmDbView)); + private static UiLexicon lex = new UiLexicon(class$com$tridium$alarm$ui$BAlarmDbView == null ? (class$com$tridium$alarm$ui$BAlarmDbView = BAlarmDbView.class$("com.tridium.alarm.ui.BAlarmDbView")) : class$com$tridium$alarm$ui$BAlarmDbView); + public static final BFacets TIME_FACETS = BFacets.make((String)"showSeconds", (boolean)true); + BTable table; + AlarmDbTableModel model; + BAlarmService alarmService; + Context context; + private BAlarmDatabase alarmDatabase; + private BFilterSet filterSet; + private BDynamicTimeRangeFE timeRangeEd; + private Command filterCmd; + private Command notesCmd; + private Command tzCmd; + private Command addColumnCommand; + private Command removeColumnCommand; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmDbView; + static /* synthetic */ Class class$javax$baja$sys$BString; + static /* synthetic */ Class class$java$lang$Integer; + + public BDynamicTimeRange getDefaultTimeRange() { + return (BDynamicTimeRange)this.get(defaultTimeRange); + } + + public void setDefaultTimeRange(BDynamicTimeRange bDynamicTimeRange) { + this.set(defaultTimeRange, (BValue)bDynamicTimeRange, null); + } + + public BTimeZoneDisplay getTimeZoneDisplay() { + return (BTimeZoneDisplay)this.get(timeZoneDisplay); + } + + public void setTimeZoneDisplay(BTimeZoneDisplay bTimeZoneDisplay) { + this.set(timeZoneDisplay, (BValue)bTimeZoneDisplay, null); + } + + public void query() { + this.invoke(query, null, null); + } + + public Type getType() { + return TYPE; + } + + public ConsoleColumns getConsoleColumns() { + if (this.model != null) { + return this.model.getColumns(); + } + ConsoleColumns consoleColumns = new ConsoleColumns(); + BString[] bStringArray = (BString[])BAlarmConsoleOptions.getDefault().getAlarmDataCols().getChildren(class$javax$baja$sys$BString == null ? (class$javax$baja$sys$BString = BAlarmDbView.class$("javax.baja.sys.BString")) : class$javax$baja$sys$BString); + for (int i = 0; i < bStringArray.length; ++i) { + consoleColumns.addDataColumn(null, bStringArray[i].toString()); + } + return consoleColumns; + } + + public int[] getDefaultColumns() { + Object object; + String string = BAlarmConsoleOptions.getDefault().getDisplayColumns(); + StringTokenizer stringTokenizer = new StringTokenizer(string, ","); + Array array = new Array(class$java$lang$Integer == null ? (class$java$lang$Integer = BAlarmDbView.class$("java.lang.Integer")) : class$java$lang$Integer); + while (stringTokenizer.hasMoreTokens()) { + object = stringTokenizer.nextToken(); + array.add((Object)new Integer((String)object)); + } + object = new int[array.size()]; + for (int i = 0; i < array.size(); ++i) { + object[i] = (Integer)array.get(i); + } + return object; + } + + public int getSortColumn() { + return BAlarmConsoleOptions.getDefault().getSortColumn(); + } + + public boolean getSortDirection() { + return BAlarmConsoleOptions.getDefault().getSortAscending(); + } + + public BTable getTable() { + return this.table; + } + + public BAlarmService getAlarmService(BAlarmRecord bAlarmRecord) { + return this.alarmService; + } + + public void doLoadValue(BObject bObject, Context context) { + this.filterSet = this.buildFilterSet(); + if (bObject instanceof BAlarmService) { + this.alarmService = (BAlarmService)bObject; + this.alarmDatabase = (BAlarmDatabase)BOrd.make((BOrd)this.alarmService.getAbsoluteOrd(), (BOrd)BOrd.make((String)"alarm:")).get(); + } else if (bObject instanceof BAlarmDatabase) { + this.alarmDatabase = (BAlarmDatabase)bObject; + this.alarmService = this.getAlarmService(); + } + this.context = context; + this.model = new AlarmDbTableModel(this.getConsoleColumns()); + this.model.init(this, context); + this.table = new BTable((TableModel)new DynamicTableModel((TableModel)this.model, this.getDefaultColumns()), (TableController)new Controller()); + this.table.setMultipleSelection(false); + this.model.options.setTimeZoneDisplay(this.getTimeZoneDisplay()); + this.filterCmd = new Command((BWidget)this, BAlarmDbView.lex.module, "commands.filter"){ + + public CommandArtifact doInvoke() { + BAlarmDbView.this.configFilters(); + BAlarmDbView.this.query(); + return null; + } + }; + this.notesCmd = new Command((BWidget)this, BAlarmDbView.lex.module, "commands.notes"){ + + public CommandArtifact doInvoke() { + int n = BAlarmDbView.this.table.getSelection().getRow(); + if (n != -1) { + BAlarmRecord bAlarmRecord = BAlarmDbView.this.model.getRecord(n); + BAlarmDbView.this.showNotes(bAlarmRecord); + } + return null; + } + }; + this.tzCmd = new Command((BWidget)this, BAlarmDbView.lex.module, "commands.timeZoneDisplay"){ + + public CommandArtifact doInvoke() { + BFrozenEnumFE bFrozenEnumFE = new BFrozenEnumFE(); + bFrozenEnumFE.loadValue((BObject)BAlarmDbView.this.getTimeZoneDisplay()); + int n = BDialog.open((BWidget)BAlarmDbView.this, (String)lex.getText("commands.timeZoneDisplay.label"), (Object)bFrozenEnumFE, (int)3); + if (n == 2) { + return null; + } + try { + BTimeZoneDisplay bTimeZoneDisplay = (BTimeZoneDisplay)bFrozenEnumFE.saveValue(); + BAlarmDbView.this.setTimeZoneDisplay(bTimeZoneDisplay); + BAlarmDbView.this.model.options.setTimeZoneDisplay(bTimeZoneDisplay); + BAlarmDbView.this.model.options.save(); + BAlarmDbView.this.repaint(); + } + catch (Exception exception) { + BDialog.error((BWidget)BAlarmDbView.this, (String)"Cannot Save", (Object)exception.getMessage(), (Throwable)exception); + } + return null; + } + }; + this.addColumnCommand = new Command((BWidget)this, BAlarmDbView.lex.module, "commands.addColumn"){ + + public CommandArtifact doInvoke() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.add("lbl", (BValue)new BLabel("AlarmData.")); + BTextField bTextField = new BTextField(""); + bGridPane.add("tf", (BValue)bTextField); + int n = BDialog.open((BWidget)BAlarmDbView.this, (String)lex.getText("commands.addColumn.label"), (Object)bGridPane, (int)3, (BImage)null); + if (n == 1) { + try { + BAlarmDbView.this.getConsoleColumns().addDataColumn(null, bTextField.getText()); + for (int i = 0; i < 2; ++i) { + DynamicTableModel dynamicTableModel = (DynamicTableModel)BAlarmDbView.this.table.getModel(); + dynamicTableModel.setColumnShowable(BAlarmDbView.this.getConsoleColumns().getColumnCount() - 1, true); + dynamicTableModel.setShowColumn(BAlarmDbView.this.getConsoleColumns().getColumnCount() - 1, true); + dynamicTableModel.updateTable(); + } + BAlarmDbView.this.model.options.getAlarmDataCols().add(SlotPath.escape((String)bTextField.getText()), (BValue)BString.make((String)bTextField.getText())); + BAlarmDbView.this.model.options.save(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + return null; + } + }; + this.removeColumnCommand = new Command((BWidget)this, BAlarmDbView.lex.module, "commands.removeColumn"){ + + public CommandArtifact doInvoke() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.add("lbl", (BValue)new BLabel("AlarmData.")); + ArrayList arrayList = new ArrayList(); + BString[] bStringArray = (BString[])BAlarmDbView.this.model.options.getAlarmDataCols().getChildren(class$javax$baja$sys$BString == null ? (class$javax$baja$sys$BString = BAlarmDbView.class$("javax.baja.sys.BString")) : class$javax$baja$sys$BString); + for (int i = 0; i < bStringArray.length; ++i) { + arrayList.add(bStringArray[i].toString()); + } + BTextDropDown bTextDropDown = new BTextDropDown(arrayList, 20, false); + bGridPane.add("tf", (BValue)bTextDropDown); + int n = BDialog.open((BWidget)BAlarmDbView.this, (String)lex.getText("commands.removeColumn.label"), (Object)bGridPane, (int)3, (BImage)null); + if (n == 1) { + String string = bTextDropDown.getText(); + int n2 = BAlarmDbView.this.getConsoleColumns().dataColumnIndex(string); + if (n2 == -1) { + return null; + } + for (int i = 0; i < 2; ++i) { + int n3; + DynamicTableModel dynamicTableModel = (DynamicTableModel)BAlarmDbView.this.table.getModel(); + boolean[] blArray = new boolean[BAlarmDbView.this.getConsoleColumns().getColumnCount()]; + for (n3 = 0; n3 < blArray.length; ++n3) { + blArray[n3] = dynamicTableModel.showColumn(n3); + } + for (n3 = n2; n3 < blArray.length - 1; ++n3) { + blArray[n3] = blArray[n3 + 1]; + } + blArray[blArray.length - 1] = false; + for (n3 = 0; n3 < blArray.length; ++n3) { + dynamicTableModel.setShowColumn(n3, blArray[n3]); + } + } + BAlarmDbView.this.getConsoleColumns().removeDataColumn(string); + BAlarmDbView.this.model.options.getAlarmDataCols().remove(SlotPath.escape((String)bTextDropDown.getText())); + BAlarmDbView.this.model.options.save(); + BAlarmDbView.this.model.updateTable(); + } + return null; + } + }; + BGridPane bGridPane = new BGridPane(3); + bGridPane.setHalign(BHalign.left); + this.timeRangeEd = new BDynamicTimeRangeFE(); + this.timeRangeEd.loadValue((BObject)BDynamicTimeRange.TODAY); + bGridPane.add("timeRangeQuery", (BValue)this.timeRangeEd); + BDynamicTimeRange bDynamicTimeRange = this.getDefaultTimeRange(); + if (!bDynamicTimeRange.equals((Object)BDynamicTimeRange.DEFAULT)) { + this.timeRangeEd.loadValue((BObject)bDynamicTimeRange, context); + } + this.linkTo("rangeLink", (BComponent)this.timeRangeEd, (Slot)BWbFieldEditor.setModified, (Slot)query); + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop((BWidget)new BBorderPane((BWidget)bGridPane)); + bEdgePane.setCenter((BWidget)BTitlePane.makePane((String)lex.getText("alarm.alarmHistory"), (BTable)this.table, (String)lex.getText("alarm.alarms"))); + this.setContent((BWidget)bEdgePane); + this.query(); + } + + public BToolBar getViewToolBar() { + BToolBar bToolBar = new BToolBar(); + bToolBar.add("filter", this.filterCmd); + bToolBar.add("notes", this.notesCmd); + bToolBar.add("timezone", this.tzCmd); + return bToolBar; + } + + public void stopped() throws Exception { + super.stopped(); + DynamicTableModel dynamicTableModel = (DynamicTableModel)this.table.getModel(); + StringBuffer stringBuffer = new StringBuffer(); + for (int i = 0; i < dynamicTableModel.getRootColumnCount(); ++i) { + if (!dynamicTableModel.showColumn(i)) continue; + stringBuffer.append(i + ","); + } + if (dynamicTableModel.getRootColumnCount() > 0) { + this.model.options.setDisplayColumns(stringBuffer.toString()); + } + this.model.options.setSortColumn(this.model.getLastSortColumn()); + this.model.options.setSortAscending(this.model.getLastSortAscending()); + if (this.model != null) { + this.model.options.save(); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void doQuery() { + this.enterBusy(); + try { + BAbsTimeFilter bAbsTimeFilter; + BDynamicTimeRange bDynamicTimeRange; + Object object; + StringBuffer stringBuffer; + StringBuffer stringBuffer2 = new StringBuffer("select * "); + if (this.filterSet != null) { + stringBuffer = new StringBuffer(64); + object = this.filterSet.getPredicate(); + if (object != null && object.length() > 0) { + if (stringBuffer.length() != 0) { + stringBuffer.append(" and "); + } + stringBuffer.append((String)object); + } + if (!(bDynamicTimeRange = (BDynamicTimeRange)this.timeRangeEd.saveValue()).equals((Object)BDynamicTimeRange.DEFAULT)) { + bAbsTimeFilter = new BAbsTimeFilter(); + bAbsTimeFilter.initFromDynamicTimeRange(bDynamicTimeRange); + String string = bAbsTimeFilter.getPredicate(BAlarmRecord.timestamp.getName()); + if (stringBuffer.length() != 0) { + stringBuffer.append(" and "); + } + stringBuffer.append(string.toString()); + } + if (stringBuffer.length() != 0) { + stringBuffer2.append(" where ").append(stringBuffer.toString()); + } + } + if (null == this.alarmDatabase) { + this.alarmDatabase = (BAlarmDatabase)BOrd.make((BOrd)this.alarmService.getAbsoluteOrd(), (BOrd)BOrd.make((String)"alarm:")).get(); + } + try { + stringBuffer = this.alarmDatabase.doBqlQuery(BqlQuery.make((String)stringBuffer2.toString())); + } + catch (Exception exception) { + bDynamicTimeRange = BOrd.make((BOrd)((BWbShell)this.getShell()).getActiveOrd(), (BOrd)BOrd.make((String)("alarm:|bql:" + stringBuffer2.toString()))); + bAbsTimeFilter = (BICollection)bDynamicTimeRange.resolve(this.getCurrentValue()).get(); + stringBuffer = bAbsTimeFilter.cursor(); + } + this.model.clear(); + while (stringBuffer.next()) { + object = (BAlarmRecord)stringBuffer.get(); + if (!this.filterSet.accept((BComplex)object)) continue; + this.model.add((BAlarmRecord)((Object)object)); + } + this.model.sortByColumn(this.getSortColumn(), this.getSortDirection()); + } + catch (Exception exception) { + exception.printStackTrace(); + } + finally { + this.exitBusy(); + this.table.sizeColumnsToFit(); + } + this.table.fireTableModified(null); + } + + public BAlarmService getAlarmService() { + if (this.alarmService == null) { + BOrd bOrd = ((BWbShell)this.getShell()).getActiveOrd(); + try { + BOrd bOrd2 = BOrd.make((BOrd)bOrd, (String)"service:alarm:AlarmService"); + this.alarmService = (BAlarmService)bOrd2.resolve().get(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + return this.alarmService; + } + + public void configFilters() { + BFilterSetEditor bFilterSetEditor = new BFilterSetEditor(); + bFilterSetEditor.loadValue((BObject)this.filterSet); + BBorderPane bBorderPane = new BBorderPane((BWidget)bFilterSetEditor); + if (BDialog.open((BWidget)this, (String)"Filters", (Object)bBorderPane, (int)3) != 2) { + try { + if (bFilterSetEditor.isModified()) { + this.filterSet = (BFilterSet)bFilterSetEditor.saveValue(); + } + } + catch (Exception exception) { + exception.printStackTrace(); + return; + } + } + } + + private BFilterSet buildFilterSet() { + BAlarmRecord bAlarmRecord = new BAlarmRecord(); + BFilterSet bFilterSet = new BFilterSet(); + Property[] propertyArray = bAlarmRecord.getPropertiesArray(); + for (int i = 0; i < propertyArray.length; ++i) { + BValue bValue; + AgentList agentList; + if (propertyArray[i].equals(BAlarmRecord.timestamp) || (agentList = (bValue = bAlarmRecord.get(propertyArray[i])).getAgents().filter(AgentFilter.is((Type)BIBqlFilter.TYPE))).size() == 0) continue; + BIBqlFilter bIBqlFilter = (BIBqlFilter)agentList.getDefault().getInstance(); + bIBqlFilter.init((BObject)bValue); + BFilterEntry bFilterEntry = new BFilterEntry(false, propertyArray[i].getDefaultDisplayName(this.getCurrentContext()), bIBqlFilter); + bFilterSet.add(propertyArray[i].getName(), (BValue)bFilterEntry, 0, bAlarmRecord.getSlotFacets((Slot)propertyArray[i]), null); + } + return bFilterSet; + } + + public void showDetailsDialog(BAlarmRecord bAlarmRecord) { + BAlarmDetailsDialog bAlarmDetailsDialog = new BAlarmDetailsDialog(this.alarmService, this.getTimeZoneDisplay(), bAlarmRecord, (ConsoleTableModel)((DynamicTableModel)this.table.getModel()).getRootModel(), this.context, this.getAlarmDbChannel()); + bAlarmDetailsDialog.setBoundsCenteredOnOwner(); + bAlarmDetailsDialog.open(); + } + + public void showNotes(BAlarmRecord bAlarmRecord) { + String string = ""; + try { + string = ((BString)bAlarmRecord.getAlarmData().getFacet("notes")).getString(); + } + catch (Exception exception) { + // empty catch block + } + BNotesDialog bNotesDialog = new BNotesDialog((BWidget)this, string, this.getUsername(bAlarmRecord), true); + bNotesDialog.setBoundsCenteredOnOwner(); + bNotesDialog.open(); + String string2 = bNotesDialog.getNewNotes(); + if (string2 != null) { + string = string2 + string; + BFacets bFacets = bAlarmRecord.getAlarmData(); + HashMap hashMap = new HashMap(); + String[] stringArray = bFacets.list(); + for (int i = 0; i < stringArray.length; ++i) { + if (stringArray[i].equals("notes")) continue; + BObject bObject = bFacets.get(stringArray[i]); + hashMap.put(stringArray[i], bObject); + } + hashMap.put("notes", BString.make((String)string)); + BFacets bFacets2 = BFacets.make(hashMap); + bAlarmRecord.setAlarmData(bFacets2); + try { + this.getAlarmDbChannel().update(bAlarmRecord); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + } + + protected String getUsername(BAlarmRecord bAlarmRecord) { + BFoxSession bFoxSession = (BFoxSession)this.getCurrentValueSession(); + BFoxClientConnection bFoxClientConnection = bFoxSession.getConnection(); + return bFoxClientConnection.getUsername(); + } + + protected BAlarmDbChannel getAlarmDbChannel() { + BFoxSession bFoxSession = (BFoxSession)this.getCurrentValueSession(); + BFoxClientConnection bFoxClientConnection = bFoxSession.getConnection(); + return (BAlarmDbChannel)bFoxClientConnection.getChannels().get("alarmdb", BAlarmDbChannel.TYPE); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + class Controller + extends TableController { + Controller() { + } + + protected void cellReleased(BMouseEvent bMouseEvent, int n, int n2) { + super.cellReleased(bMouseEvent, n, n2); + if (bMouseEvent.getClickCount() == 2) { + BAlarmDbView.this.showDetailsDialog(BAlarmDbView.this.model.getRecord(n)); + } + } + + public BMenu makeOptionsMenu() { + BMenu bMenu = super.makeOptionsMenu(); + bMenu.add("acSep", (BValue)new BSeparator()); + bMenu.add("addColumn", BAlarmDbView.this.addColumnCommand); + bMenu.add("removeColumn", BAlarmDbView.this.removeColumnCommand); + return bMenu; + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmDetailsDialog.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmDetailsDialog.java new file mode 100644 index 0000000..290a4f1 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmDetailsDialog.java @@ -0,0 +1,622 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.ui.theme.Theme + * javax.baja.data.BIDataValue + * javax.baja.gx.BBrush + * javax.baja.gx.BImage + * javax.baja.log.Log + * javax.baja.naming.BOrd + * javax.baja.naming.BOrdList + * javax.baja.naming.SlotPath + * javax.baja.nre.util.SortUtil + * javax.baja.nre.util.TextUtil + * javax.baja.sys.BAbsTime + * javax.baja.sys.BComplex + * javax.baja.sys.BFacets + * javax.baja.sys.BIcon + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Flags + * javax.baja.sys.LocalizableRuntimeException + * javax.baja.sys.Property + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.timezone.BTimeZone + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BToolBar + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.enums.BHalign + * javax.baja.ui.enums.BValign + * javax.baja.ui.event.BWindowEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.pane.BScrollPane + * javax.baja.ui.text.BTextEditor + * javax.baja.ui.text.TextRenderer + * javax.baja.ui.util.UiLexicon + * javax.baja.util.BFormat + * javax.baja.util.Lexicon + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.fox.BAlarmDbChannel; +import com.tridium.alarm.ui.BAlarmClassDef; +import com.tridium.alarm.ui.BAlarmConsole; +import com.tridium.alarm.ui.BNotesDialog; +import com.tridium.alarm.ui.BTimeZoneDisplay; +import com.tridium.alarm.ui.ConsoleTableModel; +import com.tridium.ui.theme.Theme; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Comparator; +import java.util.HashMap; +import javax.baja.alarm.AlarmException; +import javax.baja.alarm.BAlarmClass; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.alarm.BAlarmService; +import javax.baja.data.BIDataValue; +import javax.baja.gx.BBrush; +import javax.baja.gx.BImage; +import javax.baja.log.Log; +import javax.baja.naming.BOrd; +import javax.baja.naming.BOrdList; +import javax.baja.naming.SlotPath; +import javax.baja.nre.util.SortUtil; +import javax.baja.nre.util.TextUtil; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BComplex; +import javax.baja.sys.BFacets; +import javax.baja.sys.BIcon; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Flags; +import javax.baja.sys.LocalizableRuntimeException; +import javax.baja.sys.Property; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.timezone.BTimeZone; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BToolBar; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.enums.BValign; +import javax.baja.ui.event.BWindowEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.pane.BScrollPane; +import javax.baja.ui.text.BTextEditor; +import javax.baja.ui.text.TextRenderer; +import javax.baja.ui.util.UiLexicon; +import javax.baja.util.BFormat; +import javax.baja.util.Lexicon; + +public class BAlarmDetailsDialog +extends BDialog { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmDetailsDialog == null ? (class$com$tridium$alarm$ui$BAlarmDetailsDialog = BAlarmDetailsDialog.class$("com.tridium.alarm.ui.BAlarmDetailsDialog")) : class$com$tridium$alarm$ui$BAlarmDetailsDialog)); + BAlarmConsole console; + BAlarmService alarmService; + BGridPane alarmPane = new BGridPane(2); + protected BAlarmRecord alarm; + BTimeZoneDisplay timeZoneDisplay; + BAlarmDbChannel alarmDbChannel; + ConsoleTableModel tm; + Log logger = Log.getLog((String)"alarm"); + Command ackCmd; + Command closeCmd; + Command hyperlinkCmd; + Command notesCmd; + Command showVideoCmd; + Command nextCmd; + Command prevCmd; + public static final BFacets TIME_FACETS = BFacets.make((String)"showSeconds", (boolean)true); + public static final UiLexicon lex = new UiLexicon(class$com$tridium$alarm$ui$BAlarmDetailsDialog == null ? (class$com$tridium$alarm$ui$BAlarmDetailsDialog = BAlarmDetailsDialog.class$("com.tridium.alarm.ui.BAlarmDetailsDialog")) : class$com$tridium$alarm$ui$BAlarmDetailsDialog); + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmDetailsDialog; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmConsole; + static /* synthetic */ Class class$javax$baja$alarm$BAlarmRecord; + + public Type getType() { + return TYPE; + } + + public BAlarmDetailsDialog() { + throw new IllegalStateException(); + } + + public BAlarmDetailsDialog(BAlarmConsole bAlarmConsole, BTimeZoneDisplay bTimeZoneDisplay, BAlarmRecord bAlarmRecord, ConsoleTableModel consoleTableModel) { + this(bAlarmConsole, bTimeZoneDisplay, bAlarmRecord, consoleTableModel, null); + } + + public BAlarmDetailsDialog(BAlarmService bAlarmService, BTimeZoneDisplay bTimeZoneDisplay, BAlarmRecord bAlarmRecord, ConsoleTableModel consoleTableModel, Context context) { + this(bAlarmService, null, bTimeZoneDisplay, bAlarmRecord, consoleTableModel, context); + } + + public BAlarmDetailsDialog(BAlarmService bAlarmService, BTimeZoneDisplay bTimeZoneDisplay, BAlarmRecord bAlarmRecord, ConsoleTableModel consoleTableModel, Context context, BAlarmDbChannel bAlarmDbChannel) { + this(bAlarmService, null, bTimeZoneDisplay, bAlarmRecord, consoleTableModel, context, bAlarmDbChannel); + } + + public BAlarmDetailsDialog(BAlarmConsole bAlarmConsole, BTimeZoneDisplay bTimeZoneDisplay, BAlarmRecord bAlarmRecord, ConsoleTableModel consoleTableModel, Context context) { + this(null, bAlarmConsole, bTimeZoneDisplay, bAlarmRecord, consoleTableModel, context); + } + + protected BAlarmDetailsDialog(BAlarmService bAlarmService, BAlarmConsole bAlarmConsole, BTimeZoneDisplay bTimeZoneDisplay, BAlarmRecord bAlarmRecord, ConsoleTableModel consoleTableModel, Context context) { + this(bAlarmService, bAlarmConsole, bTimeZoneDisplay, bAlarmRecord, consoleTableModel, context, null); + } + + protected BAlarmDetailsDialog(BAlarmService bAlarmService, BAlarmConsole bAlarmConsole, BTimeZoneDisplay bTimeZoneDisplay, BAlarmRecord bAlarmRecord, ConsoleTableModel consoleTableModel, Context context, BAlarmDbChannel bAlarmDbChannel) { + super((BWidget)bAlarmConsole, "Alarm Record", true); + BEdgePane bEdgePane; + Object object; + BAlarmClass bAlarmClass; + this.console = bAlarmConsole; + this.alarm = bAlarmRecord; + this.tm = consoleTableModel; + this.timeZoneDisplay = bTimeZoneDisplay; + if (bAlarmConsole != null) { + this.alarmService = bAlarmConsole.getAlarmService(); + } + if (bAlarmService != null) { + this.alarmService = bAlarmService; + } + this.alarmDbChannel = bAlarmDbChannel; + this.hyperlinkCmd = new HyperlinkCommand((BWidget)this); + BButton bButton = new BButton(this.hyperlinkCmd, true, true); + this.ackCmd = new AckCommand((BWidget)this); + BButton bButton2 = new BButton(this.ackCmd, true, true); + this.notesCmd = new NotesCommand((BWidget)this); + BButton bButton3 = new BButton(this.notesCmd, true, true); + this.showVideoCmd = new ShowVideoCommand((BWidget)this); + BButton bButton4 = new BButton(this.showVideoCmd, true, true); + this.closeCmd = new CloseCommand((BWidget)this); + BButton bButton5 = new BButton(this.closeCmd, true, true); + this.nextCmd = new PrevCommand((BWidget)this, context); + BButton bButton6 = new BButton(this.nextCmd, false, true); + this.prevCmd = new NextCommand((BWidget)this, context); + BButton bButton7 = new BButton(this.prevCmd, false, true); + BOrdList bOrdList = bAlarmRecord.getSource(); + boolean bl = false; + int n = consoleTableModel.getAlarmCount(bOrdList); + for (int i = 0; i < n; ++i) { + if (!consoleTableModel.getRecord(bOrdList, i).getUuid().equals((Object)bAlarmRecord.getUuid())) continue; + this.prevCmd.setEnabled(i != 0); + this.nextCmd.setEnabled(i + 1 < n); + bl = true; + break; + } + if (!bl) { + this.prevCmd.setEnabled(false); + this.nextCmd.setEnabled(false); + } + this.createAlarmPane(context); + BGridPane bGridPane = new BGridPane(); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + bGridPane.add("next", (BValue)bButton6); + if (bAlarmConsole != null) { + bAlarmClass = bAlarmConsole.getAlarmService().lookupAlarmClass(bAlarmRecord.getAlarmClass()); + if (bAlarmClass.getPermissions(bAlarmConsole.ctx).hasOperatorWrite()) { + bGridPane.add("ack", (BValue)bButton2); + } + bGridPane.add("url", (BValue)bButton); + bGridPane.add("notes", (BValue)bButton3); + if (BAlarmConsole.isVideoDriverAvailable() && (object = bAlarmRecord.getAlarmData().gets("cameraOrd", null)) != null && !(bEdgePane = BOrd.make((String)object)).equals((Object)BOrd.NULL)) { + bGridPane.add("showVideo", (BValue)bButton4); + } + } + bGridPane.add("close", (BValue)bButton5); + bGridPane.add("prev", (BValue)bButton7); + bGridPane.setColumnCount(bGridPane.getChildWidgets().length); + bAlarmClass = new BScrollPane(); + object = new BBorderPane(); + bAlarmClass.setContent((BWidget)object); + object.setContent((BWidget)this.alarmPane); + bEdgePane = new BEdgePane(); + bEdgePane.setCenter((BWidget)new BBorderPane((BWidget)bAlarmClass)); + bEdgePane.setBottom((BWidget)new BBorderPane((BWidget)bGridPane)); + this.setContent((BWidget)bEdgePane); + } + + public void windowClosing(BWindowEvent bWindowEvent) { + this.close(); + } + + void createAlarmPane(Context context) { + Object object; + Object object2; + BOrd bOrd; + Property[] propertyArray = this.alarm.loadSlots().getPropertiesArray(); + int n = propertyArray.length; + this.alarmPane.removeAll(); + this.alarmPane.setColorRows(true); + this.alarmPane.setRowAlign(BValign.top); + this.alarmPane.setColumnGap(9.0); + for (int i = 0; i < n; ++i) { + BTextEditor bTextEditor; + if (Flags.isHidden((BComplex)this.alarm, (Slot)propertyArray[i])) continue; + bOrd = new BLabel(this.alarm.getDisplayName((Slot)propertyArray[i], this.console != null ? this.console.ctx : null), BHalign.left); + bOrd.setFont(Theme.label().getBoldText()); + this.alarmPane.add(null, (BValue)bOrd, null); + if (propertyArray[i].getName().equals("alarmData")) { + object2 = (BFacets)this.alarm.get(propertyArray[i]); + object = new BGridPane(2); + object.setHalign(BHalign.fill); + object.setColumnGap(5.0); + object.setRowAlign(BValign.top); + bTextEditor = object2.list(); + bTextEditor = this.addNotePropertyIfNotPresent((String[])bTextEditor); + SortUtil.sort((Object[])bTextEditor, (Object[])bTextEditor, (Comparator)new Comparator(){ + + public int compare(Object object, Object object2) { + return ((String)object).compareToIgnoreCase((String)object2); + } + }); + for (int j = 0; j < ((Object[])bTextEditor).length; ++j) { + BFormat bFormat; + Object object3; + BLabel bLabel = new BLabel(lex.get("alarmData." + (String)bTextEditor[j], TextUtil.toFriendly((String)bTextEditor[j])), BHalign.left); + bLabel.setFont(Theme.label().getBoldText()); + object.add(null, (BValue)bLabel, null); + if (bTextEditor[j].equals("notes")) { + object3 = new Command((BWidget)this, "", BImage.make((BIcon)BIcon.std((String)"doubleArrowRight.png")), null, ""){ + + public CommandArtifact doInvoke() { + try { + BAlarmDetailsDialog.this.notesCmd.doInvoke(); + } + catch (Exception exception) { + // empty catch block + } + return null; + } + }; + bFormat = new BToolBar(); + bFormat.add("eb", (BValue)new BButton(object3, false, true)); + object.add(null, (BValue)bFormat, null); + continue; + } + if (bTextEditor[j].equals("msgText")) { + bFormat = BFormat.make((String)object2.getFacet((String)bTextEditor[j]).toString()); + object3 = bFormat.format((Object)this.alarm); + } else { + object3 = bTextEditor[j].equals("instructions") ? BFormat.make((String)object2.getFacet((String)bTextEditor[j]).toString()).format((Object)this) : object2.getFacet((String)bTextEditor[j]).toString(); + } + object3 = TextUtil.replace((String)object3, (String)"\\n", (String)"\n"); + bFormat = new BTextEditor((String)object3, false); + bFormat.setRenderer(new TextRenderer(){ + + public BBrush getBackground() { + return BBrush.NULL; + } + }); + object.add(null, (BValue)bFormat); + } + this.alarmPane.add(null, (BValue)object, null); + continue; + } + if (propertyArray[i].getType().is(BOrdList.TYPE)) { + try { + BString bString; + object2 = (BOrdList)this.alarm.get(propertyArray[i]); + object = new StringBuffer(); + for (int j = object2.size() - 1; j >= 0; --j) { + if (j < object2.size() - 1) { + ((StringBuffer)object).append("-> "); + } + ((StringBuffer)object).append(SlotPath.unescape((String)object2.get(j).encodeToString()).toString()); + if (j - 1 < 0) continue; + ((StringBuffer)object).append("\n"); + } + if (propertyArray[i].getName().equals("source") && (bString = (BString)this.alarm.getAlarmData().get("sourceName")) != null && bString != BString.DEFAULT) { + ((StringBuffer)object).insert(0, BFormat.make((String)bString.toString(context)).format((Object)this.alarm) + "\n"); + } + bTextEditor = new BTextEditor(((StringBuffer)object).toString(), false); + bTextEditor.setRenderer(new TextRenderer(){ + + public BBrush getBackground() { + return BBrush.NULL; + } + }); + this.alarmPane.add(null, (BValue)bTextEditor, null); + } + catch (Exception exception) { + this.alarmPane.add(null, (BValue)new BLabel("unknown"), null); + } + continue; + } + if (propertyArray[i].getType().is(BAbsTime.TYPE)) { + object2 = (BAbsTime)this.alarm.get(propertyArray[i]); + object = ""; + object = this.timeZoneDisplay == BTimeZoneDisplay.source ? object2.toString((Context)BFacets.make((BFacets)this.alarm.getAlarmData(), (BFacets)TIME_FACETS)) : object2.toString((Context)BFacets.make((BFacets)TIME_FACETS, (String)"TimeZone", (BIDataValue)BTimeZone.getLocal())); + bTextEditor = new BTextEditor((String)object, false); + bTextEditor.setRenderer(new TextRenderer(){ + + public BBrush getBackground() { + return BBrush.NULL; + } + }); + this.alarmPane.add(null, (BValue)bTextEditor); + continue; + } + object2 = SlotPath.unescape((String)this.alarm.get(propertyArray[i].getName()).toString()); + object2 = TextUtil.replace((String)object2, (String)"\\n", (String)"\n"); + if (propertyArray[i].getName().equals("alarmClass")) { + object2 = this.alarmService.getAlarmClassDisplayName(BString.make((String)this.alarm.get(propertyArray[i].getName()).toString()), context).toString(); + } + object = new BTextEditor((String)object2, false); + object.setRenderer(new TextRenderer(){ + + public BBrush getBackground() { + return BBrush.NULL; + } + }); + this.alarmPane.add(null, (BValue)object); + } + BString bString = (BString)this.alarm.getAlarmData().get("hyperlinkOrd"); + bOrd = BOrd.NULL; + if (bString != null) { + bOrd = BOrd.make((String)bString.toString()); + } + if (bOrd == null || bOrd.isNull() && this.console != null) { + object2 = this.console.options.getAlarmClassMapping(); + object = object2.getAlarmClassDefFor(this.alarm.getAlarmClass()); + bOrd = ((BAlarmClassDef)((Object)object)).getAlarmUrl(); + } + if (bOrd != null && !bOrd.isNull()) { + this.hyperlinkCmd.setEnabled(true); + } else { + this.hyperlinkCmd.setEnabled(false); + } + } + + private String[] addNotePropertyIfNotPresent(String[] stringArray) { + boolean bl = false; + for (int i = 0; i < stringArray.length; ++i) { + if (!"notes".equals(stringArray[i])) continue; + bl = true; + break; + } + if (!bl) { + String[] stringArray2 = new String[stringArray.length + 1]; + int n = 0; + for (n = 0; n < stringArray.length; ++n) { + stringArray2[n] = stringArray[n]; + } + stringArray2[n] = "notes"; + stringArray = stringArray2; + } + return stringArray; + } + + protected void alarmCleared() { + this.notesCmd.setEnabled(false); + this.ackCmd.setEnabled(false); + this.hyperlinkCmd.setEnabled(false); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private class ShowVideoCommand + extends Command { + public ShowVideoCommand(BWidget bWidget) { + super(bWidget, (Lexicon)BAlarmConsole.lexicon, "commands.showVideo"); + } + + public CommandArtifact doInvoke() { + block8: { + try { + Class clazz = Sys.loadClass((String)"videoDriver", (String)"com.tridium.videoDriver.alarm.AlarmConsoleExt"); + if (clazz != null) { + Method method = clazz.getMethod("doShowVideo", class$com$tridium$alarm$ui$BAlarmConsole == null ? (class$com$tridium$alarm$ui$BAlarmConsole = BAlarmDetailsDialog.class$("com.tridium.alarm.ui.BAlarmConsole")) : class$com$tridium$alarm$ui$BAlarmConsole, class$javax$baja$alarm$BAlarmRecord == null ? (class$javax$baja$alarm$BAlarmRecord = BAlarmDetailsDialog.class$("javax.baja.alarm.BAlarmRecord")) : class$javax$baja$alarm$BAlarmRecord); + if (method != null) { + method.invoke((Object)clazz, new Object[]{BAlarmDetailsDialog.this.console, BAlarmDetailsDialog.this.alarm}); + } else { + System.out.println("The 'doShowVideo' method was not found on class AlarmConsoleExt in videoDriver.jar. Please have my program fixed"); + } + break block8; + } + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound"); + } + catch (ClassNotFoundException classNotFoundException) { + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound", (Throwable)classNotFoundException); + } + catch (NoSuchMethodException noSuchMethodException) { + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound", (Throwable)noSuchMethodException); + } + catch (InvocationTargetException invocationTargetException) { + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound", (Throwable)invocationTargetException); + } + catch (IllegalAccessException illegalAccessException) { + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound", (Throwable)illegalAccessException); + } + } + return null; + } + } + + private class NextCommand + extends Command { + Context cx; + + public NextCommand(BWidget bWidget, Context context) { + super(bWidget, (Lexicon)UiLexicon.bajaui, "commands.forward"); + this.cx = context; + } + + public String getLabel() { + return "Previous"; + } + + public CommandArtifact doInvoke() { + BOrdList bOrdList = BAlarmDetailsDialog.this.alarm.getSource(); + int n = BAlarmDetailsDialog.this.tm.getAlarmCount(bOrdList); + for (int i = 0; i < n; ++i) { + if (!BAlarmDetailsDialog.this.tm.getRecord(bOrdList, i).getUuid().equals((Object)BAlarmDetailsDialog.this.alarm.getUuid())) continue; + if (i > 0) { + BAlarmDetailsDialog.this.alarm = BAlarmDetailsDialog.this.tm.getRecord(bOrdList, i - 1); + BAlarmDetailsDialog.this.createAlarmPane(this.cx); + BAlarmDetailsDialog.this.alarmPane.relayout(); + --i; + } + BAlarmDetailsDialog.this.prevCmd.setEnabled(i != 0); + BAlarmDetailsDialog.this.nextCmd.setEnabled(i + 1 < n); + return null; + } + BAlarmDetailsDialog.this.prevCmd.setEnabled(false); + BAlarmDetailsDialog.this.nextCmd.setEnabled(false); + return null; + } + } + + private class PrevCommand + extends Command { + Context cx; + + public PrevCommand(BWidget bWidget, Context context) { + super(bWidget, (Lexicon)UiLexicon.bajaui, "commands.back"); + this.cx = context; + } + + public String getLabel() { + return "Next"; + } + + public CommandArtifact doInvoke() { + BOrdList bOrdList = BAlarmDetailsDialog.this.alarm.getSource(); + int n = BAlarmDetailsDialog.this.tm.getAlarmCount(bOrdList); + for (int i = 0; i < n; ++i) { + if (!BAlarmDetailsDialog.this.tm.getRecord(bOrdList, i).getUuid().equals((Object)BAlarmDetailsDialog.this.alarm.getUuid())) continue; + if (i + 1 < n) { + BAlarmDetailsDialog.this.alarm = BAlarmDetailsDialog.this.tm.getRecord(bOrdList, i + 1); + BAlarmDetailsDialog.this.createAlarmPane(this.cx); + BAlarmDetailsDialog.this.alarmPane.relayout(); + ++i; + } + BAlarmDetailsDialog.this.prevCmd.setEnabled(i != 0); + BAlarmDetailsDialog.this.nextCmd.setEnabled(i + 1 < n); + return null; + } + BAlarmDetailsDialog.this.prevCmd.setEnabled(false); + BAlarmDetailsDialog.this.nextCmd.setEnabled(false); + return null; + } + } + + private class CloseCommand + extends Command { + public CloseCommand(BWidget bWidget) { + super(bWidget, (Lexicon)UiLexicon.bajaui, "commands.close"); + } + + public CommandArtifact doInvoke() { + BAlarmDetailsDialog.this.close(); + return null; + } + } + + private class HyperlinkCommand + extends Command { + public HyperlinkCommand(BWidget bWidget) { + super(bWidget, (Lexicon)BAlarmConsole.lexicon, "commands.hyperlink"); + } + + public CommandArtifact doInvoke() { + BAlarmDetailsDialog.this.console.hyperlink(BAlarmDetailsDialog.this.alarm); + return null; + } + } + + private class NotesCommand + extends Command { + public NotesCommand(BWidget bWidget) { + super(bWidget, (Lexicon)BAlarmConsole.lexicon, "commands.notes"); + } + + public CommandArtifact doInvoke() { + if (BAlarmDetailsDialog.this.console != null) { + BAlarmDetailsDialog.this.console.showNotes((BWidget)BAlarmDetailsDialog.this.alarmPane, new BAlarmRecord[]{BAlarmDetailsDialog.this.alarm}); + } else { + if (BAlarmDetailsDialog.this.alarmDbChannel == null) { + AlarmException alarmException = new AlarmException("Unable to find alarmDBChannel"); + BAlarmDetailsDialog.this.logger.error("Unable to find alarmDBChannel", (Throwable)((Object)alarmException)); + throw alarmException; + } + this.showAndAddNotes(); + } + return null; + } + + private void showAndAddNotes() { + String string = ""; + try { + string = ((BString)BAlarmDetailsDialog.this.alarm.getAlarmData().getFacet("notes")).getString(); + } + catch (Exception exception) { + BAlarmDetailsDialog.this.logger.error("Exception occurred while fetching the notes ", (Throwable)exception); + } + String string2 = BAlarmDetailsDialog.this.alarmDbChannel.getClientConnection().getUsername(); + BNotesDialog bNotesDialog = new BNotesDialog(null, string, string2, true); + bNotesDialog.setBoundsCenteredOnOwner(); + bNotesDialog.open(); + String string3 = bNotesDialog.getNewNotes(); + if (string3 != null) { + string = string3 + string; + BFacets bFacets = BAlarmDetailsDialog.this.alarm.getAlarmData(); + HashMap hashMap = new HashMap(); + String[] stringArray = bFacets.list(); + for (int i = 0; i < stringArray.length; ++i) { + if (stringArray[i].equals("notes")) continue; + BObject bObject = bFacets.get(stringArray[i]); + hashMap.put(stringArray[i], bObject); + } + hashMap.put("notes", BString.make((String)string)); + BFacets bFacets2 = BFacets.make(hashMap); + BAlarmDetailsDialog.this.alarm.setAlarmData(bFacets2); + try { + BAlarmDetailsDialog.this.alarmDbChannel.update(BAlarmDetailsDialog.this.alarm); + } + catch (Exception exception) { + BAlarmDetailsDialog.this.logger.error("Exception while updating the notes for an alarm", (Throwable)exception); + } + } + } + } + + private class AckCommand + extends Command { + public AckCommand(BWidget bWidget) { + super(bWidget, (Lexicon)BAlarmConsole.lexicon, "commands.acknowledge"); + } + + public CommandArtifact doInvoke() { + BAlarmDetailsDialog.this.console.acknowledgeAlarms(new BAlarmRecord[]{BAlarmDetailsDialog.this.alarm}); + BAlarmDetailsDialog.this.prevCmd.setEnabled(false); + BAlarmDetailsDialog.this.nextCmd.setEnabled(false); + return null; + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmDialog.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmDialog.java new file mode 100644 index 0000000..c074f75 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmDialog.java @@ -0,0 +1,410 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.data.BIDataValue + * javax.baja.gx.BBrush + * javax.baja.gx.BColor + * javax.baja.gx.BImage + * javax.baja.gx.BInsets + * javax.baja.gx.BPoint + * javax.baja.gx.Point + * javax.baja.naming.BOrd + * javax.baja.sys.Action + * javax.baja.sys.BBoolean + * javax.baja.sys.BComponent + * javax.baja.sys.BFacets + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BBorder + * javax.baja.ui.BFrame + * javax.baja.ui.BHyperlinkLabel + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.enums.BValign + * javax.baja.ui.event.BMouseEvent + * javax.baja.ui.event.BWindowEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.util.UiLexicon + * javax.baja.util.BFormat + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.ui.BAlarmConsoleOptions; +import com.tridium.alarm.ui.portal.BAlarmPortalOptions; +import com.tridium.alarm.ui.portal.BAlarmPortalTool; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.data.BIDataValue; +import javax.baja.gx.BBrush; +import javax.baja.gx.BColor; +import javax.baja.gx.BImage; +import javax.baja.gx.BInsets; +import javax.baja.gx.BPoint; +import javax.baja.gx.Point; +import javax.baja.naming.BOrd; +import javax.baja.sys.Action; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BBorder; +import javax.baja.ui.BFrame; +import javax.baja.ui.BHyperlinkLabel; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.enums.BValign; +import javax.baja.ui.event.BMouseEvent; +import javax.baja.ui.event.BWindowEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.util.BFormat; + +public class BAlarmDialog +extends BFrame { + public static final Action update = BAlarmDialog.newAction((int)4, null); + public static final Action handleHyperlink = BAlarmDialog.newAction((int)4, (BValue)new BMouseEvent(), null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmDialog == null ? (class$com$tridium$alarm$ui$BAlarmDialog = BAlarmDialog.class$("com.tridium.alarm.ui.BAlarmDialog")) : class$com$tridium$alarm$ui$BAlarmDialog)); + private BLabel lastAlarm; + private BLabel lastAlarmSrc; + private BLabel lastAlarmMsg; + private BHyperlinkLabel lastAlarmHyperlink; + private BLabel status; + private BAlarmRecord lastAlarmRecord; + private boolean lastAlarmRecordChanged; + private BHyperlinkLabel imgLabel; + private String title; + private boolean fullyConnected = false; + private int acked; + private int unacked; + private boolean sourcesInAlarm; + private boolean alwaysOnTop; + private boolean uncloseable; + private boolean closed = true; + private BAlarmPortalTool tool; + static BImage alarmImg = BImage.make((String)"module://icons/x16/alarm.png"); + static BImage alarmRed = BImage.make((String)"module://alarm/com/tridium/alarm/icons/alarmRed.png"); + static BImage alarmGreen = BImage.make((String)"module://alarm/com/tridium/alarm/icons/alarmGreen.png"); + private static BImage ALARM_YELLOW = BImage.make((String)"module://alarm/com/tridium/alarm/ui/images/alarm.gif"); + private static BImage ALARM_GREEN = BImage.make((String)"module://alarm/com/tridium/alarm/ui/images/alarmGreen.gif"); + private static BImage ALARM_RED = BImage.make((String)"module://alarm/com/tridium/alarm/ui/images/alarmRed.gif"); + private static BImage ALARM_WHITE = BImage.make((String)"module://alarm/com/tridium/alarm/ui/images/alarmWhite.gif"); + private static BImage ALARM_GRAY = BImage.make((String)"module://alarm/com/tridium/alarm/ui/images/alarmGray.gif"); + public static final UiLexicon lexicon = new UiLexicon(class$com$tridium$alarm$ui$BAlarmDialog == null ? (class$com$tridium$alarm$ui$BAlarmDialog = BAlarmDialog.class$("com.tridium.alarm.ui.BAlarmDialog")) : class$com$tridium$alarm$ui$BAlarmDialog); + public BAlarmConsoleOptions options = BAlarmConsoleOptions.getDefault(); + public static final BFacets TIME_FACETS = BFacets.make((String)"showTimeZone", (BIDataValue)BBoolean.FALSE, (String)"showSeconds", (BIDataValue)BBoolean.TRUE); + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmDialog; + + public void update() { + this.invoke(update, null, null); + } + + public void handleHyperlink(BMouseEvent bMouseEvent) { + this.invoke(handleHyperlink, (BValue)bMouseEvent, null); + } + + public Type getType() { + return TYPE; + } + + public BAlarmDialog() { + throw new IllegalStateException(); + } + + public BAlarmDialog(BAlarmPortalTool bAlarmPortalTool, String string, BImage bImage, BAlarmRecord bAlarmRecord, int n, int n2, boolean bl, boolean bl2) { + super(string); + this.acked = n; + this.unacked = n2; + this.title = string; + this.alwaysOnTop = bl; + this.uncloseable = bl2; + this.tool = bAlarmPortalTool; + BAlarmPortalOptions bAlarmPortalOptions = BAlarmPortalOptions.getDefault(); + BPoint bPoint = bAlarmPortalOptions.getPopupPosition(); + this.setVisible(true); + this.setIconImage(bImage); + String string2 = lexicon.getText("portal.popup.lastAlarm") + ": "; + String string3 = lexicon.getText("portal.popup.source") + ": "; + String string4 = lexicon.getText("portal.popup.message") + ": "; + String string5 = lexicon.getText("portal.popup.hyperlink") + ": "; + BEdgePane bEdgePane = new BEdgePane(); + BGridPane bGridPane = new BGridPane(1); + bGridPane.setValign(BValign.top); + bGridPane.setHalign(BHalign.center); + bGridPane.setColumnAlign(BHalign.center); + this.imgLabel = new BHyperlinkLabel(); + this.imgLabel.setImage(ALARM_GRAY); + this.imgLabel.setBackground(BColor.white.toBrush()); + BBorderPane bBorderPane = new BBorderPane((BWidget)this.imgLabel); + bBorderPane.setBorder(BBorder.make((double)1.0, (int)1, (BBrush)BColor.black.toBrush())); + bBorderPane.setMargin(BInsets.make((double)15.0, (double)20.0, (double)10.0, (double)20.0)); + bBorderPane.setPadding(BInsets.NULL); + bGridPane.add(null, (BValue)bBorderPane); + this.linkTo((BComponent)this.imgLabel, (Slot)BWidget.mouseEvent, (Slot)handleHyperlink); + this.status = new BLabel(); + this.status.setHalign(BHalign.center); + this.status.setPadding(BInsets.make((double)0.0, (double)10.0, (double)0.0, (double)10.0)); + bGridPane.add(null, (BValue)this.status); + BGridPane bGridPane2 = new BGridPane(2); + bGridPane2.setRowAlign(BValign.top); + bGridPane2.setColumnAlign(BHalign.left); + BLabel bLabel = new BLabel(string2); + bLabel.setPadding(BInsets.make((double)10.0, (double)0.0, (double)0.0, (double)0.0)); + bLabel.setHalign(BHalign.left); + bGridPane2.add(null, (BValue)bLabel); + this.lastAlarm = new BLabel(); + this.lastAlarm.setPadding(BInsets.make((double)10.0, (double)0.0, (double)0.0, (double)0.0)); + this.lastAlarm.setHalign(BHalign.left); + bGridPane2.add(null, (BValue)this.lastAlarm); + BLabel bLabel2 = new BLabel(string3); + bLabel2.setHalign(BHalign.left); + bGridPane2.add(null, (BValue)bLabel2); + this.lastAlarmSrc = new BLabel(); + this.lastAlarmSrc.setHalign(BHalign.left); + bGridPane2.add(null, (BValue)this.lastAlarmSrc); + BLabel bLabel3 = new BLabel(string4); + bLabel3.setHalign(BHalign.left); + bGridPane2.add(null, (BValue)bLabel3); + this.lastAlarmMsg = new BLabel(); + this.lastAlarmMsg.setHalign(BHalign.left); + bGridPane2.add(null, (BValue)this.lastAlarmMsg); + BLabel bLabel4 = new BLabel(string5); + bLabel4.setHalign(BHalign.left); + bLabel4.setPadding(BInsets.make((double)0.0, (double)0.0, (double)10.0, (double)0.0)); + bGridPane2.add(null, (BValue)bLabel4); + this.lastAlarmHyperlink = new BHyperlinkLabel(); + this.lastAlarmHyperlink.setHalign(BHalign.left); + this.lastAlarmHyperlink.setPadding(BInsets.make((double)0.0, (double)0.0, (double)10.0, (double)0.0)); + bGridPane2.add(null, (BValue)this.lastAlarmHyperlink); + this.linkTo((BComponent)this.lastAlarmHyperlink, (Slot)BWidget.mouseEvent, (Slot)handleHyperlink); + bEdgePane.setLeft((BWidget)bGridPane); + bEdgePane.setCenter((BWidget)bGridPane2); + bEdgePane.computePreferredSize(); + this.setScreenBounds(bPoint.x(), bPoint.y(), bEdgePane.getPreferredWidth() + 50.0, bEdgePane.getPreferredHeight() + 50.0); + this.setContent((BWidget)bEdgePane); + if (bAlarmRecord != null) { + this.updateLastAlarm(bAlarmRecord); + } + try { + this.doLoad(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + this.setAlwaysOnTop(string, bl); + Thread thread = new Thread(){ + + public void run() { + while (!BAlarmDialog.this.closed) { + BAlarmDialog.this.update(); + try { + Thread.sleep(1000L); + } + catch (InterruptedException interruptedException) {} + } + } + }; + thread.start(); + } + + protected void doLoad() throws Exception { + System.loadLibrary("alarmDialog"); + } + + public void windowClosing(BWindowEvent bWindowEvent) { + if (!this.uncloseable) { + this.close(); + } + } + + public void open() { + if (this.closed) { + this.closed = false; + super.open(); + } + } + + public void close() { + this.tool.onAlarmDialogClosed(this); + this.closed = true; + this.releaseNativeResources(this.title); + this.setVisible(false); + super.close(); + } + + public void windowDeactivated(BWindowEvent bWindowEvent) { + if (!this.closed) { + this.setAlwaysOnTop(this.title, this.alwaysOnTop); + } + } + + public void windowActivated(BWindowEvent bWindowEvent) { + if (!this.closed) { + this.setAlwaysOnTop(this.title, this.alwaysOnTop); + } + } + + public void windowDeiconified(BWindowEvent bWindowEvent) { + if (!this.closed) { + this.setAlwaysOnTop(this.title, this.alwaysOnTop); + } + } + + public void windowIconified(BWindowEvent bWindowEvent) { + if (!this.closed) { + this.setAlwaysOnTop(this.title, this.alwaysOnTop); + if (this.alwaysOnTop) { + this.toTop(this.title); + } + } + } + + public int getPixel(BWidget bWidget, int n, int n2) { + bWidget = (BWidget)bWidget.getParent(); + while (bWidget.getParent() != null) { + Point point = new Point(bWidget.getX(), bWidget.getY()); + n = (int)((double)n + point.x); + n2 = (int)((double)n2 + point.y); + bWidget = (BWidget)bWidget.getParent(); + } + return this.getPixel(n -= 3, n2 -= 22); + } + + public void doUpdate() { + BObject bObject; + Object object; + if (this.lastAlarmRecord != null && this.lastAlarmRecordChanged) { + this.lastAlarmRecordChanged = false; + object = this.lastAlarmRecord.getSource().toString(); + bObject = this.lastAlarmRecord.getAlarmData().get("sourceName"); + if (bObject != null && !bObject.toString().equals("")) { + object = BFormat.make((String)this.lastAlarmRecord.getAlarmData().get("sourceName").toString()).format((Object)this.lastAlarmRecord); + } + this.lastAlarmSrc.setText((String)object); + this.lastAlarm.setText(this.lastAlarmRecord.getTimestamp().toString()); + this.lastAlarm.setImage(alarmImg); + String string = ""; + if (this.lastAlarmRecord.getAlarmData().get("msgText") != null) { + string = this.lastAlarmRecord.getAlarmData().get("msgText").toString(); + } + this.lastAlarmMsg.setText(lexicon.getText(BFormat.make((String)string).format((Object)this.lastAlarmRecord))); + String string2 = ""; + if (this.lastAlarmRecord.getAlarmData().get("hyperlinkOrd") != null) { + string2 = this.lastAlarmRecord.getAlarmData().get("hyperlinkOrd").toString(); + this.lastAlarmHyperlink.setText(BFormat.make((String)string2).format((Object)this.lastAlarmRecord)); + this.lastAlarmHyperlink.setOrd(BOrd.make((String)string2)); + this.lastAlarmHyperlink.setVisible(true); + this.imgLabel.setOrd(BOrd.make((String)string2)); + } else { + this.lastAlarmHyperlink.setVisible(false); + this.lastAlarmHyperlink.setOrd(BOrd.NULL); + this.imgLabel.setOrd(BOrd.NULL); + } + } + object = new Object[]{new Integer(this.acked), new Integer(this.unacked)}; + this.status.setText(lexicon.getText("portal.popup.unackedAlarms", object)); + this.updateImage(this.sourcesInAlarm); + bObject = this.getContent(); + bObject.computePreferredSize(); + this.setScreenBounds(this.getScreenBounds().x(), this.getScreenBounds().y(), bObject.getPreferredWidth() + 50.0, bObject.getPreferredHeight() + 50.0); + this.repaint(); + this.toTop(this.title); + } + + public void updateLastAlarm(BAlarmRecord bAlarmRecord) { + this.lastAlarmRecord = bAlarmRecord; + this.lastAlarmRecordChanged = true; + } + + public void updateAlarmCounts(int n, int n2, boolean bl) { + boolean bl2 = n != this.acked; + bl2 |= n2 != this.unacked; + bl2 |= bl != this.sourcesInAlarm; + this.unacked = n2; + this.acked = n; + this.sourcesInAlarm = bl; + } + + private void updateImage(BImage bImage) { + if (!this.imgLabel.getImage().equals((Object)bImage)) { + this.imgLabel.setImage(bImage); + } + } + + private void updateImage(boolean bl) { + if (!this.fullyConnected) { + this.updateImage(ALARM_GRAY); + } else if (this.unacked > 0) { + if (bl) { + this.updateImage(ALARM_RED); + } else { + this.updateImage(ALARM_GREEN); + } + } else if (this.unacked == 0 && this.acked > 0) { + this.updateImage(ALARM_YELLOW); + } else if (this.acked == 0 && this.unacked == 0) { + this.updateImage(ALARM_WHITE); + } + } + + public void doHandleHyperlink(BMouseEvent bMouseEvent) { + switch (bMouseEvent.getId()) { + case 501: { + this.fireHyperlink(this.lastAlarmHyperlink.getOrd()); + } + } + } + + public void fireHyperlink(BOrd bOrd) { + if (bOrd.isNull()) { + return; + } + this.tool.onAlarmDialogHyperlink(this, bOrd); + } + + public void setUncloseable(boolean bl) { + this.uncloseable = bl; + } + + public void setAlwaysOnTop(boolean bl) { + this.alwaysOnTop = bl; + this.setAlwaysOnTop(this.title, bl); + if (bl) { + this.toTop(this.title); + } + } + + public void setFullyConnected(boolean bl) { + this.fullyConnected = bl; + } + + public native void setAlwaysOnTop(String var1, boolean var2); + + public native void toTop(String var1); + + public native int getPixel(int var1, int var2); + + public native void releaseNativeResources(String var1); + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmExtManager.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmExtManager.java new file mode 100644 index 0000000..36b98cc --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmExtManager.java @@ -0,0 +1,654 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.ui.theme.Theme + * com.tridium.workbench.bql.filter.ColumnNameTableModel + * com.tridium.workbench.job.BJobBar + * com.tridium.workbench.util.CollectionTableModel + * javax.baja.collection.BICollection + * javax.baja.collection.BITable + * javax.baja.collection.ColumnList + * javax.baja.data.BIDataTable + * javax.baja.gx.BColor + * javax.baja.gx.BImage + * javax.baja.gx.BInsets + * javax.baja.gx.Graphics + * javax.baja.job.BJob + * javax.baja.job.BJobService + * javax.baja.naming.BOrd + * javax.baja.naming.SlotPath + * javax.baja.nre.util.IntHashMap + * javax.baja.status.BStatus + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BLink + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.Context + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BBorder + * javax.baja.ui.BDialog + * javax.baja.ui.BMenu + * javax.baja.ui.BSeparator + * javax.baja.ui.BSubMenuItem + * javax.baja.ui.BWidget + * javax.baja.ui.BWidgetShell + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.ToggleCommand + * javax.baja.ui.event.BMouseEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.table.BTable + * javax.baja.ui.table.DynamicTableModel + * javax.baja.ui.table.TableCellRenderer + * javax.baja.ui.table.TableCellRenderer$Cell + * javax.baja.ui.table.TableController + * javax.baja.ui.table.TableModel + * javax.baja.ui.table.WrapperTableModel + * javax.baja.ui.util.BTitlePane + * javax.baja.util.Lexicon + * javax.baja.workbench.BWbShell + * javax.baja.workbench.nav.menu.NavMenuUtil + * javax.baja.workbench.view.BWbComponentView + * javax.baja.workbench.view.BWbComponentView$Attachable + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.BAlarmExtStatusJob; +import com.tridium.alarm.ui.BAlarmClassFE; +import com.tridium.alarm.ui.BInstructionsFE; +import com.tridium.ui.theme.Theme; +import com.tridium.workbench.bql.filter.ColumnNameTableModel; +import com.tridium.workbench.job.BJobBar; +import com.tridium.workbench.util.CollectionTableModel; +import javax.baja.alarm.BAlarmInstructions; +import javax.baja.alarm.BAlarmService; +import javax.baja.alarm.ext.BAlarmSourceExt; +import javax.baja.alarm.ext.BAlarmState; +import javax.baja.collection.BICollection; +import javax.baja.collection.BITable; +import javax.baja.collection.ColumnList; +import javax.baja.data.BIDataTable; +import javax.baja.gx.BColor; +import javax.baja.gx.BImage; +import javax.baja.gx.BInsets; +import javax.baja.gx.Graphics; +import javax.baja.job.BJob; +import javax.baja.job.BJobService; +import javax.baja.naming.BOrd; +import javax.baja.naming.SlotPath; +import javax.baja.nre.util.IntHashMap; +import javax.baja.status.BStatus; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BLink; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.Context; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BBorder; +import javax.baja.ui.BDialog; +import javax.baja.ui.BMenu; +import javax.baja.ui.BSeparator; +import javax.baja.ui.BSubMenuItem; +import javax.baja.ui.BWidget; +import javax.baja.ui.BWidgetShell; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.ToggleCommand; +import javax.baja.ui.event.BMouseEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.table.BTable; +import javax.baja.ui.table.DynamicTableModel; +import javax.baja.ui.table.TableCellRenderer; +import javax.baja.ui.table.TableController; +import javax.baja.ui.table.TableModel; +import javax.baja.ui.table.WrapperTableModel; +import javax.baja.ui.util.BTitlePane; +import javax.baja.util.Lexicon; +import javax.baja.workbench.BWbShell; +import javax.baja.workbench.nav.menu.NavMenuUtil; +import javax.baja.workbench.view.BWbComponentView; + +public class BAlarmExtManager +extends BWbComponentView { + public static final Action updateCommands = BAlarmExtManager.newAction((int)4, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmExtManager == null ? (class$com$tridium$alarm$ui$BAlarmExtManager = BAlarmExtManager.class$("com.tridium.alarm.ui.BAlarmExtManager")) : class$com$tridium$alarm$ui$BAlarmExtManager)); + private static final String[] ATTRS = new String[]{"parent.toPathString", "toPathString", "name", "alarmState", "alarmEnable.isToOffnormal", "alarmEnable.isToFault", "alarmState.ordinal", "alarmClass", "alarmInstructions", "status"}; + private static final int[] DISPLAY = new int[]{0, 2, 3, 4, 5, 7, 8}; + private static Lexicon lex = Lexicon.make((String)"alarm"); + private BAlarmService alarmService; + private BTable table; + private BITable itable; + private CollectionTableModel collectionModel; + private ToggleCommand enableToOffnormal; + private ToggleCommand enableToFault; + private Command editAlarmClass; + private Command editInstructions; + private IntHashMap nameMap; + private BBorderPane topPane; + private BJobBar jobBar; + private BJob job; + private boolean jobComplete; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmExtManager; + static /* synthetic */ Class class$com$tridium$alarm$BAlarmExtStatusJob; + + public void updateCommands() { + this.invoke(updateCommands, null, null); + } + + public Type getType() { + return TYPE; + } + + public BAlarmExtManager() { + BEdgePane bEdgePane = new BEdgePane(); + this.jobBar = new BJobBar(); + this.attach((BWbComponentView.Attachable)this.jobBar); + BBorderPane bBorderPane = new BBorderPane((BWidget)this.jobBar, BBorder.solid, BInsets.make((double)0.0, (double)5.0, (double)0.0, (double)5.0)); + bBorderPane.setFill(Theme.widget().getWindowBackground()); + bBorderPane = new BBorderPane((BWidget)bBorderPane, BBorder.inset, BInsets.DEFAULT); + this.topPane = new BBorderPane((BWidget)bBorderPane, BInsets.make((double)0.0, (double)0.0, (double)5.0, (double)0.0)); + bEdgePane.setTop((BWidget)this.topPane); + this.topPane.setVisible(false); + this.table = new BTable(); + this.table.setController((TableController)new Controller()); + this.table.setCellRenderer((TableCellRenderer)new CellRenderer()); + bEdgePane.setCenter((BWidget)BTitlePane.makePane((String)lex.getText("alarm.alarmSourceExts"), (BTable)this.table, (String)lex.getText("alarm.exts"))); + this.setContent((BWidget)bEdgePane); + this.enableToOffnormal = new EnableToOffnormal(); + this.enableToFault = new EnableToFault(); + this.editAlarmClass = new EditAlarmClass(); + this.editInstructions = new EditInstructions(); + this.add("selectionLink", (BValue)new BLink((BComponent)this.table, (Slot)BTable.selectionModified, (Slot)updateCommands)); + this.nameMap = new IntHashMap(); + this.nameMap.put(0, (Object)"alarm.point"); + this.nameMap.put(2, (Object)"alarm.extension"); + this.nameMap.put(3, (Object)"alarm.alarmState"); + this.nameMap.put(4, (Object)"alarm.toOffnormalEnabled.label"); + this.nameMap.put(5, (Object)"alarm.toFaultEnabled.label"); + this.nameMap.put(7, (Object)"alarm.alarmClass"); + this.nameMap.put(8, (Object)"alarm.instructions"); + } + + protected void doLoadValue(BObject bObject, Context context) throws Exception { + this.alarmService = (BAlarmService)bObject; + this.updateTable(); + this.table.fireTableModified(null); + } + + private void updateTable() { + BOrd bOrd = ((BWbShell)this.getShell()).getActiveOrd(); + BOrd bOrd2 = BOrd.make((BOrd)bOrd, (String)this.query()).normalize(); + this.itable = ((BICollection)bOrd2.resolve().get()).toTable(); + boolean bl = false; + int n = -1; + boolean bl2 = true; + if (this.table.getModel() instanceof AlarmExtTableModel) { + bl = true; + n = ((AlarmExtTableModel)this.table.getModel()).sortCol; + bl2 = ((AlarmExtTableModel)this.table.getModel()).sortAsc; + } + this.collectionModel = new CollectionTableModel(this.itable, this.getCurrentContext()); + ColumnNameTableModel columnNameTableModel = new ColumnNameTableModel((TableModel)this.collectionModel, this.nameMap, lex); + AlarmExtTableModel alarmExtTableModel = new AlarmExtTableModel((TableModel)columnNameTableModel, DISPLAY); + alarmExtTableModel.setColumnShowable(1, false); + alarmExtTableModel.setColumnShowable(6, false); + if (bl && n != -1) { + alarmExtTableModel.sortByColumn(n, bl2); + } + this.table.setModel((TableModel)alarmExtTableModel); + this.table.relayout(); + } + + private String query() { + StringBuffer stringBuffer = new StringBuffer(128); + stringBuffer.append("station:|slot:/|bql:select "); + for (int i = 0; i < ATTRS.length; ++i) { + if (i != 0) { + stringBuffer.append(", "); + } + stringBuffer.append(ATTRS[i]); + } + stringBuffer.append(" from alarm:AlarmSourceExt"); + return stringBuffer.toString(); + } + + public void doUpdateCommands() { + } + + public BOrd[] getSelectedOrds() { + int[] nArray = this.table.getSelection().getRows(); + int n = nArray.length; + BOrd[] bOrdArray = new BOrd[n]; + for (int i = 0; i < n; ++i) { + String string = this.itable.getString(nArray[i], this.itable.getColumns().get("toPathString")); + bOrdArray[i] = BOrd.make((String)("station:|slot:" + string)).normalize(); + } + return bOrdArray; + } + + public BAlarmSourceExt getExtensionForRow(int n) { + String string = this.collectionModel.getValueAt(n, 1).toString(); + BOrd bOrd = ((BWbShell)this.getShell()).getActiveOrd(); + BOrd bOrd2 = BOrd.make((BOrd)bOrd, (String)("slot:" + string)).normalize(); + return (BAlarmSourceExt)bOrd2.resolve().get(); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void enableToOffnormal() { + BWidgetShell bWidgetShell; + BOrd[] bOrdArray = this.getSelectedOrds(); + if (bOrdArray.length == 0) { + return; + } + BOrd bOrd = ((BWbShell)this.getShell()).getActiveOrd(); + BOrd bOrd2 = BOrd.make((BOrd)bOrd, (String)"service:baja:JobService"); + BJobService bJobService = (BJobService)bOrd2.resolve().get(); + bJobService.lease(); + BAlarmExtStatusJob[] bAlarmExtStatusJobArray = (BAlarmExtStatusJob[])bJobService.getChildren(class$com$tridium$alarm$BAlarmExtStatusJob == null ? (class$com$tridium$alarm$BAlarmExtStatusJob = BAlarmExtManager.class$("com.tridium.alarm.BAlarmExtStatusJob")) : class$com$tridium$alarm$BAlarmExtStatusJob); + if (bAlarmExtStatusJobArray != null) { + for (int i = 0; i < bAlarmExtStatusJobArray.length; ++i) { + if (bAlarmExtStatusJobArray[i] == null) continue; + bAlarmExtStatusJobArray[i].lease(); + if (!bAlarmExtStatusJobArray[i].isAlive()) continue; + BDialog.error((BWidget)this, (String)lex.getText("alarmExtManager.commandFail"), (Object)lex.getText("alarmExtManager.statusJobExists")); + return; + } + } + if (!this.topPane.isVisible()) { + this.topPane.setVisible(true); + this.topPane.getParentWidget().relayout(); + } + if ((bWidgetShell = this.getShell()) != null) { + bWidgetShell.enterBusy(); + } + try { + BOrd bOrd3 = BOrd.make((BOrd)bOrd, (String)"service:alarm:AlarmService"); + BAlarmService bAlarmService = (BAlarmService)bOrd3.resolve().get(); + BVector bVector = new BVector(); + for (int i = 0; i < bOrdArray.length; ++i) { + bVector.add("o" + i, (BValue)bOrdArray[i]); + } + if (this.enableToOffnormal.isSelected()) { + this.setJob(bAlarmService.enableToOffnormal(bVector), bAlarmService); + } else { + this.setJob(bAlarmService.disableToOffnormal(bVector), bAlarmService); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + finally { + if (bWidgetShell != null) { + bWidgetShell.exitBusy(); + } + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void enableToFault() { + BWidgetShell bWidgetShell; + BOrd[] bOrdArray = this.getSelectedOrds(); + if (bOrdArray.length == 0) { + return; + } + BOrd bOrd = ((BWbShell)this.getShell()).getActiveOrd(); + BOrd bOrd2 = BOrd.make((BOrd)bOrd, (String)"service:baja:JobService"); + BJobService bJobService = (BJobService)bOrd2.resolve().get(); + bJobService.lease(); + BAlarmExtStatusJob[] bAlarmExtStatusJobArray = (BAlarmExtStatusJob[])bJobService.getChildren(class$com$tridium$alarm$BAlarmExtStatusJob == null ? (class$com$tridium$alarm$BAlarmExtStatusJob = BAlarmExtManager.class$("com.tridium.alarm.BAlarmExtStatusJob")) : class$com$tridium$alarm$BAlarmExtStatusJob); + if (bAlarmExtStatusJobArray != null) { + for (int i = 0; i < bAlarmExtStatusJobArray.length; ++i) { + if (bAlarmExtStatusJobArray[i] == null) continue; + bAlarmExtStatusJobArray[i].lease(); + if (!bAlarmExtStatusJobArray[i].isAlive()) continue; + BDialog.error((BWidget)this, (String)lex.getText("alarmExtManager.commandFail"), (Object)lex.getText("alarmExtManager.statusJobExists")); + return; + } + } + if (!this.topPane.isVisible()) { + this.topPane.setVisible(true); + this.topPane.getParentWidget().relayout(); + } + if ((bWidgetShell = this.getShell()) != null) { + bWidgetShell.enterBusy(); + } + try { + BOrd bOrd3 = BOrd.make((BOrd)bOrd, (String)"service:alarm:AlarmService"); + BAlarmService bAlarmService = (BAlarmService)bOrd3.resolve().get(); + BVector bVector = new BVector(); + for (int i = 0; i < bOrdArray.length; ++i) { + bVector.add("o" + i, (BValue)bOrdArray[i]); + } + if (this.enableToOffnormal.isSelected()) { + this.setJob(bAlarmService.enableToFault(bVector), bAlarmService); + } else { + this.setJob(bAlarmService.disableToFault(bVector), bAlarmService); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + finally { + if (bWidgetShell != null) { + bWidgetShell.exitBusy(); + } + } + } + + private BJob getJob() { + return this.job; + } + + private void setJob(BJob bJob) { + this.job = bJob; + this.jobComplete = false; + this.registerForComponentEvents((BComponent)bJob); + this.jobBar.load(bJob); + if (bJob != null && bJob.getJobState().isComplete() && !this.jobComplete) { + this.jobComplete = true; + this.jobComplete(bJob); + } + } + + private void setJob(BOrd bOrd, BAlarmService bAlarmService) throws Exception { + bAlarmService.getComponentSpace().sync(); + BJob bJob = (BJob)bOrd.get((BObject)bAlarmService); + this.setJob(bJob); + } + + private void jobComplete(BJob bJob) { + this.updateTable(); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public class AlarmExtTableModel + extends DynamicTableModel { + public int sortCol = -1; + public boolean sortAsc = true; + + public AlarmExtTableModel(TableModel tableModel, int[] nArray) { + super(tableModel, nArray); + } + + public AlarmExtTableModel(TableModel tableModel) { + super(tableModel); + } + + public void sortByColumn(int n, boolean bl) { + this.sortCol = n; + this.sortAsc = bl; + super.sortByColumn(n, bl); + } + + public Object getValueAt(int n, int n2) { + Object object = super.getValueAt(n, n2); + if (this.toRootColumnIndex(n2) == 7) { + try { + return BAlarmExtManager.this.alarmService.getAlarmClassDisplayName(BString.make((String)object.toString()), null).toString(); + } + catch (Exception exception) { + return object.toString(); + } + } + if (object instanceof String) { + object = SlotPath.unescape((String)((String)object)); + } + return object; + } + } + + public class GotoPoint + extends Goto { + public GotoPoint(int n, BITable bITable) { + super("alarmExtManager.goto.point", n, bITable); + } + + public BOrd getTargetOrd() { + return BOrd.make((String)("slot:" + BAlarmExtManager.this.collectionModel.getValueAt(this.row, 0))); + } + } + + public abstract class Goto + extends Command { + int row; + BITable itable; + + public Goto(String string, int n, BITable bITable) { + super((BWidget)BAlarmExtManager.this, Sys.getModuleForClass((Class)(class$com$tridium$alarm$ui$BAlarmExtManager == null ? (class$com$tridium$alarm$ui$BAlarmExtManager = BAlarmExtManager.class$("com.tridium.alarm.ui.BAlarmExtManager")) : class$com$tridium$alarm$ui$BAlarmExtManager)), string); + this.row = n; + this.itable = bITable; + } + + public abstract BOrd getTargetOrd(); + + public CommandArtifact doInvoke() { + BOrd bOrd = this.getTargetOrd(); + if (bOrd == null) { + return null; + } + BOrd bOrd2 = ((BWbShell)BAlarmExtManager.this.getShell()).getActiveOrd(); + BOrd bOrd3 = BOrd.make((BOrd)bOrd2, (BOrd)bOrd).normalize(); + ((BWbShell)this.getShell()).hyperlink(bOrd3); + return null; + } + } + + private class CellRenderer + extends TableCellRenderer { + BIDataTable lastTable = null; + int stateOrdCol = -1; + + private CellRenderer() { + } + + protected void paintCellBackground(Graphics graphics, TableCellRenderer.Cell cell) { + if (cell.selected) { + super.paintCellBackground(graphics, cell); + return; + } + try { + ColumnList columnList = BAlarmExtManager.this.itable.getColumns(); + if (BAlarmExtManager.this.itable != this.lastTable || this.stateOrdCol == -1) { + this.stateOrdCol = columnList.indexOf("alarmState.ordinal"); + } + BColor bColor = null; + BColor bColor2 = null; + TableModel tableModel = BAlarmExtManager.this.table.getModel(); + if (!(tableModel instanceof WrapperTableModel)) { + super.paintCellBackground(graphics, cell); + return; + } + int n = Integer.parseInt(((WrapperTableModel)tableModel).getRootModel().getValueAt(cell.row, this.stateOrdCol).toString()); + if (n != BAlarmState.normal.getOrdinal()) { + if (n == BAlarmState.fault.getOrdinal()) { + bColor = (BColor)BStatus.faultBg; + bColor2 = (BColor)BStatus.faultFg; + } else { + bColor = (BColor)BStatus.alarmBg; + bColor2 = (BColor)BStatus.alarmFg; + } + } + if (bColor != null) { + graphics.setBrush(bColor); + graphics.fillRect(0.0, 0.0, cell.width, cell.height); + graphics.setBrush(bColor2); + } else { + graphics.setBrush(Theme.table().getTextBrush()); + } + graphics.setFont(Theme.table().getCellFont()); + } + catch (ClassCastException classCastException) { + super.paintCellBackground(graphics, cell); + } + catch (NullPointerException nullPointerException) { + super.paintCellBackground(graphics, cell); + } + } + } + + private class Controller + extends TableController { + private Controller() { + } + + protected void cellDoubleClicked(BMouseEvent bMouseEvent, int n, int n2) { + ColumnList columnList = BAlarmExtManager.this.itable.getColumns(); + BOrd bOrd = null; + String string = BAlarmExtManager.this.collectionModel.getValueAt(n, 1).toString(); + BOrd bOrd2 = ((BWbShell)this.getShell()).getActiveOrd(); + bOrd = BOrd.make((BOrd)bOrd2, (String)("slot:" + string)).normalize(); + if (bOrd != null) { + ((BWbShell)this.getShell()).hyperlink(bOrd); + } + } + + protected void cellPopup(BMouseEvent bMouseEvent, int n, int n2) { + ColumnList columnList = BAlarmExtManager.this.itable.getColumns(); + String string = BAlarmExtManager.this.collectionModel.getValueAt(n, 1).toString(); + BOrd bOrd = ((BWbShell)this.getShell()).getActiveOrd(); + BOrd bOrd2 = BOrd.make((BOrd)bOrd, (String)("slot:" + string)).normalize(); + BComponent bComponent = (BComponent)bOrd2.get(); + BMenu bMenu = new BMenu(); + bMenu.add(null, (BValue)new BSubMenuItem(NavMenuUtil.makeViewsMenu((BWidget)this.getTable(), (BObject)bComponent))); + bMenu.add(null, (BValue)new BSubMenuItem(NavMenuUtil.makeActionsMenu((BWidget)this.getTable(), (BComponent)bComponent))); + bMenu.add(null, (BValue)new BSeparator()); + bMenu.add(null, (Command)new GotoPoint(n, BAlarmExtManager.this.itable)); + bMenu.add(null, (BValue)new BSeparator()); + if (BAlarmExtManager.this.table.getModel().getSelection().getRows().length == 1) { + BAlarmExtManager.this.enableToOffnormal.setSelected(BAlarmExtManager.this.itable.getBoolean(n, columnList.get("alarmEnable.isToOffnormal"))); + BAlarmExtManager.this.enableToFault.setSelected(BAlarmExtManager.this.itable.getBoolean(n, columnList.get("alarmEnable.isToFault"))); + } + bMenu.add("toOffnormal", (Command)BAlarmExtManager.this.enableToOffnormal); + bMenu.add("toFault", (Command)BAlarmExtManager.this.enableToFault); + bMenu.add("editAlarmClass", BAlarmExtManager.this.editAlarmClass); + bMenu.add("editInstructions", BAlarmExtManager.this.editInstructions); + bMenu.open((BWidget)this.getTable(), bMouseEvent.getX(), bMouseEvent.getY()); + } + } + + public class EditInstructions + extends Command { + public EditInstructions() { + super((BWidget)BAlarmExtManager.this, Sys.getModuleForClass((Class)(class$com$tridium$alarm$ui$BAlarmExtManager == null ? (class$com$tridium$alarm$ui$BAlarmExtManager = BAlarmExtManager.class$("com.tridium.alarm.ui.BAlarmExtManager")) : class$com$tridium$alarm$ui$BAlarmExtManager)), "alarm.editInstructions"); + } + + public CommandArtifact doInvoke() { + Object object; + int[] nArray = BAlarmExtManager.this.table.getSelection().getRows(); + BAlarmInstructions bAlarmInstructions = BAlarmInstructions.NULL; + if (nArray.length == 1) { + object = BAlarmExtManager.this.getExtensionForRow(nArray[0]); + object.lease(); + bAlarmInstructions = ((BAlarmSourceExt)object).getAlarmInstructions(); + } + object = new BInstructionsFE(); + BAlarmExtManager.this.add("temp", (BValue)object); + object.loadValue((BObject)bAlarmInstructions, null); + BAlarmExtManager.this.remove("temp"); + int n = BDialog.open((BWidget)BAlarmExtManager.this, (String)lex.get("alarm.editAlarmClass.label"), (Object)object, (int)3, (BImage)null); + if (n == 1) { + try { + bAlarmInstructions = (BAlarmInstructions)object.saveValue((BObject)bAlarmInstructions, null); + for (int i = 0; i < nArray.length; ++i) { + BAlarmSourceExt bAlarmSourceExt = BAlarmExtManager.this.getExtensionForRow(nArray[i]); + bAlarmSourceExt.lease(); + bAlarmSourceExt.setAlarmInstructions(bAlarmInstructions); + } + } + catch (Exception exception) { + // empty catch block + } + BAlarmExtManager.this.updateTable(); + } + return null; + } + } + + public class EditAlarmClass + extends Command { + public EditAlarmClass() { + super((BWidget)BAlarmExtManager.this, Sys.getModuleForClass((Class)(class$com$tridium$alarm$ui$BAlarmExtManager == null ? (class$com$tridium$alarm$ui$BAlarmExtManager = BAlarmExtManager.class$("com.tridium.alarm.ui.BAlarmExtManager")) : class$com$tridium$alarm$ui$BAlarmExtManager)), "alarm.editAlarmClass"); + } + + public CommandArtifact doInvoke() { + Object object; + int[] nArray = BAlarmExtManager.this.table.getSelection().getRows(); + String string = ""; + if (nArray.length == 1) { + object = BAlarmExtManager.this.getExtensionForRow(nArray[0]); + object.lease(); + string = ((BAlarmSourceExt)object).getAlarmClass(); + } + object = new BAlarmClassFE(); + BAlarmExtManager.this.add("temp", (BValue)object); + object.loadValue((BObject)BString.make((String)string), null); + BAlarmExtManager.this.remove("temp"); + int n = BDialog.open((BWidget)BAlarmExtManager.this, (String)lex.get("alarm.editAlarmClass.label"), (Object)object, (int)3, (BImage)null); + if (n == 1) { + try { + string = object.saveValue((BObject)BString.make((String)string), null).toString(); + for (int i = 0; i < nArray.length; ++i) { + BAlarmSourceExt bAlarmSourceExt = BAlarmExtManager.this.getExtensionForRow(nArray[i]); + bAlarmSourceExt.lease(); + bAlarmSourceExt.setAlarmClass(string); + } + } + catch (Exception exception) { + // empty catch block + } + BAlarmExtManager.this.updateTable(); + } + return null; + } + } + + public class EnableToFault + extends ToggleCommand { + public EnableToFault() { + super((BWidget)BAlarmExtManager.this, Sys.getModuleForClass((Class)(class$com$tridium$alarm$ui$BAlarmExtManager == null ? (class$com$tridium$alarm$ui$BAlarmExtManager = BAlarmExtManager.class$("com.tridium.alarm.ui.BAlarmExtManager")) : class$com$tridium$alarm$ui$BAlarmExtManager)), "alarm.toFaultEnabled"); + } + + public CommandArtifact doInvoke() { + BAlarmExtManager.this.enableToFault(); + return null; + } + } + + public class EnableToOffnormal + extends ToggleCommand { + public EnableToOffnormal() { + super((BWidget)BAlarmExtManager.this, Sys.getModuleForClass((Class)(class$com$tridium$alarm$ui$BAlarmExtManager == null ? (class$com$tridium$alarm$ui$BAlarmExtManager = BAlarmExtManager.class$("com.tridium.alarm.ui.BAlarmExtManager")) : class$com$tridium$alarm$ui$BAlarmExtManager)), "alarm.toOffnormalEnabled"); + } + + public CommandArtifact doInvoke() { + BAlarmExtManager.this.enableToOffnormal(); + return null; + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmInstructionsManager.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmInstructionsManager.java new file mode 100644 index 0000000..d9d7bd5 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmInstructionsManager.java @@ -0,0 +1,592 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.collection.BICollection + * javax.baja.collection.BITable + * javax.baja.collection.Column + * javax.baja.naming.BOrd + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.enums.BHalign + * javax.baja.ui.enums.BOrientation + * javax.baja.ui.enums.BValign + * javax.baja.ui.event.BKeyEvent + * javax.baja.ui.event.BMouseEvent + * javax.baja.ui.list.BList + * javax.baja.ui.list.ListController + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.pane.BSplitPane + * javax.baja.ui.table.BTable + * javax.baja.ui.table.DefaultTableModel + * javax.baja.ui.table.DynamicTableModel + * javax.baja.ui.table.TableController + * javax.baja.ui.table.TableModel + * javax.baja.ui.table.TableSelection + * javax.baja.ui.util.BTitlePane + * javax.baja.ui.util.UiLexicon + * javax.baja.util.BFormat + * javax.baja.workbench.BWbShell + * javax.baja.workbench.view.BWbComponentView + */ +package com.tridium.alarm.ui; + +import java.util.Hashtable; +import javax.baja.alarm.BAlarmInstructions; +import javax.baja.alarm.BAlarmService; +import javax.baja.alarm.BAlarmSourceInfo; +import javax.baja.alarm.ext.BAlarmSourceExt; +import javax.baja.collection.BICollection; +import javax.baja.collection.BITable; +import javax.baja.collection.Column; +import javax.baja.naming.BOrd; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.enums.BOrientation; +import javax.baja.ui.enums.BValign; +import javax.baja.ui.event.BKeyEvent; +import javax.baja.ui.event.BMouseEvent; +import javax.baja.ui.list.BList; +import javax.baja.ui.list.ListController; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.pane.BSplitPane; +import javax.baja.ui.table.BTable; +import javax.baja.ui.table.DefaultTableModel; +import javax.baja.ui.table.DynamicTableModel; +import javax.baja.ui.table.TableController; +import javax.baja.ui.table.TableModel; +import javax.baja.ui.table.TableSelection; +import javax.baja.ui.util.BTitlePane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.util.BFormat; +import javax.baja.workbench.BWbShell; +import javax.baja.workbench.view.BWbComponentView; + +public class BAlarmInstructionsManager +extends BWbComponentView { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmInstructionsManager == null ? (class$com$tridium$alarm$ui$BAlarmInstructionsManager = BAlarmInstructionsManager.class$("com.tridium.alarm.ui.BAlarmInstructionsManager")) : class$com$tridium$alarm$ui$BAlarmInstructionsManager)); + protected BAlarmService alarmService; + protected Context cx; + protected Model model; + protected BTable table; + protected BList instructionList; + protected BList masterList; + Command mAddCmd; + Command mRemoveCmd; + Command mEditCmd; + Command mSaveCmd; + Command saveCmd; + Command addFromMasterCmd; + Command addCmd; + Command removeCmd; + Command moveUpCmd; + Command moveDownCmd; + Command editCmd; + Hashtable instructions = new Hashtable(); + public static final UiLexicon lexicon = new UiLexicon(class$com$tridium$alarm$ui$BAlarmInstructionsManager == null ? (class$com$tridium$alarm$ui$BAlarmInstructionsManager = BAlarmInstructionsManager.class$("com.tridium.alarm.ui.BAlarmInstructionsManager")) : class$com$tridium$alarm$ui$BAlarmInstructionsManager); + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmInstructionsManager; + static /* synthetic */ Class class$javax$baja$alarm$BAlarmSourceInfo; + + public Type getType() { + return TYPE; + } + + public BAlarmInstructionsManager() { + this.addCmd = new Command((BWidget)this, BAlarmInstructionsManager.lexicon.module, "commands.addMsg"){ + + public CommandArtifact doInvoke() { + String string = BDialog.prompt((BWidget)BAlarmInstructionsManager.this, (String)"Add", (String)"", (int)40); + if (string != null) { + BAlarmInstructionsManager.this.instructionList.addItem((Object)BString.make((String)string)); + BAlarmInstructionsManager.this.saveCmd.setEnabled(true); + } + return null; + } + }; + this.removeCmd = new Command((BWidget)this, BAlarmInstructionsManager.lexicon.module, "commands.removeMsg"){ + + public CommandArtifact doInvoke() { + BAlarmInstructionsManager.this.instructionList.removeSelectedItems(); + BAlarmInstructionsManager.this.saveCmd.setEnabled(true); + return null; + } + }; + this.removeCmd.setEnabled(false); + this.editCmd = new Command((BWidget)this, BAlarmInstructionsManager.lexicon.module, "commands.editMsg"){ + + public CommandArtifact doInvoke() { + if (BAlarmInstructionsManager.this.instructionList.getSelectedItem() == null) { + return null; + } + String string = BDialog.prompt((BWidget)BAlarmInstructionsManager.this, (String)"Edit", (String)BAlarmInstructionsManager.this.instructionList.getSelectedItem().toString(), (int)40); + if (string != null) { + BAlarmInstructionsManager.this.instructionList.setItem(BAlarmInstructionsManager.this.instructionList.getSelectedIndex(), (Object)BString.make((String)string)); + BAlarmInstructionsManager.this.saveCmd.setEnabled(true); + } + return null; + } + }; + this.editCmd.setEnabled(false); + this.moveUpCmd = new Command((BWidget)this, BAlarmInstructionsManager.lexicon.module, "commands.moveUp"){ + + public CommandArtifact doInvoke() { + int n = BAlarmInstructionsManager.this.instructionList.getSelectedIndex(); + if (n > 0) { + Object object = BAlarmInstructionsManager.this.instructionList.getItem(n); + Object object2 = BAlarmInstructionsManager.this.instructionList.getItem(n - 1); + BAlarmInstructionsManager.this.instructionList.setItem(n, object2); + BAlarmInstructionsManager.this.instructionList.setItem(n - 1, object); + BAlarmInstructionsManager.this.instructionList.getSelection().deselectAll(); + BAlarmInstructionsManager.this.instructionList.getSelection().select(n - 1); + BAlarmInstructionsManager.this.saveCmd.setEnabled(true); + } + return null; + } + }; + this.moveUpCmd.setEnabled(false); + this.moveDownCmd = new Command((BWidget)this, BAlarmInstructionsManager.lexicon.module, "commands.moveDown"){ + + public CommandArtifact doInvoke() { + int n = BAlarmInstructionsManager.this.instructionList.getSelectedIndex(); + if (n < BAlarmInstructionsManager.this.instructionList.getItemCount() - 1) { + Object object = BAlarmInstructionsManager.this.instructionList.getItem(n); + Object object2 = BAlarmInstructionsManager.this.instructionList.getItem(n + 1); + BAlarmInstructionsManager.this.instructionList.setItem(n, object2); + BAlarmInstructionsManager.this.instructionList.setItem(n + 1, object); + BAlarmInstructionsManager.this.instructionList.getSelection().deselectAll(); + BAlarmInstructionsManager.this.instructionList.getSelection().select(n + 1); + BAlarmInstructionsManager.this.saveCmd.setEnabled(true); + } + return null; + } + }; + this.moveDownCmd.setEnabled(false); + this.saveCmd = new Command((BWidget)this, UiLexicon.bajaui.module, "commands.save"){ + + public CommandArtifact doInvoke() { + int[] nArray = BAlarmInstructionsManager.this.table.getSelection().getRows(); + for (int i = 0; i < nArray.length; ++i) { + BAlarmInstructions bAlarmInstructions = ((Controller)BAlarmInstructionsManager.this.table.getController()).getInstructions(nArray[i]); + BFormat[] bFormatArray = new BFormat[BAlarmInstructionsManager.this.instructionList.getItemCount()]; + for (int j = 0; j < BAlarmInstructionsManager.this.instructionList.getItemCount(); ++j) { + bFormatArray[j] = BFormat.make((String)BAlarmInstructionsManager.this.instructionList.getItem(j).toString()); + } + bAlarmInstructions = BAlarmInstructions.make(bFormatArray); + ((Controller)BAlarmInstructionsManager.this.table.getController()).setInstructions(nArray[i], bAlarmInstructions); + } + BAlarmInstructionsManager.this.saveCmd.setEnabled(false); + return null; + } + }; + this.saveCmd.setEnabled(false); + this.addFromMasterCmd = new Command((BWidget)this, BAlarmInstructionsManager.lexicon.module, "commands.addFromMaster"){ + + public CommandArtifact doInvoke() { + Object[] objectArray = BAlarmInstructionsManager.this.masterList.getSelectedItems(); + for (int i = 0; i < objectArray.length; ++i) { + BAlarmInstructionsManager.this.instructionList.addItem((Object)((BFormat)objectArray[i])); + BAlarmInstructionsManager.this.saveCmd.setEnabled(true); + } + return null; + } + }; + this.addFromMasterCmd.setEnabled(false); + this.mAddCmd = new Command((BWidget)this, BAlarmInstructionsManager.lexicon.module, "commands.addMsg"){ + + public CommandArtifact doInvoke() { + String string = BDialog.prompt((BWidget)BAlarmInstructionsManager.this, (String)"Add", (String)"", (int)40); + if (string != null) { + BAlarmInstructionsManager.this.masterList.addItem((Object)BFormat.make((String)string)); + BAlarmInstructionsManager.this.setModified(); + BAlarmInstructionsManager.this.mSaveCmd.setEnabled(true); + } + return null; + } + }; + this.mRemoveCmd = new Command((BWidget)this, BAlarmInstructionsManager.lexicon.module, "commands.removeMsg"){ + + public CommandArtifact doInvoke() { + BAlarmInstructionsManager.this.masterList.removeSelectedItems(); + BAlarmInstructionsManager.this.setModified(); + BAlarmInstructionsManager.this.mSaveCmd.setEnabled(true); + return null; + } + }; + this.mRemoveCmd.setEnabled(false); + this.mEditCmd = new Command((BWidget)this, BAlarmInstructionsManager.lexicon.module, "commands.editMsg"){ + + public CommandArtifact doInvoke() { + if (BAlarmInstructionsManager.this.masterList.getSelectedItem() == null) { + return null; + } + String string = BDialog.prompt((BWidget)BAlarmInstructionsManager.this, (String)"Edit", (String)BAlarmInstructionsManager.this.masterList.getSelectedItem().toString(), (int)40); + if (string != null) { + BAlarmInstructionsManager.this.masterList.setItem(BAlarmInstructionsManager.this.masterList.getSelectedIndex(), (Object)BFormat.make((String)string)); + BAlarmInstructionsManager.this.setModified(); + BAlarmInstructionsManager.this.mSaveCmd.setEnabled(true); + } + return null; + } + }; + this.mEditCmd.setEnabled(false); + this.mSaveCmd = new Command((BWidget)this, UiLexicon.bajaui.module, "commands.save"){ + + public CommandArtifact doInvoke() throws Exception { + BAlarmInstructionsManager.this.saveValue(); + BAlarmInstructionsManager.this.mSaveCmd.setEnabled(false); + return null; + } + }; + this.mSaveCmd.setEnabled(false); + BSplitPane bSplitPane = new BSplitPane(BOrientation.vertical, 50.0); + BEdgePane bEdgePane = new BEdgePane(); + this.instructionList = new BList(); + this.instructionList.setController((ListController)new InstListController()); + BGridPane bGridPane = new BGridPane(1); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setValign(BValign.top); + bGridPane.add(null, (BValue)new BButton(this.addCmd)); + bGridPane.add(null, (BValue)new BButton(this.removeCmd)); + bGridPane.add(null, (BValue)new BButton(this.editCmd)); + bGridPane.add(null, (BValue)new BButton(this.saveCmd)); + bGridPane.add(null, (BValue)new BLabel("")); + bGridPane.add(null, (BValue)new BButton(this.moveUpCmd)); + bGridPane.add(null, (BValue)new BButton(this.moveDownCmd)); + bEdgePane.setCenter((BWidget)this.instructionList); + bEdgePane.setRight((BWidget)bGridPane); + BGridPane bGridPane2 = new BGridPane(1); + bGridPane2.add(null, (BValue)new BButton(this.addFromMasterCmd)); + bEdgePane.setBottom((BWidget)bGridPane2); + bSplitPane.setWidget1((BWidget)new BTitlePane("Point Instructions", (BWidget)bEdgePane)); + BEdgePane bEdgePane2 = new BEdgePane(); + this.masterList = new BList(); + this.masterList.setController((ListController)new MasterListController()); + BGridPane bGridPane3 = new BGridPane(1); + bGridPane3.setColumnAlign(BHalign.fill); + bGridPane3.setValign(BValign.top); + bGridPane3.add(null, (BValue)new BButton(this.mAddCmd)); + bGridPane3.add(null, (BValue)new BButton(this.mRemoveCmd)); + bGridPane3.add(null, (BValue)new BButton(this.mEditCmd)); + bGridPane3.add(null, (BValue)new BButton(this.mSaveCmd)); + bEdgePane2.setCenter((BWidget)this.masterList); + bEdgePane2.setRight((BWidget)bGridPane3); + bSplitPane.setWidget2((BWidget)new BTitlePane("Master Instructions List", (BWidget)bEdgePane2)); + this.table = new BTable(); + this.table.setController((TableController)new Controller()); + BSplitPane bSplitPane2 = new BSplitPane(BOrientation.horizontal, 35.0); + bSplitPane2.setWidget1((BWidget)new BTitlePane("Points", (BWidget)this.table)); + bSplitPane2.setWidget2((BWidget)bSplitPane); + this.setContent((BWidget)new BBorderPane((BWidget)bSplitPane2)); + } + + public void doLoadValue(BObject bObject, Context context) { + System.out.println("start"); + this.alarmService = (BAlarmService)bObject; + this.cx = context; + this.model = new Model(); + this.table.setModel((TableModel)new DynamicTableModel((TableModel)this.model, new int[]{0, 1})); + this.table.setController((TableController)new Controller()); + new Thread(){ + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void run() { + BAlarmInstructionsManager.this.enterBusy(); + try { + BAlarmInstructionsManager.this.alarmService.lease(); + BAlarmInstructions bAlarmInstructions = BAlarmInstructionsManager.this.alarmService.getMasterAlarmInstructions(); + for (int i = 0; i < bAlarmInstructions.size(); ++i) { + BAlarmInstructionsManager.this.masterList.addItem((Object)bAlarmInstructions.get(i)); + } + BObject[] bObjectArray = BAlarmInstructionsManager.this.queryPoints(); + for (int i = 0; i < bObjectArray.length; ++i) { + try { + BComponent bComponent = (BComponent)bObjectArray[i]; + bComponent.lease(); + Property[] propertyArray = bComponent.getPropertiesArray(); + for (int j = 0; j < propertyArray.length; ++j) { + Property property = propertyArray[j]; + if (property.getType().equals(BAlarmInstructions.TYPE)) { + BAlarmInstructionsManager.this.model.addRow(bComponent, property); + continue; + } + if (!property.getType().equals(BAlarmSourceInfo.TYPE)) continue; + BAlarmInstructionsManager.this.model.addRow(bComponent, property); + } + continue; + } + catch (Exception exception) { + // empty catch block + } + } + } + finally { + BAlarmInstructionsManager.this.exitBusy(); + BAlarmInstructionsManager.this.table.sizeColumnsToFit(); + } + } + }.start(); + } + + protected BObject[] queryPoints() { + BOrd bOrd = ((BWbShell)this.getShell()).getActiveOrd(); + BOrd bOrd2 = BOrd.make((BOrd)bOrd, (String)"station:|slot:/|bql:select slotPath from alarm:IAlarmSource").normalize(); + BITable bITable = ((BICollection)bOrd2.resolve().get()).toTable(); + Column column = bITable.getColumns().get(0); + BObject[] bObjectArray = new BObject[bITable.size()]; + for (int i = 0; i < bITable.size(); ++i) { + BOrd bOrd3 = BOrd.make((String)bITable.getString(i, column)); + bObjectArray[i] = bOrd3.resolve((BObject)this.alarmService).get(); + } + return bObjectArray; + } + + public BObject doSaveValue(BObject bObject, Context context) { + BAlarmService bAlarmService = (BAlarmService)bObject; + BFormat[] bFormatArray = new BFormat[this.masterList.getItemCount()]; + for (int i = 0; i < this.masterList.getItemCount(); ++i) { + bFormatArray[i] = BFormat.make((String)this.masterList.getItem(i).toString()); + } + bAlarmService.setMasterAlarmInstructions(BAlarmInstructions.make(bFormatArray)); + return bAlarmService; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + class MasterListController + extends ListController { + MasterListController() { + } + + public void keyReleased(BKeyEvent bKeyEvent) { + super.keyReleased(bKeyEvent); + this.enabledCommands(); + } + + public void mouseReleased(BMouseEvent bMouseEvent) { + super.mouseReleased(bMouseEvent); + this.enabledCommands(); + } + + protected void enabledCommands() { + int n = this.getList().getSelection().getItemCount(); + if (n > 0) { + BAlarmInstructionsManager.this.addFromMasterCmd.setEnabled(true); + BAlarmInstructionsManager.this.mRemoveCmd.setEnabled(true); + BAlarmInstructionsManager.this.mEditCmd.setEnabled(true); + } else { + BAlarmInstructionsManager.this.addFromMasterCmd.setEnabled(false); + BAlarmInstructionsManager.this.mRemoveCmd.setEnabled(false); + BAlarmInstructionsManager.this.mEditCmd.setEnabled(false); + } + } + } + + class InstListController + extends ListController { + InstListController() { + } + + public void keyReleased(BKeyEvent bKeyEvent) { + super.keyReleased(bKeyEvent); + this.enabledCommands(); + } + + public void mouseReleased(BMouseEvent bMouseEvent) { + super.mouseReleased(bMouseEvent); + this.enabledCommands(); + } + + protected void enabledCommands() { + int n = BAlarmInstructionsManager.this.instructionList.getSelection().getItemCount(); + if (n > 0) { + BAlarmInstructionsManager.this.removeCmd.setEnabled(true); + BAlarmInstructionsManager.this.editCmd.setEnabled(true); + if (this.getList().getItemCount() > 1) { + BAlarmInstructionsManager.this.moveUpCmd.setEnabled(true); + BAlarmInstructionsManager.this.moveDownCmd.setEnabled(true); + } else { + BAlarmInstructionsManager.this.moveUpCmd.setEnabled(false); + BAlarmInstructionsManager.this.moveDownCmd.setEnabled(false); + } + } else { + BAlarmInstructionsManager.this.removeCmd.setEnabled(false); + BAlarmInstructionsManager.this.moveUpCmd.setEnabled(false); + BAlarmInstructionsManager.this.moveDownCmd.setEnabled(false); + BAlarmInstructionsManager.this.editCmd.setEnabled(false); + } + } + } + + protected class Controller + extends TableController { + Hashtable components = new Hashtable(); + + protected Controller() { + } + + public void keyReleased(BKeyEvent bKeyEvent) { + super.keyReleased(bKeyEvent); + this.showInstructions(); + } + + public void mouseReleased(BMouseEvent bMouseEvent) { + super.mouseReleased(bMouseEvent); + this.showInstructions(); + } + + protected void setInstructions(int n, BAlarmInstructions bAlarmInstructions) { + BComponent bComponent = BAlarmInstructionsManager.this.model.getComponent(n); + bComponent.lease(); + Property property = BAlarmInstructionsManager.this.model.getProperty(n); + if (property.getType() == BAlarmInstructions.TYPE) { + bComponent.set(BAlarmInstructionsManager.this.model.getProperty(n), (BValue)bAlarmInstructions); + } else { + BAlarmSourceInfo bAlarmSourceInfo = (BAlarmSourceInfo)bComponent.get(BAlarmInstructionsManager.this.model.getProperty(n)); + bAlarmSourceInfo.lease(); + bAlarmSourceInfo.setAlarmInstructions(bAlarmInstructions); + } + } + + protected BAlarmInstructions getInstructions(int n) { + BComponent bComponent = BAlarmInstructionsManager.this.model.getComponent(n); + bComponent.lease(); + Property property = BAlarmInstructionsManager.this.model.getProperty(n); + if (property.getType() == BAlarmInstructions.TYPE) { + return (BAlarmInstructions)bComponent.get(property); + } + BAlarmSourceInfo bAlarmSourceInfo = (BAlarmSourceInfo)bComponent.get(BAlarmInstructionsManager.this.model.getProperty(n)); + bAlarmSourceInfo.lease(); + return bAlarmSourceInfo.getAlarmInstructions(); + } + + protected void showInstructions() { + TableSelection tableSelection = this.getTable().getSelection(); + BAlarmInstructionsManager.this.instructionList.getSelection().deselectAll(); + if (tableSelection.getRowCount() == 1) { + BAlarmInstructions bAlarmInstructions = this.getInstructions(tableSelection.getRow()); + BAlarmInstructionsManager.this.instructionList.removeAllItems(); + for (int i = 0; i < bAlarmInstructions.size(); ++i) { + BAlarmInstructionsManager.this.instructionList.addItem((Object)bAlarmInstructions.get(i)); + } + } else if (tableSelection.getRowCount() > 1) { + int n; + BAlarmInstructionsManager.this.instructionList.removeAllItems(); + int[] nArray = tableSelection.getRows(); + BAlarmInstructions bAlarmInstructions = null; + boolean bl = true; + for (n = 0; n < nArray.length; ++n) { + BAlarmInstructions bAlarmInstructions2 = this.getInstructions(nArray[n]); + if (bAlarmInstructions == null) { + bAlarmInstructions = (BAlarmInstructions)bAlarmInstructions2.newCopy(); + continue; + } + if (bAlarmInstructions.equivalent((Object)bAlarmInstructions2)) continue; + bl = false; + break; + } + if (bl) { + for (n = 0; n < bAlarmInstructions.size(); ++n) { + BAlarmInstructionsManager.this.instructionList.addItem((Object)bAlarmInstructions.get(n)); + } + } + } else { + return; + } + ((InstListController)BAlarmInstructionsManager.this.instructionList.getController()).enabledCommands(); + BAlarmInstructionsManager.this.saveCmd.setEnabled(false); + } + } + + protected class Model + extends DefaultTableModel { + Hashtable controllers = new Hashtable(); + + public Model() { + super(new String[]{"Point", "Condition", "Path"}); + } + + public BComponent getComponent(int n) { + return (BComponent)super.getValueAt(n, 0); + } + + public Property getProperty(int n) { + return (Property)super.getValueAt(n, 1); + } + + public Object getValueAt(int n, int n2) { + if (n2 == 2) { + try { + BComponent bComponent = this.getComponent(n); + return bComponent.toPathString(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } else { + if (n2 == 1) { + return ((Property)super.getValueAt(n, n2)).getDefaultDisplayName(BAlarmInstructionsManager.this.cx); + } + if (n2 == 0) { + BComponent bComponent = this.getComponent(n); + bComponent.lease(); + String string = bComponent.getDisplayName(BAlarmInstructionsManager.this.cx); + if (bComponent instanceof BAlarmSourceExt) { + string = ((BAlarmSourceExt)bComponent).getSourceName().format((Object)bComponent); + } else { + BAlarmSourceInfo[] bAlarmSourceInfoArray = (BAlarmSourceInfo[])bComponent.getChildren(class$javax$baja$alarm$BAlarmSourceInfo == null ? (class$javax$baja$alarm$BAlarmSourceInfo = BAlarmInstructionsManager.class$("javax.baja.alarm.BAlarmSourceInfo")) : class$javax$baja$alarm$BAlarmSourceInfo); + if (bAlarmSourceInfoArray.length > 0) { + bAlarmSourceInfoArray[0].lease(); + string = bAlarmSourceInfoArray[0].getSourceName().format((Object)bAlarmSourceInfoArray[0]); + } + } + return string; + } + } + return "???"; + } + + public void addRow(BComponent bComponent, Property property) { + BComponent bComponent2 = bComponent; + this.addRow(new Object[]{bComponent2, property, null}); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmPrioritiesFE.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmPrioritiesFE.java new file mode 100644 index 0000000..fc2b512 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmPrioritiesFE.java @@ -0,0 +1,126 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BLabel + * javax.baja.ui.BTextField + * javax.baja.ui.BWidget + * javax.baja.ui.pane.BGridPane + * javax.baja.workbench.CannotSaveException + * javax.baja.workbench.fieldeditor.BWbFieldEditor + */ +package com.tridium.alarm.ui; + +import javax.baja.alarm.BAlarmPriorities; +import javax.baja.alarm.BAlarmTransitionBits; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BLabel; +import javax.baja.ui.BTextField; +import javax.baja.ui.BWidget; +import javax.baja.ui.pane.BGridPane; +import javax.baja.workbench.CannotSaveException; +import javax.baja.workbench.fieldeditor.BWbFieldEditor; + +public class BAlarmPrioritiesFE +extends BWbFieldEditor { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmPrioritiesFE == null ? (class$com$tridium$alarm$ui$BAlarmPrioritiesFE = BAlarmPrioritiesFE.class$("com.tridium.alarm.ui.BAlarmPrioritiesFE")) : class$com$tridium$alarm$ui$BAlarmPrioritiesFE)); + static final String offnormalText = BAlarmTransitionBits.DEFAULT.getTag(1); + static final String faultText = BAlarmTransitionBits.DEFAULT.getTag(2); + static final String normalText = BAlarmTransitionBits.DEFAULT.getTag(4); + static final String alertText = BAlarmTransitionBits.DEFAULT.getTag(8); + private boolean init = false; + private BTextField offnormal; + private BTextField fault; + private BTextField normal; + private BTextField alert; + private BAlarmPriorities priorities; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmPrioritiesFE; + + public Type getType() { + return TYPE; + } + + protected void doSetReadonly(boolean bl) { + this.init = false; + if (bl) { + this.setContent((BWidget)new BTextField("", 40, false)); + } + } + + protected void doLoadValue(BObject bObject, Context context) { + BAlarmPriorities bAlarmPriorities = (BAlarmPriorities)bObject; + if (this.isReadonly()) { + ((BTextField)this.getContent()).setText(bObject.toString()); + } else { + if (!this.init) { + this.initUi(); + } + this.offnormal.setText(Integer.toString(bAlarmPriorities.getToOffnormal())); + this.fault.setText(Integer.toString(bAlarmPriorities.getToFault())); + this.normal.setText(Integer.toString(bAlarmPriorities.getToNormal())); + this.alert.setText(Integer.toString(bAlarmPriorities.getToAlert())); + this.linkTo((BComponent)this.offnormal, (Slot)BTextField.actionPerformed, (Slot)actionPerformed); + this.linkTo((BComponent)this.fault, (Slot)BTextField.actionPerformed, (Slot)actionPerformed); + this.linkTo((BComponent)this.normal, (Slot)BTextField.actionPerformed, (Slot)actionPerformed); + this.linkTo((BComponent)this.alert, (Slot)BTextField.actionPerformed, (Slot)actionPerformed); + } + } + + protected BObject doSaveValue(BObject bObject, Context context) throws CannotSaveException { + int n = Integer.parseInt(this.offnormal.getText()); + int n2 = Integer.parseInt(this.fault.getText()); + int n3 = Integer.parseInt(this.normal.getText()); + int n4 = Integer.parseInt(this.alert.getText()); + try { + return BAlarmPriorities.make(n, n2, n3, n4); + } + catch (IllegalStateException illegalStateException) { + throw new CannotSaveException(illegalStateException.getMessage()); + } + } + + private void initUi() { + this.init = true; + BGridPane bGridPane = new BGridPane(8); + bGridPane.add(null, (BValue)new BLabel(offnormalText), null); + this.offnormal = new BTextField("", 5); + bGridPane.add("offNormal", (BValue)this.offnormal, null); + bGridPane.add(null, (BValue)new BLabel(faultText), null); + this.fault = new BTextField("", 5); + bGridPane.add("fault", (BValue)this.fault, null); + bGridPane.add(null, (BValue)new BLabel(normalText), null); + this.normal = new BTextField("", 5); + bGridPane.add("normal", (BValue)this.normal, null); + bGridPane.add(null, (BValue)new BLabel(alertText), null); + this.alert = new BTextField("", 5); + bGridPane.add("alert", (BValue)this.alert, null); + this.setContent((BWidget)bGridPane); + this.linkTo("lk0", (BComponent)this.offnormal, (Slot)BTextField.textModified, (Slot)setModified); + this.linkTo("lk1", (BComponent)this.fault, (Slot)BTextField.textModified, (Slot)setModified); + this.linkTo("lk2", (BComponent)this.normal, (Slot)BTextField.textModified, (Slot)setModified); + this.linkTo("lk3", (BComponent)this.alert, (Slot)BTextField.textModified, (Slot)setModified); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmReportDialog.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmReportDialog.java new file mode 100644 index 0000000..aef250c --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmReportDialog.java @@ -0,0 +1,366 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.naming.BOrd + * javax.baja.security.BPermissions + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.LocalizableRuntimeException + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BMenu + * javax.baja.ui.BNullWidget + * javax.baja.ui.BSeparator + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BKeyEvent + * javax.baja.ui.event.BMouseEvent + * javax.baja.ui.event.BWindowEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.table.BTable + * javax.baja.ui.table.DynamicTableModel + * javax.baja.ui.table.TableController + * javax.baja.ui.table.TableSelection + * javax.baja.ui.util.UiLexicon + * javax.baja.util.Lexicon + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.ui.BAlarmClassDef; +import com.tridium.alarm.ui.BAlarmConsole; +import com.tridium.alarm.ui.BAlarmTitlePane; +import com.tridium.alarm.ui.ConsoleTableModel; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import javax.baja.alarm.BAlarmClass; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.alarm.BAlarmService; +import javax.baja.naming.BOrd; +import javax.baja.security.BPermissions; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.LocalizableRuntimeException; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BMenu; +import javax.baja.ui.BNullWidget; +import javax.baja.ui.BSeparator; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BKeyEvent; +import javax.baja.ui.event.BMouseEvent; +import javax.baja.ui.event.BWindowEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.table.BTable; +import javax.baja.ui.table.DynamicTableModel; +import javax.baja.ui.table.TableController; +import javax.baja.ui.table.TableSelection; +import javax.baja.ui.util.UiLexicon; +import javax.baja.util.Lexicon; + +public class BAlarmReportDialog +extends BDialog { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmReportDialog == null ? (class$com$tridium$alarm$ui$BAlarmReportDialog = BAlarmReportDialog.class$("com.tridium.alarm.ui.BAlarmReportDialog")) : class$com$tridium$alarm$ui$BAlarmReportDialog)); + BAlarmConsole console; + BTable table; + String title; + private Command ackCmd; + private Command closeCmd; + private Command hyperlinkCmd; + private Command notesCmd; + private Command detailsCmd; + private Command showVideoCmd; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmReportDialog; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmConsole; + static /* synthetic */ Class class$javax$baja$alarm$BAlarmRecord; + + public Type getType() { + return TYPE; + } + + public BAlarmReportDialog() { + throw new IllegalStateException(); + } + + public BAlarmReportDialog(BAlarmConsole bAlarmConsole, String string, BTable bTable) { + super((BWidget)bAlarmConsole, string, true); + Object object; + BAlarmRecord bAlarmRecord; + this.console = bAlarmConsole; + this.table = bTable; + this.hyperlinkCmd = new HyperlinkCommand((BWidget)this); + BButton bButton = new BButton(this.hyperlinkCmd, true, true); + this.ackCmd = new AckCommand((BWidget)this); + BButton bButton2 = new BButton(this.ackCmd, true, true); + this.notesCmd = new NotesCommand((BWidget)this); + BButton bButton3 = new BButton(this.notesCmd, true, true); + this.showVideoCmd = new ShowVideoCommand((BWidget)this); + BButton bButton4 = new BButton(this.showVideoCmd, true, true); + this.closeCmd = new CloseCommand((BWidget)this); + BButton bButton5 = new BButton(this.closeCmd, true, true); + this.detailsCmd = new DetailsCommand((BWidget)this); + BGridPane bGridPane = new BGridPane(BAlarmConsole.isVideoDriverAvailable() ? 5 : 4); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + ConsoleTableModel consoleTableModel = (ConsoleTableModel)((DynamicTableModel)bTable.getModel()).getRootModel(); + if (consoleTableModel.getRowCount() > 0) { + bAlarmRecord = consoleTableModel.getRecord(0); + object = bAlarmConsole.getAlarmService(); + BAlarmClass bAlarmClass = ((BAlarmService)object).lookupAlarmClass(bAlarmRecord.getAlarmClass()); + BPermissions bPermissions = bAlarmClass.getPermissions(bAlarmConsole.ctx); + if (bPermissions.hasOperatorWrite()) { + bGridPane.add("ack", (BValue)bButton2); + } + } else { + bGridPane.add("ack", (BValue)bButton2); + } + bGridPane.add("url", (BValue)bButton); + bGridPane.add("notes", (BValue)bButton3); + if (BAlarmConsole.isVideoDriverAvailable()) { + bGridPane.add("showVideo", (BValue)bButton4); + } + bGridPane.add("close", (BValue)bButton5); + bAlarmRecord = new BEdgePane(); + bAlarmRecord.setBottom((BWidget)new BBorderPane((BWidget)bGridPane)); + object = new Controller(); + bTable.setController((TableController)object); + bAlarmRecord.setCenter((BWidget)BAlarmTitlePane.makePane(bAlarmConsole.getTitle(), bTable)); + bTable.getSelection().select(0); + ((Controller)((Object)object)).enableCommands(); + this.setContent((BWidget)bAlarmRecord); + } + + public void close() { + ((BEdgePane)this.getContent()).setCenter((BWidget)new BNullWidget()); + super.close(); + } + + public void windowClosing(BWindowEvent bWindowEvent) { + this.close(); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + class Controller + extends TableController { + Controller() { + } + + public void keyReleased(BKeyEvent bKeyEvent) { + super.keyReleased(bKeyEvent); + this.enableCommands(); + } + + public void mouseReleased(BMouseEvent bMouseEvent) { + super.mouseReleased(bMouseEvent); + this.enableCommands(); + } + + void enableCommands() { + TableSelection tableSelection = this.getTable().getSelection(); + if (tableSelection.getRows().length == 1) { + BAlarmClassDef bAlarmClassDef; + Object object; + ConsoleTableModel consoleTableModel = (ConsoleTableModel)((DynamicTableModel)this.getTable().getModel()).getRootModel(); + BAlarmRecord bAlarmRecord = consoleTableModel.getRecord(tableSelection.getRow()); + BString bString = (BString)bAlarmRecord.getAlarmData().get("hyperlinkOrd"); + BOrd bOrd = BOrd.NULL; + if (bString != null) { + bOrd = BOrd.make((String)bString.toString()); + } + if (bOrd == null || bOrd.isNull()) { + object = BAlarmReportDialog.this.console.options.getAlarmClassMapping(); + bAlarmClassDef = object.getAlarmClassDefFor(bAlarmRecord.getAlarmClass()); + bOrd = bAlarmClassDef.getAlarmUrl(); + } + if (bOrd != null && !bOrd.isNull()) { + BAlarmReportDialog.this.hyperlinkCmd.setEnabled(true); + } else { + BAlarmReportDialog.this.hyperlinkCmd.setEnabled(false); + } + object = bAlarmRecord.getAlarmData().gets("cameraOrd", null); + if (object != null) { + bAlarmClassDef = BOrd.make((String)object); + if (!bAlarmClassDef.equals(BOrd.NULL)) { + BAlarmReportDialog.this.showVideoCmd.setEnabled(true); + } else { + BAlarmReportDialog.this.showVideoCmd.setEnabled(false); + } + } else { + BAlarmReportDialog.this.showVideoCmd.setEnabled(false); + } + BAlarmReportDialog.this.notesCmd.setEnabled(true); + } else { + BAlarmReportDialog.this.hyperlinkCmd.setEnabled(false); + BAlarmReportDialog.this.notesCmd.setEnabled(false); + BAlarmReportDialog.this.detailsCmd.setEnabled(false); + BAlarmReportDialog.this.showVideoCmd.setEnabled(false); + } + } + + protected void cellReleased(BMouseEvent bMouseEvent, int n, int n2) { + super.cellReleased(bMouseEvent, n, n2); + if (bMouseEvent.getClickCount() == 2) { + BAlarmReportDialog.this.console.showDetailsDialog(BAlarmReportDialog.this.table, n); + } + } + + protected void cellPopup(BMouseEvent bMouseEvent, int n, int n2) { + BMenu bMenu = new BMenu(); + bMenu.add("ack", BAlarmReportDialog.this.ackCmd); + bMenu.add("url", BAlarmReportDialog.this.hyperlinkCmd); + bMenu.add("notes", BAlarmReportDialog.this.notesCmd); + bMenu.add("details", BAlarmReportDialog.this.detailsCmd); + if (BAlarmConsole.isVideoDriverAvailable()) { + bMenu.add("showVideo", BAlarmReportDialog.this.showVideoCmd); + } + bMenu.open((BWidget)BAlarmReportDialog.this.table, bMouseEvent.getX(), bMouseEvent.getY()); + } + + public BMenu makeOptionsMenu() { + BMenu bMenu = super.makeOptionsMenu(); + bMenu.add("acSep", (BValue)new BSeparator()); + bMenu.add("addColumn", BAlarmReportDialog.this.console.addColumnCommand); + bMenu.add("removeColumn", BAlarmReportDialog.this.console.removeColumnCommand); + return bMenu; + } + } + + private class ShowVideoCommand + extends Command { + public ShowVideoCommand(BWidget bWidget) { + super(bWidget, (Lexicon)BAlarmConsole.lexicon, "commands.showVideo"); + } + + public CommandArtifact doInvoke() { + block9: { + try { + Class clazz = Sys.loadClass((String)"videoDriver", (String)"com.tridium.videoDriver.alarm.AlarmConsoleExt"); + if (clazz != null) { + Method method = clazz.getMethod("doShowVideo", class$com$tridium$alarm$ui$BAlarmConsole == null ? (class$com$tridium$alarm$ui$BAlarmConsole = BAlarmReportDialog.class$("com.tridium.alarm.ui.BAlarmConsole")) : class$com$tridium$alarm$ui$BAlarmConsole, class$javax$baja$alarm$BAlarmRecord == null ? (class$javax$baja$alarm$BAlarmRecord = BAlarmReportDialog.class$("javax.baja.alarm.BAlarmRecord")) : class$javax$baja$alarm$BAlarmRecord); + if (method != null) { + BAlarmRecord[] bAlarmRecordArray = BAlarmReportDialog.this.console.getSelectedAlarms(BAlarmReportDialog.this.table); + if (bAlarmRecordArray != null && bAlarmRecordArray.length > 0) { + method.invoke((Object)clazz, new Object[]{BAlarmReportDialog.this.console, bAlarmRecordArray[0]}); + } + } else { + System.out.println("The 'doShowVideo' method was not found on class AlarmConsoleExt in videoDriver.jar. Please have my program fixed"); + } + break block9; + } + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound"); + } + catch (ClassNotFoundException classNotFoundException) { + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound", (Throwable)classNotFoundException); + } + catch (NoSuchMethodException noSuchMethodException) { + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound", (Throwable)noSuchMethodException); + } + catch (InvocationTargetException invocationTargetException) { + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound", (Throwable)invocationTargetException); + } + catch (IllegalAccessException illegalAccessException) { + throw new LocalizableRuntimeException("alarm", "VideoDriverModuleNotFound", (Throwable)illegalAccessException); + } + } + return null; + } + } + + private class DetailsCommand + extends Command { + public DetailsCommand(BWidget bWidget) { + super(bWidget, (Lexicon)BAlarmConsole.lexicon, "commands.details"); + } + + public CommandArtifact doInvoke() { + int[] nArray = BAlarmReportDialog.this.table.getSelection().getRows(); + if (nArray.length != 1) { + return null; + } + BAlarmReportDialog.this.console.showDetailsDialog(BAlarmReportDialog.this.table, nArray[0]); + return null; + } + } + + private class CloseCommand + extends Command { + public CloseCommand(BWidget bWidget) { + super(bWidget, (Lexicon)UiLexicon.bajaui, "commands.close"); + } + + public CommandArtifact doInvoke() { + BAlarmReportDialog.this.close(); + return null; + } + } + + private class NotesCommand + extends Command { + public NotesCommand(BWidget bWidget) { + super(bWidget, (Lexicon)BAlarmConsole.lexicon, "commands.notes"); + } + + public CommandArtifact doInvoke() { + BAlarmRecord[] bAlarmRecordArray = BAlarmReportDialog.this.console.getSelectedAlarms(BAlarmReportDialog.this.table); + if (bAlarmRecordArray.length == 0) { + return null; + } + BAlarmReportDialog.this.console.showNotes((BWidget)BAlarmReportDialog.this.table, bAlarmRecordArray); + return null; + } + } + + private class HyperlinkCommand + extends Command { + public HyperlinkCommand(BWidget bWidget) { + super(bWidget, (Lexicon)BAlarmConsole.lexicon, "commands.hyperlink"); + } + + public CommandArtifact doInvoke() { + BAlarmRecord[] bAlarmRecordArray = BAlarmReportDialog.this.console.getSelectedAlarms(BAlarmReportDialog.this.table); + if (bAlarmRecordArray.length == 0) { + return null; + } + BAlarmReportDialog.this.console.hyperlink(bAlarmRecordArray[0]); + return null; + } + } + + private class AckCommand + extends Command { + public AckCommand(BWidget bWidget) { + super(bWidget, (Lexicon)BAlarmConsole.lexicon, "commands.acknowledge"); + } + + public CommandArtifact doInvoke() { + BAlarmRecord[] bAlarmRecordArray = BAlarmReportDialog.this.console.getSelectedAlarms(BAlarmReportDialog.this.table); + if (bAlarmRecordArray.length == 0) { + return null; + } + BAlarmReportDialog.this.console.acknowledgeAlarms(bAlarmRecordArray); + return null; + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmTitlePane.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmTitlePane.java new file mode 100644 index 0000000..ad44bed --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmTitlePane.java @@ -0,0 +1,189 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.ui.theme.Theme + * javax.baja.gx.BColor + * javax.baja.gx.BInsets + * javax.baja.gx.BSize + * javax.baja.gx.Graphics + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BBorder + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.event.BMouseEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.table.BTable + * javax.baja.ui.table.DynamicTableModel + * javax.baja.ui.util.BAuxWidget$Support + * javax.baja.ui.util.UiLexicon + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.ui.ConsoleTableModel; +import com.tridium.ui.theme.Theme; +import javax.baja.gx.BColor; +import javax.baja.gx.BInsets; +import javax.baja.gx.BSize; +import javax.baja.gx.Graphics; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BBorder; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.event.BMouseEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.table.BTable; +import javax.baja.ui.table.DynamicTableModel; +import javax.baja.ui.util.BAuxWidget; +import javax.baja.ui.util.UiLexicon; + +public class BAlarmTitlePane +extends BEdgePane { + public static final Action tableModified = BAlarmTitlePane.newAction((int)0, null, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmTitlePane == null ? (class$com$tridium$alarm$ui$BAlarmTitlePane = BAlarmTitlePane.class$("com.tridium.alarm.ui.BAlarmTitlePane")) : class$com$tridium$alarm$ui$BAlarmTitlePane)); + public static final UiLexicon lexicon = new UiLexicon(class$com$tridium$alarm$ui$BAlarmConsole == null ? (class$com$tridium$alarm$ui$BAlarmConsole = BAlarmTitlePane.class$("com.tridium.alarm.ui.BAlarmConsole")) : class$com$tridium$alarm$ui$BAlarmConsole); + static String sourceText = lexicon.getText("alarm.sources"); + static String alarmText = lexicon.getText("alarm.alarms"); + static BInsets withIcon = BInsets.make((double)1.0, (double)4.0, (double)1.0, (double)2.0); + static BInsets withoutIcon = BInsets.make((double)2.0, (double)4.0, (double)2.0, (double)4.0); + BWidget content; + BLabel label; + BLabel info; + BEdgePane top; + BTable table; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmTitlePane; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmConsole; + + public void tableModified() { + this.invoke(tableModified, null, null); + } + + public Type getType() { + return TYPE; + } + + public static BAlarmTitlePane makePane(String string, BTable bTable) { + BAlarmTitlePane bAlarmTitlePane = new BAlarmTitlePane(string, (BWidget)bTable); + bAlarmTitlePane.setTable(bTable); + return bAlarmTitlePane; + } + + public BAlarmTitlePane(String string, BWidget bWidget) { + this.content = bWidget; + this.label = new BLabel(string); + this.label.setFont(Theme.widget().getBoldText()); + this.label.setForeground(BColor.white.toBrush()); + this.top = new BEdgePane(); + this.top.setLeft((BWidget)this.label); + BBorderPane bBorderPane = new BBorderPane((BWidget)this.top, BBorder.make((String)"top(1) left(1) right(1)"), withoutIcon); + bBorderPane.setFill(Theme.widget().getControlShadow()); + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop((BWidget)bBorderPane); + bEdgePane.setCenter(bWidget); + this.setCenter((BWidget)new BBorderPane((BWidget)bEdgePane, BBorder.inset, BInsets.DEFAULT)); + } + + public BAlarmTitlePane() { + } + + public void setTitleVisible(boolean bl) { + this.top.getParentWidget().setVisible(bl); + } + + public void setTitle(String string) { + this.label.setText(string); + } + + public void setTable(BTable bTable) { + this.table = bTable; + if (this.info == null) { + this.info = new BLabel(""); + this.info.setFont(Theme.widget().getBoldText()); + this.info.setForeground(BColor.white.toBrush()); + this.top.setRight((BWidget)this.info); + } + if (this.get("tableLink") != null) { + this.remove("tableLink"); + } + this.linkTo("tableLink", (BComponent)bTable, (Slot)BTable.tableModified, (Slot)tableModified); + this.doTableModified(); + } + + public void doTableModified() { + int n = 0; + int n2 = 0; + try { + DynamicTableModel dynamicTableModel = (DynamicTableModel)this.table.getModel(); + ConsoleTableModel consoleTableModel = (ConsoleTableModel)dynamicTableModel.getRootModel(); + n = consoleTableModel.getSourceCount(); + n2 = consoleTableModel.getAlarmCount(); + } + catch (Exception exception) { + // empty catch block + } + this.info.setText(n + " " + sourceText + " / " + n2 + " " + alarmText); + this.relayout(); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + class AuxSupport + extends BAuxWidget.Support { + final BSize size = BSize.make((double)10.0, (double)16.0); + + AuxSupport() { + } + + public BSize getPreferredSize() { + return this.size; + } + + public void paint(Graphics graphics, double d, double d2) { + graphics.setBrush(BColor.white); + double d3 = 2.0; + double d4 = 5.0; + if (BAlarmTitlePane.this.content.isVisible()) { + graphics.strokeLine(d3, d4 + 2.0, d3 + 2.0, d4); + graphics.strokeLine(d3 + 2.0, d4, d3 + 4.0, d4 + 2.0); + graphics.strokeLine(d3 + 1.0, d4 + 2.0, d3 + 2.0, d4 + 1.0); + graphics.strokeLine(d3 + 2.0, d4 + 1.0, d3 + 3.0, d4 + 2.0); + graphics.strokeLine(d3, d4 + 6.0, d3 + 2.0, d4 + 4.0); + graphics.strokeLine(d3 + 2.0, d4 + 4.0, d3 + 4.0, d4 + 6.0); + graphics.strokeLine(d3 + 1.0, d4 + 6.0, d3 + 2.0, d4 + 5.0); + graphics.strokeLine(d3 + 2.0, d4 + 5.0, d3 + 3.0, d4 + 6.0); + } else { + graphics.strokeLine(d3, d4, d3 + 2.0, d4 + 2.0); + graphics.strokeLine(d3 + 2.0, d4 + 2.0, d3 + 4.0, d4); + graphics.strokeLine(d3 + 1.0, d4, d3 + 2.0, d4 + 1.0); + graphics.strokeLine(d3 + 2.0, d4 + 1.0, d3 + 3.0, d4); + graphics.strokeLine(d3, d4 + 4.0, d3 + 2.0, d4 + 6.0); + graphics.strokeLine(d3 + 2.0, d4 + 6.0, d3 + 4.0, d4 + 4.0); + graphics.strokeLine(d3 + 1.0, d4 + 4.0, d3 + 2.0, d4 + 5.0); + graphics.strokeLine(d3 + 2.0, d4 + 5.0, d3 + 3.0, d4 + 4.0); + } + } + + public void mousePressed(BMouseEvent bMouseEvent) { + BAlarmTitlePane.this.content.setVisible(!BAlarmTitlePane.this.content.getVisible()); + BAlarmTitlePane.this.relayout(); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BAlarmTransitionBitsFE.java b/modules/cfr_output/com/tridium/alarm/ui/BAlarmTransitionBitsFE.java new file mode 100644 index 0000000..cb80d56 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BAlarmTransitionBitsFE.java @@ -0,0 +1,158 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BBoolean + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BCheckBox + * javax.baja.ui.BTextField + * javax.baja.ui.BWidget + * javax.baja.ui.pane.BGridPane + * javax.baja.workbench.fieldeditor.BWbFieldEditor + */ +package com.tridium.alarm.ui; + +import javax.baja.alarm.BAlarmTransitionBits; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BCheckBox; +import javax.baja.ui.BTextField; +import javax.baja.ui.BWidget; +import javax.baja.ui.pane.BGridPane; +import javax.baja.workbench.fieldeditor.BWbFieldEditor; + +public class BAlarmTransitionBitsFE +extends BWbFieldEditor { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmTransitionBitsFE == null ? (class$com$tridium$alarm$ui$BAlarmTransitionBitsFE = BAlarmTransitionBitsFE.class$("com.tridium.alarm.ui.BAlarmTransitionBitsFE")) : class$com$tridium$alarm$ui$BAlarmTransitionBitsFE)); + static final String offnormalText = BAlarmTransitionBits.ALL.getTag(1); + static final String faultText = BAlarmTransitionBits.ALL.getTag(2); + static final String normalText = BAlarmTransitionBits.ALL.getTag(4); + static final String alertText = BAlarmTransitionBits.ALL.getTag(8); + public static final String SHOW_OFF_NORMAL = "showOffNormal"; + public static final String SHOW_NORMAL = "showNormal"; + public static final String SHOW_FAULT = "showFault"; + public static final String SHOW_ALERT = "showAlert"; + public static final String OFF_NORMAL_LABEL = "offNormalLabel"; + public static final String NORMAL_LABEL = "normalLabel"; + public static final String FAULT_LABEL = "faultLabel"; + public static final String ALERT_LABEL = "alertLabel"; + private boolean init = false; + private BCheckBox offnormal; + private BCheckBox fault; + private BCheckBox normal; + private BCheckBox alert; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmTransitionBitsFE; + + public Type getType() { + return TYPE; + } + + protected void doSetReadonly(boolean bl) { + this.init = false; + if (bl) { + this.setContent((BWidget)new BTextField("", 45, false)); + } + } + + protected void doLoadValue(BObject bObject, Context context) { + BAlarmTransitionBits bAlarmTransitionBits = (BAlarmTransitionBits)bObject; + if (this.isReadonly()) { + ((BTextField)this.getContent()).setText(bObject.toString(context)); + } else { + if (!this.init) { + this.initCheckBoxes(context); + } + this.offnormal.setSelected(bAlarmTransitionBits.isToOffnormal()); + this.fault.setSelected(bAlarmTransitionBits.isToFault()); + this.normal.setSelected(bAlarmTransitionBits.isToNormal()); + this.alert.setSelected(bAlarmTransitionBits.isToAlert()); + } + } + + protected BObject doSaveValue(BObject bObject, Context context) { + int n = 0; + if (this.offnormal.isSelected()) { + n |= 1; + } + if (this.fault.isSelected()) { + n |= 2; + } + if (this.normal.isSelected()) { + n |= 4; + } + if (this.alert.isSelected()) { + n |= 8; + } + return BAlarmTransitionBits.make(n); + } + + private void initCheckBoxes(Context context) { + this.init = true; + int n = 4; + if (this.getBooleanFacetValue(context, "multiLine", false)) { + n = 1; + } + BGridPane bGridPane = new BGridPane(n); + this.offnormal = new BCheckBox(this.getStringFacetValue(context, OFF_NORMAL_LABEL, offnormalText)); + this.fault = new BCheckBox(this.getStringFacetValue(context, FAULT_LABEL, faultText)); + this.normal = new BCheckBox(this.getStringFacetValue(context, NORMAL_LABEL, normalText)); + this.alert = new BCheckBox(this.getStringFacetValue(context, ALERT_LABEL, alertText)); + if (this.getBooleanFacetValue(context, SHOW_OFF_NORMAL, true)) { + bGridPane.add("offNormal", (BValue)this.offnormal, null); + } + if (this.getBooleanFacetValue(context, SHOW_FAULT, true)) { + bGridPane.add("fault", (BValue)this.fault, null); + } + if (this.getBooleanFacetValue(context, SHOW_NORMAL, true)) { + bGridPane.add("normal", (BValue)this.normal, null); + } + if (this.getBooleanFacetValue(context, SHOW_ALERT, true)) { + bGridPane.add("alert", (BValue)this.alert, null); + } + this.setContent((BWidget)bGridPane); + this.linkTo("l0", (BComponent)this.offnormal, (Slot)BCheckBox.actionPerformed, (Slot)setModified); + this.linkTo("l1", (BComponent)this.fault, (Slot)BCheckBox.actionPerformed, (Slot)setModified); + this.linkTo("l2", (BComponent)this.normal, (Slot)BCheckBox.actionPerformed, (Slot)setModified); + this.linkTo("l3", (BComponent)this.alert, (Slot)BCheckBox.actionPerformed, (Slot)setModified); + } + + private boolean getBooleanFacetValue(Context context, String string, boolean bl) { + if (context == null) { + return bl; + } + BBoolean bBoolean = (BBoolean)context.getFacet(string); + return bBoolean == null ? bl : bBoolean.getBoolean(); + } + + private String getStringFacetValue(Context context, String string, String string2) { + if (context == null) { + return string2; + } + BString bString = (BString)context.getFacet(string); + return bString == null ? string2 : bString.toString(); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BDeviceExtAlarmClassFE.java b/modules/cfr_output/com/tridium/alarm/ui/BDeviceExtAlarmClassFE.java new file mode 100644 index 0000000..fb30171 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BDeviceExtAlarmClassFE.java @@ -0,0 +1,166 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.workbench.fieldeditors.BFrozenEnumFE + * com.tridium.workbench.fieldeditors.BStringFE + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.util.UiLexicon + * javax.baja.workbench.fieldeditor.BWbFieldEditor + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.BTextOp; +import com.tridium.alarm.ui.BAlarmClassFE; +import com.tridium.workbench.fieldeditors.BFrozenEnumFE; +import com.tridium.workbench.fieldeditors.BStringFE; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.workbench.fieldeditor.BWbFieldEditor; + +public class BDeviceExtAlarmClassFE +extends BWbFieldEditor { + public static final Action textOpChanged = BDeviceExtAlarmClassFE.newAction((int)4, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BDeviceExtAlarmClassFE == null ? (class$com$tridium$alarm$ui$BDeviceExtAlarmClassFE = BDeviceExtAlarmClassFE.class$("com.tridium.alarm.ui.BDeviceExtAlarmClassFE")) : class$com$tridium$alarm$ui$BDeviceExtAlarmClassFE)); + BFrozenEnumFE opFE; + BWbFieldEditor formatFE; + Context cx; + BGridPane pane = new BGridPane(2); + protected BAlarmClassFE alarmClassFE; + public static final UiLexicon lexicon = new UiLexicon(class$com$tridium$alarm$ui$BDeviceExtAlarmClassFE == null ? (class$com$tridium$alarm$ui$BDeviceExtAlarmClassFE = BDeviceExtAlarmClassFE.class$("com.tridium.alarm.ui.BDeviceExtAlarmClassFE")) : class$com$tridium$alarm$ui$BDeviceExtAlarmClassFE); + static /* synthetic */ Class class$com$tridium$alarm$ui$BDeviceExtAlarmClassFE; + + public void textOpChanged() { + this.invoke(textOpChanged, null, null); + } + + public Type getType() { + return TYPE; + } + + public BDeviceExtAlarmClassFE() { + this.opFE = new BFrozenEnumFE(); + this.formatFE = new BStringFE(); + this.pane.add(null, (BValue)this.opFE); + this.pane.add("formatFE", (BValue)this.formatFE); + this.setContent((BWidget)this.pane); + this.linkTo("l1", (BComponent)this.formatFE, (Slot)BWbFieldEditor.pluginModified, (Slot)setModified); + this.linkTo("l2", (BComponent)this.opFE, (Slot)BFrozenEnumFE.pluginModified, (Slot)textOpChanged); + } + + protected void doSetReadonly(boolean bl) { + this.opFE.setReadonly(bl); + this.formatFE.setReadonly(bl); + } + + protected void doLoadValue(BObject bObject, Context context) { + String string; + BTextOp bTextOp; + this.cx = context; + this.formatFE = new BStringFE(); + String string2 = bObject.toString(); + if (string2.equals("%alarmClass%")) { + bTextOp = BTextOp.useExisting; + string = ""; + } else if (string2.startsWith("%alarmClass%")) { + bTextOp = BTextOp.append; + string = string2.substring(12); + } else if (string2.endsWith("%alarmClass%")) { + bTextOp = BTextOp.prepend; + string = string2.substring(0, string2.indexOf("%alarmClass%")); + } else { + bTextOp = BTextOp.replace; + string = string2; + this.formatFE = new BAlarmClassFE(); + } + if (bTextOp == BTextOp.useExisting) { + this.pane.set("formatFE", (BValue)new BLabel("")); + } else { + this.pane.set("formatFE", (BValue)this.formatFE); + this.remove("l1", context); + this.linkTo("l1", (BComponent)this.formatFE, (Slot)BWbFieldEditor.pluginModified, (Slot)setModified); + } + this.doSetReadonly(this.isReadonly()); + this.opFE.loadValue((BObject)bTextOp, context); + this.formatFE.loadValue((BObject)BString.make((String)string), context); + } + + protected BObject doSaveValue(BObject bObject, Context context) throws Exception { + BTextOp bTextOp = (BTextOp)this.opFE.saveValue(context); + String string = this.formatFE.saveValue(bObject, context).toString(); + string = string.replace("%alarmClass%", ""); + if (bTextOp == BTextOp.useExisting) { + return BString.make((String)"%alarmClass%"); + } + if (bTextOp == BTextOp.replace) { + return BString.make((String)string); + } + if (bTextOp == BTextOp.prepend) { + return BString.make((String)(string + "%alarmClass%")); + } + if (bTextOp == BTextOp.append) { + return BString.make((String)("%alarmClass%" + string)); + } + return BString.make((String)""); + } + + public void doTextOpChanged() throws Exception { + BTextOp bTextOp = (BTextOp)this.opFE.saveValue(this.cx); + String string = ""; + if (this.formatFE != null && this.formatFE.saveValue(this.cx) != null) { + string = this.formatFE.saveValue(this.cx).toString(); + } + this.formatFE = bTextOp == BTextOp.replace ? new BAlarmClassFE() : new BStringFE(); + string = string.replace("%alarmClass%", ""); + if (bTextOp == BTextOp.useExisting) { + this.pane.set("formatFE", (BValue)new BLabel("")); + } else { + this.pane.set("formatFE", (BValue)this.formatFE); + this.remove("l1", this.cx); + this.linkTo("l1", (BComponent)this.formatFE, (Slot)BWbFieldEditor.pluginModified, (Slot)setModified); + } + if (bTextOp == BTextOp.replace) { + this.formatFE.loadValue((BObject)BString.make((String)"defaultAlarmClass"), this.cx); + } else { + this.formatFE.loadValue((BObject)BString.make((String)""), this.cx); + } + this.setModified(); + this.repaint(); + } + + public void doToggleUseExisting() { + this.setModified(); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BEnumAlarmRangeFE.java b/modules/cfr_output/com/tridium/alarm/ui/BEnumAlarmRangeFE.java new file mode 100644 index 0000000..11c4fba --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BEnumAlarmRangeFE.java @@ -0,0 +1,236 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.workbench.fieldeditors.BDialogFE + * com.tridium.workbench.fieldeditors.BIntegerFE + * javax.baja.naming.SlotPath + * javax.baja.sys.BEnumRange + * javax.baja.sys.BInteger + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.list.BCheckList + * javax.baja.ui.list.DefaultListModel + * javax.baja.ui.list.ListModel + * javax.baja.ui.list.ListSelection + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BFlowPane + * javax.baja.workbench.CannotSaveException + */ +package com.tridium.alarm.ui; + +import com.tridium.workbench.fieldeditors.BDialogFE; +import com.tridium.workbench.fieldeditors.BIntegerFE; +import javax.baja.naming.SlotPath; +import javax.baja.sys.BEnumRange; +import javax.baja.sys.BInteger; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.list.BCheckList; +import javax.baja.ui.list.DefaultListModel; +import javax.baja.ui.list.ListModel; +import javax.baja.ui.list.ListSelection; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BFlowPane; +import javax.baja.workbench.CannotSaveException; + +public class BEnumAlarmRangeFE +extends BDialogFE { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BEnumAlarmRangeFE == null ? (class$com$tridium$alarm$ui$BEnumAlarmRangeFE = BEnumAlarmRangeFE.class$("com.tridium.alarm.ui.BEnumAlarmRangeFE")) : class$com$tridium$alarm$ui$BEnumAlarmRangeFE)); + boolean init = false; + BEnumRange range; + Context ctx; + BCheckList checkList; + BLabel config; + BWidget editor; + DefaultListModel listModel; + BLabel label; + boolean readonly; + static /* synthetic */ Class class$com$tridium$alarm$ui$BEnumAlarmRangeFE; + + public Type getType() { + return TYPE; + } + + public BEnumAlarmRangeFE() { + BFlowPane bFlowPane = new BFlowPane(); + this.label = new BLabel(); + bFlowPane.add(null, (BValue)this.label); + bFlowPane.add(null, (BValue)this.getEditButton()); + this.setContent((BWidget)bFlowPane); + } + + protected void doSetReadonly(boolean bl) { + this.readonly = bl; + this.setEditorReadonly(bl); + } + + public void doEditPressed() { + this.initUi(); + BEnumRange bEnumRange = this.range; + int n = BDialog.open((BWidget)this, (String)"", (Object)this.editor, (int)3); + if (n == 1) { + this.loadValue((BObject)this.getRange(this.ctx)); + if (!this.range.equals((Object)bEnumRange)) { + this.setModified(); + } + } + } + + protected void doLoadValue(BObject bObject, Context context) { + this.range = (BEnumRange)bObject; + this.label.setText(this.makeDisplayString(this.range, context)); + if (context != null) { + this.ctx = context; + } + } + + protected BObject doSaveValue(BObject bObject, Context context) throws CannotSaveException { + bObject = this.getRange(context); + if (context != null) { + this.ctx = context; + } + return bObject; + } + + private BEnumRange getRange(Context context) { + BEnumRange bEnumRange = (BEnumRange)this.ctx.getFacet("range"); + if (bEnumRange == null || bEnumRange.isNull()) { + int[] nArray = this.checkList.getSelection().getItems(); + int[] nArray2 = new int[nArray.length]; + String[] stringArray = new String[nArray.length]; + for (int i = 0; i < nArray.length; ++i) { + int n; + Object object = this.checkList.getItem(nArray[i]); + nArray2[i] = n = Integer.parseInt(object.toString()); + stringArray[i] = SlotPath.escape((String)("" + n)); + } + return BEnumRange.make((int[])nArray2, (String[])stringArray); + } + int[] nArray = this.checkList.getSelection().getItems(); + int[] nArray3 = new int[nArray.length]; + String[] stringArray = new String[nArray.length]; + for (int i = 0; i < nArray.length; ++i) { + String string = (String)this.checkList.getItem(nArray[i]); + int n = -1; + int[] nArray4 = bEnumRange.getOrdinals(); + for (int j = 0; j < nArray4.length; ++j) { + int n2 = nArray4[j]; + String string2 = bEnumRange.getDisplayTag(n2, context); + if (!string2.equals(string)) continue; + n = n2; + break; + } + nArray3[i] = n; + stringArray[i] = bEnumRange.getTag(n); + } + return BEnumRange.make((int[])nArray3, (String[])stringArray); + } + + private void initUi() { + BEnumRange bEnumRange = (BEnumRange)this.ctx.getFacet("range"); + if (bEnumRange == null || bEnumRange.isNull()) { + this.checkList = new BCheckList(); + this.listModel = new DefaultListModel(); + ListSelection listSelection = this.checkList.getSelection(); + int[] nArray = this.range.getOrdinals(); + for (int i = 0; i < nArray.length; ++i) { + this.listModel.addItem((Object)("" + nArray[i])); + listSelection.select(i); + } + Command command = new Command((BWidget)this.getWbShell(), Sys.getModuleForClass((Class)(class$com$tridium$alarm$ui$BEnumAlarmRangeFE == null ? (class$com$tridium$alarm$ui$BEnumAlarmRangeFE = BEnumAlarmRangeFE.class$("com.tridium.alarm.ui.BEnumAlarmRangeFE")) : class$com$tridium$alarm$ui$BEnumAlarmRangeFE)), "alarm.enumRangeFE.add"){ + + public CommandArtifact doInvoke() { + try { + BInteger bInteger; + BIntegerFE bIntegerFE = new BIntegerFE(); + bIntegerFE.loadValue((BObject)BInteger.make((int)BEnumAlarmRangeFE.this.listModel.getItemCount())); + int n = BDialog.open((BWidget)BEnumAlarmRangeFE.this, (String)"", (Object)bIntegerFE, (int)3); + if (n == 1 && BEnumAlarmRangeFE.this.listModel.indexOfItem((Object)(bInteger = (BInteger)bIntegerFE.saveValue())) == -1 && BEnumAlarmRangeFE.this.listModel.indexOfItem((Object)bInteger.toString()) == -1) { + BEnumAlarmRangeFE.this.listModel.addItem((Object)bInteger); + ListSelection listSelection = BEnumAlarmRangeFE.this.checkList.getSelection(); + listSelection.select(BEnumAlarmRangeFE.this.listModel.getItemCount() - 1); + BEnumAlarmRangeFE.this.checkList.setSelection(listSelection); + BEnumAlarmRangeFE.this.checkList.setModel((ListModel)BEnumAlarmRangeFE.this.listModel); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + return null; + } + }; + BButton bButton = new BButton(command, true, true); + this.checkList.setSelection(listSelection); + this.checkList.setModel((ListModel)this.listModel); + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setCenter((BWidget)this.checkList); + bEdgePane.setBottom((BWidget)bButton); + this.editor = bEdgePane; + } else { + this.checkList = new BCheckList(); + this.listModel = new DefaultListModel(); + ListSelection listSelection = this.checkList.getSelection(); + int[] nArray = bEnumRange.getOrdinals(); + for (int i = 0; i < nArray.length; ++i) { + this.listModel.addItem((Object)bEnumRange.getDisplayTag(nArray[i], this.ctx)); + if (!this.range.isOrdinal(nArray[i])) continue; + listSelection.select(i); + } + this.checkList.setSelection(listSelection); + this.checkList.setModel((ListModel)this.listModel); + this.editor = this.checkList; + } + this.setEditorReadonly(this.readonly); + } + + private String makeDisplayString(BEnumRange bEnumRange, Context context) { + StringBuffer stringBuffer = new StringBuffer(); + int[] nArray = bEnumRange.getOrdinals(); + for (int i = 0; i < nArray.length; ++i) { + if (i > 0) { + stringBuffer.append(", "); + } + stringBuffer.append(bEnumRange.getDisplayTag(nArray[i], this.ctx)); + } + return stringBuffer.toString(); + } + + private void setEditorReadonly(boolean bl) { + if (this.editor != null) { + this.editor.setEnabled(!bl); + BWidget[] bWidgetArray = this.editor.getChildWidgets(); + for (int i = 0; i < bWidgetArray.length; ++i) { + bWidgetArray[i].setEnabled(!bl); + } + } + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BIAlarmServiceView.java b/modules/cfr_output/com/tridium/alarm/ui/BIAlarmServiceView.java new file mode 100644 index 0000000..3b0a13c --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BIAlarmServiceView.java @@ -0,0 +1,23 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BInterface + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.alarm.ui; + +import javax.baja.alarm.BAlarmRecord; +import javax.baja.alarm.BAlarmService; +import javax.baja.sys.BInterface; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public interface BIAlarmServiceView +extends BInterface { + public static final Type TYPE = Sys.loadType((Class)(1.class$com$tridium$alarm$ui$BIAlarmServiceView == null ? (1.class$com$tridium$alarm$ui$BIAlarmServiceView = 1.class$("com.tridium.alarm.ui.BIAlarmServiceView")) : 1.class$com$tridium$alarm$ui$BIAlarmServiceView)); + + public BAlarmService getAlarmService(BAlarmRecord var1); +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BInstructionsFE.java b/modules/cfr_output/com/tridium/alarm/ui/BInstructionsFE.java new file mode 100644 index 0000000..1f553a8 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BInstructionsFE.java @@ -0,0 +1,348 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.workbench.fieldeditors.BDialogFE + * javax.baja.naming.BOrd + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BTextDropDown + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.enums.BHalign + * javax.baja.ui.list.BList + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BConstrainedPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BFlowPane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.table.BTable + * javax.baja.ui.table.DefaultTableModel + * javax.baja.ui.table.TableModel + * javax.baja.ui.util.UiLexicon + * javax.baja.util.BFormat + * javax.baja.workbench.BWbShell + */ +package com.tridium.alarm.ui; + +import com.tridium.workbench.fieldeditors.BDialogFE; +import javax.baja.alarm.BAlarmInstructions; +import javax.baja.alarm.BAlarmService; +import javax.baja.naming.BOrd; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BTextDropDown; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.list.BList; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BConstrainedPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BFlowPane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.table.BTable; +import javax.baja.ui.table.DefaultTableModel; +import javax.baja.ui.table.TableModel; +import javax.baja.ui.util.UiLexicon; +import javax.baja.util.BFormat; +import javax.baja.workbench.BWbShell; + +public class BInstructionsFE +extends BDialogFE { + public static final Action setEnabledStates = BInstructionsFE.newAction((int)0, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BInstructionsFE == null ? (class$com$tridium$alarm$ui$BInstructionsFE = BInstructionsFE.class$("com.tridium.alarm.ui.BInstructionsFE")) : class$com$tridium$alarm$ui$BInstructionsFE)); + BLabel label = new BLabel(); + BList list; + BTable table; + BAlarmInstructions instructions; + Context ctx; + BEdgePane mainPane = null; + MoveDownCommand moveDownCommand = null; + MoveUpCommand moveUpCommand = null; + RemoveCommand removeCommand = null; + EditCommand editCommand = null; + AddCommand addCommand = null; + public static final UiLexicon lexicon = new UiLexicon(class$com$tridium$alarm$ui$BInstructionsFE == null ? (class$com$tridium$alarm$ui$BInstructionsFE = BInstructionsFE.class$("com.tridium.alarm.ui.BInstructionsFE")) : class$com$tridium$alarm$ui$BInstructionsFE); + static /* synthetic */ Class class$com$tridium$alarm$ui$BInstructionsFE; + + public void setEnabledStates() { + this.invoke(setEnabledStates, null, null); + } + + public Type getType() { + return TYPE; + } + + public BInstructionsFE() { + BFlowPane bFlowPane = new BFlowPane(); + bFlowPane.add(null, (BValue)this.label); + bFlowPane.add(null, (BValue)this.getEditButton()); + this.setContent((BWidget)bFlowPane); + this.addCommand = new AddCommand(); + this.editCommand = new EditCommand(); + this.removeCommand = new RemoveCommand(); + this.moveUpCommand = new MoveUpCommand(); + this.moveDownCommand = new MoveDownCommand(); + this.table = new BTable((TableModel)new NumberedTableModel()); + this.table.setHeaderVisible(false); + this.table.setVgridVisible(false); + BConstrainedPane bConstrainedPane = new BConstrainedPane((BWidget)this.table); + bConstrainedPane.setMinSize(400.0, 200.0); + this.mainPane = new BEdgePane(); + BGridPane bGridPane = new BGridPane(1); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.add(null, (BValue)new BButton((Command)this.addCommand)); + bGridPane.add(null, (BValue)new BButton((Command)this.editCommand)); + bGridPane.add(null, (BValue)new BButton((Command)this.removeCommand)); + bGridPane.add(null, (BValue)new BLabel("")); + bGridPane.add(null, (BValue)new BButton((Command)this.moveUpCommand)); + bGridPane.add(null, (BValue)new BButton((Command)this.moveDownCommand)); + this.linkTo(null, (BComponent)this.table, (Slot)BTable.tableModified, (Slot)setEnabledStates); + this.linkTo(null, (BComponent)this.table, (Slot)BTable.actionPerformed, (Slot)setEnabledStates); + this.linkTo(null, (BComponent)this.table, (Slot)BTable.selectionModified, (Slot)setEnabledStates); + this.doSetEnabledStates(); + this.mainPane.setCenter((BWidget)new BBorderPane((BWidget)bConstrainedPane)); + this.mainPane.setRight((BWidget)new BBorderPane((BWidget)bGridPane)); + } + + public void doLoadValue(BObject bObject, Context context) { + this.instructions = (BAlarmInstructions)bObject; + this.ctx = context; + this.label.setText(this.instructions.size() + " " + lexicon.getText("alarm.instructions")); + } + + public BObject doSaveValue(BObject bObject, Context context) { + return this.instructions; + } + + public void doSetReadonly(boolean bl) { + if (bl) { + this.moveDownCommand.setEnabled(!bl); + this.moveUpCommand.setEnabled(!bl); + this.removeCommand.setEnabled(!bl); + this.editCommand.setEnabled(!bl); + this.addCommand.setEnabled(!bl); + } else { + this.addCommand.setEnabled(true); + } + this.table.setEnabled(!bl); + this.mainPane.setEnabled(!bl); + } + + public void setEnabled(boolean bl) { + this.setReadonly(!bl); + } + + public void doEditPressed() { + int n; + ((NumberedTableModel)this.table.getModel()).removeAllRows(); + for (n = 0; n < this.instructions.size(); ++n) { + ((NumberedTableModel)this.table.getModel()).addRow(this.instructions.get(n)); + } + n = BDialog.open((BWidget)this, (String)"Edit", (Object)this.mainPane, (int)3); + if (n == 2) { + return; + } + BAlarmInstructions bAlarmInstructions = this.instructions; + BFormat[] bFormatArray = new BFormat[this.table.getModel().getRowCount()]; + for (int i = 0; i < this.table.getModel().getRowCount(); ++i) { + bFormatArray[i] = ((NumberedTableModel)this.table.getModel()).getFormat(i); + } + this.instructions = BAlarmInstructions.make(bFormatArray); + if (!this.instructions.equivalent((Object)bAlarmInstructions)) { + this.label.setText(this.instructions.size() + " " + lexicon.getText("alarm.instructions")); + this.setModified(); + } + } + + public void doSetEnabledStates() { + boolean bl = this.isReadonly(); + if (bl) { + this.moveDownCommand.setEnabled(false); + this.moveUpCommand.setEnabled(false); + this.removeCommand.setEnabled(false); + this.editCommand.setEnabled(false); + this.addCommand.setEnabled(false); + } else { + this.addCommand.setEnabled(true); + boolean bl2 = !this.table.getSelection().isEmpty(); + this.removeCommand.setEnabled(bl2); + boolean bl3 = this.table.getSelection().getRows().length == 1; + this.moveDownCommand.setEnabled(bl3); + this.moveUpCommand.setEnabled(bl3); + this.editCommand.setEnabled(bl3); + } + } + + public final BComponent loadService(Type type) { + BWbShell bWbShell = this.getWbShell(); + BOrd bOrd = BOrd.make((BOrd)bWbShell.getActiveOrd(), (String)("service:" + type.toString())); + return (BComponent)bOrd.get(); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public class NumberedTableModel + extends DefaultTableModel { + public NumberedTableModel() { + super(new String[]{"", ""}); + } + + public void addRow(BFormat bFormat) { + super.addRow(new Object[]{null, bFormat}); + } + + public int getColumnCount() { + return 2; + } + + public String getColumnName(int n) { + return ""; + } + + public BFormat getFormat(int n) { + return BFormat.make((String)super.getValueAt(n, 1).toString()); + } + + public Object getValueAt(int n, int n2) { + if (n2 == 0) { + return new String(n + 1 + "."); + } + return this.getFormat(n); + } + } + + private class MoveDownCommand + extends Command { + public MoveDownCommand() { + super((BWidget)BInstructionsFE.this, TYPE.getModule(), "commands.moveDown"); + } + + public CommandArtifact doInvoke() { + int n = BInstructionsFE.this.table.getSelection().getRow(); + if (n < BInstructionsFE.this.table.getModel().getRowCount() - 1) { + Object object = BInstructionsFE.this.table.getModel().getValueAt(n, 1); + Object object2 = BInstructionsFE.this.table.getModel().getValueAt(n + 1, 1); + ((NumberedTableModel)BInstructionsFE.this.table.getModel()).set(n, 1, object2); + ((NumberedTableModel)BInstructionsFE.this.table.getModel()).set(n + 1, 1, object); + BInstructionsFE.this.table.getSelection().deselectAll(); + BInstructionsFE.this.table.getSelection().select(n + 1); + } + return null; + } + } + + private class MoveUpCommand + extends Command { + public MoveUpCommand() { + super((BWidget)BInstructionsFE.this, TYPE.getModule(), "commands.moveUp"); + } + + public CommandArtifact doInvoke() { + int n = BInstructionsFE.this.table.getSelection().getRow(); + if (n > 0) { + Object object = BInstructionsFE.this.table.getModel().getValueAt(n, 1); + Object object2 = BInstructionsFE.this.table.getModel().getValueAt(n - 1, 1); + ((NumberedTableModel)BInstructionsFE.this.table.getModel()).set(n, 1, object2); + ((NumberedTableModel)BInstructionsFE.this.table.getModel()).set(n - 1, 1, object); + BInstructionsFE.this.table.getSelection().deselectAll(); + BInstructionsFE.this.table.getSelection().select(n - 1); + } + return null; + } + } + + private class RemoveCommand + extends Command { + public RemoveCommand() { + super((BWidget)BInstructionsFE.this, TYPE.getModule(), "commands.removeMsg"); + } + + public CommandArtifact doInvoke() { + int[] nArray = BInstructionsFE.this.table.getSelection().getRows(); + for (int i = nArray.length - 1; i >= 0; --i) { + ((NumberedTableModel)BInstructionsFE.this.table.getModel()).removeRow(nArray[i]); + } + return null; + } + } + + private class EditCommand + extends Command { + public EditCommand() { + super((BWidget)BInstructionsFE.this, TYPE.getModule(), "commands.editMsg"); + } + + public CommandArtifact doInvoke() { + int n = BInstructionsFE.this.table.getSelection().getRow(); + String string = BDialog.prompt((BWidget)BInstructionsFE.this, (String)"Edit", (String)BInstructionsFE.this.table.getModel().getValueAt(n, 1).toString(), (int)40); + if (string != null) { + if ((string = string.trim()).equals("")) { + ((NumberedTableModel)BInstructionsFE.this.table.getModel()).removeRow(n); + } else { + ((NumberedTableModel)BInstructionsFE.this.table.getModel()).set(n, 1, string); + BInstructionsFE.this.table.sizeColumnsToFit(); + } + } + return null; + } + } + + private class AddCommand + extends Command { + public AddCommand() { + super((BWidget)BInstructionsFE.this, TYPE.getModule(), "commands.addMsg"); + } + + public CommandArtifact doInvoke() { + int n; + BTextDropDown bTextDropDown = new BTextDropDown(); + BAlarmService bAlarmService = (BAlarmService)BInstructionsFE.this.loadService(BAlarmService.TYPE); + bAlarmService.lease(); + BAlarmInstructions bAlarmInstructions = bAlarmService.getMasterAlarmInstructions(); + if (!BInstructionsFE.this.instructions.equals((Object)bAlarmInstructions)) { + for (n = 0; n < bAlarmInstructions.size(); ++n) { + bTextDropDown.getList().addItem((Object)bAlarmInstructions.get(n)); + } + } + if ((n = BDialog.open((BWidget)BInstructionsFE.this, (String)"Add", (Object)new BBorderPane((BWidget)bTextDropDown), (int)3)) == 1) { + String string = bTextDropDown.getText().trim(); + if (string == null || string.equals("")) { + return null; + } + ((NumberedTableModel)BInstructionsFE.this.table.getModel()).addRow(BFormat.make((String)string)); + BInstructionsFE.this.table.sizeColumnsToFit(); + } + return null; + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BLimitEnableFE.java b/modules/cfr_output/com/tridium/alarm/ui/BLimitEnableFE.java new file mode 100644 index 0000000..770dd7d --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BLimitEnableFE.java @@ -0,0 +1,107 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.log.Log + * javax.baja.sys.BBoolean + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BCheckBox + * javax.baja.ui.BWidget + * javax.baja.ui.pane.BGridPane + * javax.baja.util.Lexicon + * javax.baja.workbench.BWbPlugin + * javax.baja.workbench.fieldeditor.BWbFieldEditor + */ +package com.tridium.alarm.ui; + +import javax.baja.alarm.ext.BLimitEnable; +import javax.baja.log.Log; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BCheckBox; +import javax.baja.ui.BWidget; +import javax.baja.ui.pane.BGridPane; +import javax.baja.util.Lexicon; +import javax.baja.workbench.BWbPlugin; +import javax.baja.workbench.fieldeditor.BWbFieldEditor; + +public class BLimitEnableFE +extends BWbFieldEditor { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BLimitEnableFE == null ? (class$com$tridium$alarm$ui$BLimitEnableFE = BLimitEnableFE.class$("com.tridium.alarm.ui.BLimitEnableFE")) : class$com$tridium$alarm$ui$BLimitEnableFE)); + private static Log log = Log.getLog((String)"control"); + private static Lexicon lex = Lexicon.make((String)"alarm"); + private boolean init = false; + private BCheckBox low; + private BCheckBox high; + static /* synthetic */ Class class$com$tridium$alarm$ui$BLimitEnableFE; + + public Type getType() { + return TYPE; + } + + protected void doSetReadonly(boolean bl) { + this.init = false; + } + + protected void doLoadValue(BObject bObject, Context context) { + BLimitEnable bLimitEnable = (BLimitEnable)bObject; + if (!this.init) { + this.initUi(bLimitEnable); + } + this.low.setSelected(bLimitEnable.getLowLimitEnable()); + this.high.setSelected(bLimitEnable.getHighLimitEnable()); + this.low.setEnabled(!this.isReadonly()); + this.high.setEnabled(!this.isReadonly()); + this.linkTo((BComponent)this.low, (Slot)BWbPlugin.actionPerformed, (Slot)actionPerformed); + this.linkTo((BComponent)this.high, (Slot)BWbPlugin.actionPerformed, (Slot)actionPerformed); + } + + protected BObject doSaveValue(BObject bObject, Context context) { + BLimitEnable bLimitEnable = (BLimitEnable)bObject; + try { + boolean bl = this.low.getSelected(); + bLimitEnable.set(BLimitEnable.lowLimitEnable, (BValue)BBoolean.make((boolean)bl), context); + boolean bl2 = this.high.getSelected(); + bLimitEnable.set(BLimitEnable.highLimitEnable, (BValue)BBoolean.make((boolean)bl2), context); + } + catch (Exception exception) { + log.error("BLimitEnable SaveValue Failed: ", (Throwable)exception); + } + return bLimitEnable; + } + + private void initUi(BLimitEnable bLimitEnable) { + this.init = true; + BGridPane bGridPane = new BGridPane(2); + bGridPane.setColumnGap(6.0); + this.low = new BCheckBox(lex.getText("lowLimit.enable")); + bGridPane.add("low", (BValue)this.low); + this.high = new BCheckBox(lex.getText("highLimit.enable")); + bGridPane.add("high", (BValue)this.high); + this.setContent((BWidget)bGridPane); + this.linkTo("lk0", (BComponent)this.low, (Slot)BCheckBox.actionPerformed, (Slot)setModified); + this.linkTo("lk1", (BComponent)this.high, (Slot)BCheckBox.actionPerformed, (Slot)setModified); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BLinePrinterFE.java b/modules/cfr_output/com/tridium/alarm/ui/BLinePrinterFE.java new file mode 100644 index 0000000..dd78e4d --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BLinePrinterFE.java @@ -0,0 +1,99 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.workbench.fieldeditors.BDynamicEnumFE + * javax.baja.naming.SlotPath + * javax.baja.sys.BComplex + * javax.baja.sys.BComponent + * javax.baja.sys.BDynamicEnum + * javax.baja.sys.BEnumRange + * javax.baja.sys.BObject + * javax.baja.sys.Context + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BTextDropDown + * javax.baja.ui.BWidget + * javax.baja.workbench.BWbEditor + * javax.baja.workbench.fieldeditor.BWbFieldEditor + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.print.BLinePrinterRecipient; +import com.tridium.workbench.fieldeditors.BDynamicEnumFE; +import javax.baja.naming.SlotPath; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BDynamicEnum; +import javax.baja.sys.BEnumRange; +import javax.baja.sys.BObject; +import javax.baja.sys.Context; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BTextDropDown; +import javax.baja.ui.BWidget; +import javax.baja.workbench.BWbEditor; +import javax.baja.workbench.fieldeditor.BWbFieldEditor; + +public class BLinePrinterFE +extends BWbFieldEditor { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BLinePrinterFE == null ? (class$com$tridium$alarm$ui$BLinePrinterFE = BLinePrinterFE.class$("com.tridium.alarm.ui.BLinePrinterFE")) : class$com$tridium$alarm$ui$BLinePrinterFE)); + private BDynamicEnumFE printerFE = new BDynamicEnumFE(); + private BDynamicEnum printersEnum; + private boolean loaded = false; + static /* synthetic */ Class class$com$tridium$alarm$ui$BLinePrinterFE; + + public Type getType() { + return TYPE; + } + + public BLinePrinterFE() { + this.setContent((BWidget)this.printerFE); + this.linkTo("l1", (BComponent)this.printerFE, (Slot)BDynamicEnumFE.pluginModified, (Slot)setModified); + } + + protected void doLoadValue(BObject bObject, Context context) { + BComplex bComplex; + this.printersEnum = (BDynamicEnum)bObject; + BLinePrinterRecipient bLinePrinterRecipient = null; + for (bComplex = this.getParent(); bComplex != null && !(bComplex instanceof BWbEditor); bComplex = bComplex.getParent()) { + } + if (bComplex != null) { + bLinePrinterRecipient = (BLinePrinterRecipient)((BWbEditor)bComplex).getCurrentValue(); + } + if (!this.loaded) { + bLinePrinterRecipient.loadPrinters(); + this.loaded = true; + } + this.printerFE.loadValue(bObject, context); + } + + protected BObject doSaveValue(BObject bObject, Context context) throws Exception { + try { + return this.printerFE.saveValue(bObject, context); + } + catch (NumberFormatException numberFormatException) { + String string = ((BTextDropDown)this.printerFE.getContent()).getText(); + int[] nArray = this.printersEnum.getRange().getOrdinals(); + String[] stringArray = new String[nArray.length + 1]; + for (int i = 0; i < nArray.length; ++i) { + stringArray[i] = this.printersEnum.getRange().getTag(nArray[i]); + } + stringArray[nArray.length] = SlotPath.escape((String)string); + BEnumRange bEnumRange = BEnumRange.make((String[])stringArray); + return BDynamicEnum.make((int)nArray.length, (BEnumRange)bEnumRange); + } + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BNotesDialog.java b/modules/cfr_output/com/tridium/alarm/ui/BNotesDialog.java new file mode 100644 index 0000000..95d0226 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BNotesDialog.java @@ -0,0 +1,144 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BAbsTime + * javax.baja.sys.BValue + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BWindowEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.pane.BTextEditorPane + * javax.baja.ui.util.UiLexicon + * javax.baja.util.Lexicon + */ +package com.tridium.alarm.ui; + +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BValue; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BWindowEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.pane.BTextEditorPane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.util.Lexicon; + +public class BNotesDialog +extends BDialog { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BNotesDialog == null ? (class$com$tridium$alarm$ui$BNotesDialog = BNotesDialog.class$("com.tridium.alarm.ui.BNotesDialog")) : class$com$tridium$alarm$ui$BNotesDialog)); + BWidget widget; + String username; + BTextEditorPane historyPane; + BTextEditorPane addPane; + Command addCmd; + Command closeCmd; + boolean newNotes = false; + public static final UiLexicon lexicon = new UiLexicon(class$com$tridium$alarm$ui$BNotesDialog == null ? (class$com$tridium$alarm$ui$BNotesDialog = BNotesDialog.class$("com.tridium.alarm.ui.BNotesDialog")) : class$com$tridium$alarm$ui$BNotesDialog); + static /* synthetic */ Class class$com$tridium$alarm$ui$BNotesDialog; + + public Type getType() { + return TYPE; + } + + public BNotesDialog() { + throw new IllegalStateException(); + } + + public BNotesDialog(BWidget bWidget, String string, String string2, boolean bl) { + super(bWidget, lexicon.getText("alarm.notes"), true); + this.widget = bWidget; + this.username = string2; + this.historyPane = new BTextEditorPane(string, 12, 80, false); + this.addPane = new BTextEditorPane("", 6, 80, true); + this.addCmd = new AddCmd((BWidget)this); + if (!bl) { + this.addCmd.setEnabled(false); + } + this.closeCmd = new CloseCmd((BWidget)this); + BButton bButton = new BButton(this.addCmd, true, true); + BButton bButton2 = new BButton(this.closeCmd, true, true); + BGridPane bGridPane = new BGridPane(2); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + bGridPane.add("add", (BValue)bButton); + bGridPane.add("close", (BValue)bButton2); + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop((BWidget)new BBorderPane((BWidget)this.historyPane)); + bEdgePane.setCenter((BWidget)new BBorderPane((BWidget)this.addPane)); + bEdgePane.setBottom((BWidget)new BBorderPane((BWidget)bGridPane)); + this.setContent((BWidget)bEdgePane); + } + + public void open() { + this.newNotes = false; + this.addPane.getEditor().requestFocus(); + super.open(); + } + + public void windowClosing(BWindowEvent bWindowEvent) { + this.close(); + } + + public String getNewNotes() { + if (!this.newNotes) { + return null; + } + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("## " + BAbsTime.now() + " - " + this.username + " ##\n"); + stringBuffer.append(this.addPane.getText()); + stringBuffer.append("\n\n"); + return stringBuffer.toString(); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + class CloseCmd + extends Command { + CloseCmd(BWidget bWidget) { + super(bWidget, (Lexicon)UiLexicon.bajaui, "commands.close"); + } + + public CommandArtifact doInvoke() { + BNotesDialog.this.close(); + return null; + } + } + + class AddCmd + extends Command { + AddCmd(BWidget bWidget) { + super(bWidget, (Lexicon)lexicon, "commands.addNote"); + } + + public CommandArtifact doInvoke() { + BNotesDialog.this.newNotes = true; + BNotesDialog.this.close(); + return null; + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BPrinterFE.java b/modules/cfr_output/com/tridium/alarm/ui/BPrinterFE.java new file mode 100644 index 0000000..858041e --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BPrinterFE.java @@ -0,0 +1,127 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.gx.BImage + * javax.baja.sys.BComplex + * javax.baja.sys.BComponent + * javax.baja.sys.BIcon + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.BVector + * javax.baja.sys.Context + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BTextDropDown + * javax.baja.ui.BWidget + * javax.baja.workbench.BWbEditor + * javax.baja.workbench.fieldeditor.BWbFieldEditor + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.print.BPrinterRecipient; +import javax.baja.gx.BImage; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BIcon; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.BVector; +import javax.baja.sys.Context; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BTextDropDown; +import javax.baja.ui.BWidget; +import javax.baja.workbench.BWbEditor; +import javax.baja.workbench.fieldeditor.BWbFieldEditor; + +public class BPrinterFE +extends BWbFieldEditor { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BPrinterFE == null ? (class$com$tridium$alarm$ui$BPrinterFE = BPrinterFE.class$("com.tridium.alarm.ui.BPrinterFE")) : class$com$tridium$alarm$ui$BPrinterFE)); + BTextDropDown field = new BTextDropDown("", 20, true); + String[] options; + static /* synthetic */ Class class$com$tridium$alarm$ui$BPrinterFE; + + public Type getType() { + return TYPE; + } + + public BPrinterFE() { + this.setContent((BWidget)this.field); + this.linkTo("la", (BComponent)this.field, (Slot)BTextDropDown.valueModified, (Slot)setModified); + this.linkTo("lb", (BComponent)this.field, (Slot)BTextDropDown.actionPerformed, (Slot)actionPerformed); + } + + protected void doSetReadonly(boolean bl) { + this.field.getEditor().setEditable(!bl); + this.field.setDropDownEnabled(!bl); + } + + protected void doLoadValue(BObject bObject, Context context) { + this.loadName(bObject.toString()); + } + + protected String[] list() { + BComplex bComplex; + BPrinterRecipient bPrinterRecipient = null; + for (bComplex = this.getParent(); bComplex != null && !(bComplex instanceof BWbEditor); bComplex = bComplex.getParent()) { + } + if (bComplex != null) { + bPrinterRecipient = (BPrinterRecipient)((BWbEditor)bComplex).getCurrentValue(); + } + if (bPrinterRecipient != null) { + BVector bVector = bPrinterRecipient.getPrinters(); + Slot[] slotArray = bVector.getSlotsArray(); + String[] stringArray = new String[slotArray.length]; + for (int i = 0; i < stringArray.length; ++i) { + stringArray[i] = bVector.get(slotArray[i].asProperty()).toString(); + } + return stringArray; + } + return new String[0]; + } + + public void loadName(String string) { + this.field.setText(string); + this.field.getList().removeAllItems(); + this.options = this.list(); + String string2 = null; + if (this.options != null) { + for (int i = 0; i < this.options.length; ++i) { + if (this.options[i].equals(string)) { + string2 = this.options[i]; + } + this.field.getList().addItem(BImage.make((BIcon)BIcon.std((String)"print.png")), (Object)this.options[i]); + } + } + if (string2 != null) { + this.field.setText(string2); + } + } + + protected BObject doSaveValue(BObject bObject, Context context) { + return BString.make((String)this.saveName()); + } + + public String saveName() { + String string = this.field.getText(); + for (int i = 0; i < this.options.length; ++i) { + if (!this.options[i].equals(string)) continue; + string = this.options[i]; + break; + } + return string; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BRemoteStationFE.java b/modules/cfr_output/com/tridium/alarm/ui/BRemoteStationFE.java new file mode 100644 index 0000000..e52b62f --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BRemoteStationFE.java @@ -0,0 +1,128 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.fox.sys.BFoxSession + * com.tridium.fox.sys.NiagaraStation + * javax.baja.naming.BOrd + * javax.baja.naming.OrdTarget + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.Context + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BTextDropDown + * javax.baja.ui.BTextField + * javax.baja.ui.BWidget + * javax.baja.ui.list.BList + * javax.baja.ui.util.UiLexicon + * javax.baja.util.BFolder + * javax.baja.workbench.BWbShell + * javax.baja.workbench.fieldeditor.BWbFieldEditor + */ +package com.tridium.alarm.ui; + +import com.tridium.fox.sys.BFoxSession; +import com.tridium.fox.sys.NiagaraStation; +import javax.baja.naming.BOrd; +import javax.baja.naming.OrdTarget; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.Context; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BTextDropDown; +import javax.baja.ui.BTextField; +import javax.baja.ui.BWidget; +import javax.baja.ui.list.BList; +import javax.baja.ui.util.UiLexicon; +import javax.baja.util.BFolder; +import javax.baja.workbench.BWbShell; +import javax.baja.workbench.fieldeditor.BWbFieldEditor; + +public class BRemoteStationFE +extends BWbFieldEditor { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BRemoteStationFE == null ? (class$com$tridium$alarm$ui$BRemoteStationFE = BRemoteStationFE.class$("com.tridium.alarm.ui.BRemoteStationFE")) : class$com$tridium$alarm$ui$BRemoteStationFE)); + private static UiLexicon lex = new UiLexicon(class$com$tridium$alarm$ui$BAlarmDbView == null ? (class$com$tridium$alarm$ui$BAlarmDbView = BRemoteStationFE.class$("com.tridium.alarm.ui.BAlarmDbView")) : class$com$tridium$alarm$ui$BAlarmDbView); + private BTextDropDown remoteStation; + private boolean loaded = false; + static /* synthetic */ Class class$com$tridium$alarm$ui$BRemoteStationFE; + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmDbView; + + public Type getType() { + return TYPE; + } + + protected void doSetReadonly(boolean bl) { + if (bl) { + this.setContent((BWidget)new BTextField("", 45, false)); + } + } + + protected void doLoadValue(BObject bObject, Context context) { + if (this.loaded) { + return; + } + this.init(); + BString bString = (BString)bObject; + if (bString == null || bString.isNull() || bString.toString().equals("")) { + ((BTextDropDown)this.getContent()).setText(lex.getText("stationRecipient.selectStation")); + } else { + ((BTextDropDown)this.getContent()).setText(bString.toString()); + } + try { + BWbShell bWbShell = this.getWbShell(); + OrdTarget ordTarget = bWbShell.getActiveOrdTarget(); + BFoxSession bFoxSession = (BFoxSession)BOrd.toSession((BObject)ordTarget.get()); + BOrd bOrd = BOrd.make((BOrd)bWbShell.getActiveOrd(), (String)"service:niagaraDriver:NiagaraNetwork"); + BComponent bComponent = (BComponent)bOrd.get(); + BList bList = this.remoteStation.getList(); + this.loadStations(bComponent, bList); + } + catch (Exception exception) { + exception.printStackTrace(); + } + this.loaded = true; + } + + private void loadStations(BComponent bComponent, BList bList) { + bComponent.lease(); + BComponent[] bComponentArray = bComponent.getChildComponents(); + for (int i = 0; i < bComponentArray.length; ++i) { + BComponent bComponent2 = bComponentArray[i]; + if (bComponent2 instanceof NiagaraStation) { + bList.addItem((Object)bComponent2.getName()); + continue; + } + if (!(bComponent2 instanceof BFolder)) continue; + this.loadStations(bComponent2, bList); + } + } + + protected BObject doSaveValue(BObject bObject, Context context) { + if (this.remoteStation.getText().equals(lex.getText("stationRecipient.selectStation"))) { + return BString.make((String)""); + } + return BString.make((String)this.remoteStation.getText()); + } + + private void init() { + this.remoteStation = new BTextDropDown(); + this.setContent((BWidget)this.remoteStation); + this.linkTo("l0", (BComponent)this.remoteStation, (Slot)BTextDropDown.valueModified, (Slot)setModified); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BStringListFE.java b/modules/cfr_output/com/tridium/alarm/ui/BStringListFE.java new file mode 100644 index 0000000..0e328b0 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BStringListFE.java @@ -0,0 +1,155 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.workbench.fieldeditors.BDialogFE + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.enums.BHalign + * javax.baja.ui.enums.BValign + * javax.baja.ui.list.BList + * javax.baja.ui.list.DefaultListModel + * javax.baja.ui.list.ListModel + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BFlowPane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.util.UiLexicon + */ +package com.tridium.alarm.ui; + +import com.tridium.workbench.fieldeditors.BDialogFE; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.enums.BValign; +import javax.baja.ui.list.BList; +import javax.baja.ui.list.DefaultListModel; +import javax.baja.ui.list.ListModel; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BFlowPane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.util.UiLexicon; + +public class BStringListFE +extends BDialogFE { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BStringListFE == null ? (class$com$tridium$alarm$ui$BStringListFE = BStringListFE.class$("com.tridium.alarm.ui.BStringListFE")) : class$com$tridium$alarm$ui$BStringListFE)); + BList list; + DefaultListModel listModel; + BVector vector; + public static final UiLexicon lexicon = new UiLexicon(class$com$tridium$alarm$ui$BStringListFE == null ? (class$com$tridium$alarm$ui$BStringListFE = BStringListFE.class$("com.tridium.alarm.ui.BStringListFE")) : class$com$tridium$alarm$ui$BStringListFE); + static /* synthetic */ Class class$com$tridium$alarm$ui$BStringListFE; + static /* synthetic */ Class class$javax$baja$sys$BString; + + public Type getType() { + return TYPE; + } + + public BStringListFE() { + BFlowPane bFlowPane = new BFlowPane(); + bFlowPane.add(null, (BValue)this.getEditButton()); + this.setContent((BWidget)bFlowPane); + } + + public void doEditPressed() { + int n; + Command command = new Command((BWidget)this, BStringListFE.lexicon.module, "commands.addMsg"){ + + public CommandArtifact doInvoke() { + String string = BDialog.prompt((BWidget)BStringListFE.this, (String)"Add", (String)"", (int)40); + if (string != null) { + BStringListFE.this.listModel.addItem((Object)string); + } + return null; + } + }; + Command command2 = new Command((BWidget)this, BStringListFE.lexicon.module, "commands.removeMsg"){ + + public CommandArtifact doInvoke() { + int n = BStringListFE.this.list.getSelection().getItem(); + if (n > -1) { + BStringListFE.this.listModel.removeItem(n); + } + return null; + } + }; + Command command3 = new Command((BWidget)this, BStringListFE.lexicon.module, "commands.editMsg"){ + + public CommandArtifact doInvoke() { + String string; + String string2; + int n = BStringListFE.this.list.getSelection().getItem(); + if (n > -1 && (string2 = BDialog.prompt((BWidget)BStringListFE.this, (String)"Edit", (String)(string = BStringListFE.this.listModel.getItem(n).toString()), (int)40)) != null) { + BStringListFE.this.listModel.setItem(n, null, (Object)string2); + } + return null; + } + }; + BEdgePane bEdgePane = new BEdgePane(); + this.listModel = new DefaultListModel(); + this.list = new BList((ListModel)this.listModel); + this.list.setMultipleSelection(false); + BGridPane bGridPane = new BGridPane(1); + bGridPane.setValign(BValign.top); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.add(null, (BValue)new BButton(command)); + bGridPane.add(null, (BValue)new BButton(command2)); + bGridPane.add(null, (BValue)new BLabel("")); + bGridPane.add(null, (BValue)new BButton(command3)); + bEdgePane.setCenter((BWidget)this.list); + bEdgePane.setRight((BWidget)new BBorderPane((BWidget)bGridPane)); + BString[] bStringArray = (BString[])this.vector.getChildren(class$javax$baja$sys$BString == null ? (class$javax$baja$sys$BString = BStringListFE.class$("javax.baja.sys.BString")) : class$javax$baja$sys$BString); + for (n = 0; n < bStringArray.length; ++n) { + this.listModel.addItem((Object)bStringArray[n].toString()); + } + n = BDialog.open((BWidget)this, (String)"Edit", (Object)bEdgePane, (int)3); + if (n == 1) { + this.vector.removeAll(); + for (int i = 0; i < this.listModel.getItemCount(); ++i) { + this.vector.add(null, (BValue)BString.make((String)this.listModel.getItem(i).toString())); + } + this.setModified(); + } + } + + public void doLoadValue(BObject bObject, Context context) { + this.vector = (BVector)bObject; + } + + public BObject doSaveValue(BObject bObject, Context context) { + return this.vector; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BTextCustomizerFE.java b/modules/cfr_output/com/tridium/alarm/ui/BTextCustomizerFE.java new file mode 100644 index 0000000..8c7e20e --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BTextCustomizerFE.java @@ -0,0 +1,93 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.workbench.fieldeditors.BFrozenEnumFE + * com.tridium.workbench.fieldeditors.BStringFE + * javax.baja.sys.BComplex + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Flags + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BWidget + * javax.baja.ui.pane.BGridPane + * javax.baja.util.BFormat + * javax.baja.workbench.fieldeditor.BWbFieldEditor + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.BTextCustomizer; +import com.tridium.alarm.BTextOp; +import com.tridium.workbench.fieldeditors.BFrozenEnumFE; +import com.tridium.workbench.fieldeditors.BStringFE; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Flags; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BWidget; +import javax.baja.ui.pane.BGridPane; +import javax.baja.util.BFormat; +import javax.baja.workbench.fieldeditor.BWbFieldEditor; + +public class BTextCustomizerFE +extends BWbFieldEditor { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BTextCustomizerFE == null ? (class$com$tridium$alarm$ui$BTextCustomizerFE = BTextCustomizerFE.class$("com.tridium.alarm.ui.BTextCustomizerFE")) : class$com$tridium$alarm$ui$BTextCustomizerFE)); + BFrozenEnumFE opFE = new BFrozenEnumFE(); + BStringFE formatFE = new BStringFE(); + static /* synthetic */ Class class$com$tridium$alarm$ui$BTextCustomizerFE; + + public Type getType() { + return TYPE; + } + + protected void doSetReadonly(boolean bl) { + this.opFE.setReadonly(bl); + this.formatFE.setReadonly(bl); + } + + protected void doLoadValue(BObject bObject, Context context) { + BTextCustomizer bTextCustomizer = (BTextCustomizer)bObject; + this.opFE.loadValue((BObject)bTextCustomizer.getOp(), context); + this.formatFE.loadValue((BObject)BString.make((String)bTextCustomizer.getText().getFormat()), context); + BGridPane bGridPane = new BGridPane(2); + bGridPane.add("c0", (BValue)this.opFE); + bGridPane.add("c1", (BValue)this.formatFE); + this.setContent((BWidget)bGridPane); + this.opFE.setReadonly(Flags.isReadonly((BComplex)bTextCustomizer, (Slot)BTextCustomizer.op)); + this.formatFE.setReadonly(Flags.isReadonly((BComplex)bTextCustomizer, (Slot)BTextCustomizer.text)); + this.linkTo((BComponent)this.opFE, (Slot)BFrozenEnumFE.actionPerformed, (Slot)actionPerformed); + this.linkTo((BComponent)this.formatFE, (Slot)BStringFE.actionPerformed, (Slot)actionPerformed); + this.linkTo((BComponent)this.opFE, (Slot)BFrozenEnumFE.pluginModified, (Slot)setModified); + this.linkTo((BComponent)this.formatFE, (Slot)BStringFE.pluginModified, (Slot)setModified); + } + + protected BObject doSaveValue(BObject bObject, Context context) throws Exception { + BTextCustomizer bTextCustomizer = (BTextCustomizer)bObject; + BTextOp bTextOp = (BTextOp)this.opFE.saveValue(); + BString bString = (BString)this.formatFE.saveValue(); + bTextCustomizer.setOp(bTextOp); + bTextCustomizer.setText(BFormat.make((String)bString.toString())); + return bTextCustomizer; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BTimeZoneDisplay.java b/modules/cfr_output/com/tridium/alarm/ui/BTimeZoneDisplay.java new file mode 100644 index 0000000..d7c6964 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BTimeZoneDisplay.java @@ -0,0 +1,50 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BFrozenEnum + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.alarm.ui; + +import javax.baja.sys.BFrozenEnum; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public final class BTimeZoneDisplay +extends BFrozenEnum { + public static final int CONSOLE = 0; + public static final int SOURCE = 1; + public static final BTimeZoneDisplay console = new BTimeZoneDisplay(0); + public static final BTimeZoneDisplay source = new BTimeZoneDisplay(1); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BTimeZoneDisplay == null ? (class$com$tridium$alarm$ui$BTimeZoneDisplay = BTimeZoneDisplay.class$("com.tridium.alarm.ui.BTimeZoneDisplay")) : class$com$tridium$alarm$ui$BTimeZoneDisplay)); + public static final BTimeZoneDisplay DEFAULT = console; + static /* synthetic */ Class class$com$tridium$alarm$ui$BTimeZoneDisplay; + + public Type getType() { + return TYPE; + } + + public static BTimeZoneDisplay make(int n) { + return (BTimeZoneDisplay)console.getRange().get(n, false); + } + + public static BTimeZoneDisplay make(String string) { + return (BTimeZoneDisplay)console.getRange().get(string); + } + + private BTimeZoneDisplay(int n) { + super(n); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/BTrayIcon.java b/modules/cfr_output/com/tridium/alarm/ui/BTrayIcon.java new file mode 100644 index 0000000..d4a1862 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/BTrayIcon.java @@ -0,0 +1,214 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BComponent + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.ui.TrayIconListener; +import java.util.Enumeration; +import java.util.Vector; +import javax.baja.sys.BComponent; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public class BTrayIcon +extends BComponent { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BTrayIcon == null ? (class$com$tridium$alarm$ui$BTrayIcon = BTrayIcon.class$("com.tridium.alarm.ui.BTrayIcon")) : class$com$tridium$alarm$ui$BTrayIcon)); + private boolean isShowing = false; + private int nativePeer; + private int nativeImage; + private String toolTip; + private Vector listeners = new Vector(); + private Thread thread; + public static int YELLOW_ICON; + public static int GRAY_ICON; + public static int GREEN_ICON; + public static int RED_ICON; + public static int WHITE_ICON; + static /* synthetic */ Class class$com$tridium$alarm$ui$BTrayIcon; + + public Type getType() { + return TYPE; + } + + public BTrayIcon make() { + return new BTrayIcon(); + } + + public BTrayIcon() { + this.nativeImage = BTrayIcon.loadImage(System.mapLibraryName("trayIcon")); + this.toolTip = "Niagara Alarms"; + } + + public BTrayIcon(int n, String string) { + this.nativeImage = n; + this.toolTip = string; + } + + public boolean isShowing() { + return this.isShowing; + } + + public int getImage() { + return this.nativeImage; + } + + public String getToolTip() { + return this.toolTip; + } + + public void setImage(int n) { + this.nativeImage = n; + } + + public void setToolTip(String string) { + this.toolTip = string; + } + + public void show() { + this.isShowing = true; + this.doShow(); + } + + public void updateTrayIcon() { + this.updateTrayIcon(this.nativeImage, this.toolTip); + } + + public void updateTrayIcon(String string) { + this.updateTrayIcon(this.nativeImage, string); + } + + public void updateTrayIcon(int n) { + this.updateTrayIcon(n, this.toolTip); + } + + public void updateTrayIcon(int n, String string) { + this.nativeImage = n; + this.toolTip = string; + if (this.isShowing) { + this.nativePeer = this.nativeUpdate(this.nativeImage, string, this.nativePeer); + } + } + + public void hide() { + if (this.isShowing) { + this.isShowing = false; + this.nativeHide(this.nativePeer); + this.thread = null; + } + this.nativePeer = 0; + } + + private void doShow() { + if (this.thread != null) { + this.hide(); + } + this.thread = new Thread(){ + + public void run() { + BTrayIcon.this.nativePeer = BTrayIcon.this.nativeShow(BTrayIcon.this.nativeImage, BTrayIcon.this.toolTip, BTrayIcon.this.nativePeer); + } + }; + this.thread.start(); + } + + public void fireClicked() { + Vector vector = (Vector)this.listeners.clone(); + Enumeration enumeration = vector.elements(); + while (enumeration.hasMoreElements()) { + TrayIconListener trayIconListener = (TrayIconListener)enumeration.nextElement(); + trayIconListener.onTrayIconClicked(this); + } + } + + public void fireDoubleClicked() { + Vector vector = (Vector)this.listeners.clone(); + Enumeration enumeration = vector.elements(); + while (enumeration.hasMoreElements()) { + TrayIconListener trayIconListener = (TrayIconListener)enumeration.nextElement(); + trayIconListener.onTrayIconDoubleClicked(this); + } + } + + public void addTrayIconListener(TrayIconListener trayIconListener) { + this.listeners.addElement(trayIconListener); + } + + public void removeTrayIconListener(TrayIconListener trayIconListener) { + this.listeners.removeElement(trayIconListener); + } + + private native int nativeShow(int var1, String var2, int var3); + + private synchronized native int nativeUpdate(int var1, String var2, int var3); + + private native void nativeHide(int var1); + + private static synchronized native int nativeLoadImage(String var0, int var1) throws UnsatisfiedLinkError; + + private static synchronized native int nativeFreeImage(int var0) throws UnsatisfiedLinkError; + + public static int loadImage(String string) { + return BTrayIcon.loadImage(string, 0); + } + + public static int loadImage(String string, int n) { + try { + return BTrayIcon.nativeLoadImage(string, n); + } + catch (UnsatisfiedLinkError unsatisfiedLinkError) { + unsatisfiedLinkError.printStackTrace(); + return -1; + } + } + + protected static void freeImage(int n) { + try { + BTrayIcon.nativeFreeImage(n); + } + catch (UnsatisfiedLinkError unsatisfiedLinkError) { + unsatisfiedLinkError.printStackTrace(); + } + } + + public static void main(String[] stringArray) { + BTrayIcon bTrayIcon = new BTrayIcon(); + long l = System.currentTimeMillis(); + bTrayIcon.show(); + long l2 = System.currentTimeMillis(); + bTrayIcon.updateTrayIcon("77 UnAcked Alarms"); + long l3 = System.currentTimeMillis(); + System.out.println("show: " + (l2 - l) + "ms"); + System.out.println("end: " + (l3 - l2) + "ms"); + System.out.println("total: " + (l3 - l) + "ms"); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + try { + System.loadLibrary("trayIcon"); + } + catch (Throwable throwable) { + System.out.println("ERROR: Cannot load trayIcon native library"); + System.out.println(" " + throwable); + } + YELLOW_ICON = 0; + GRAY_ICON = 1; + GREEN_ICON = 2; + RED_ICON = 3; + WHITE_ICON = 4; + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/ConsoleColumns.java b/modules/cfr_output/com/tridium/alarm/ui/ConsoleColumns.java new file mode 100644 index 0000000..15a42c6 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/ConsoleColumns.java @@ -0,0 +1,280 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.naming.BOrd + * javax.baja.naming.BOrdList + * javax.baja.naming.SlotPath + * javax.baja.nre.util.TextUtil + * javax.baja.sys.BAbsTime + * javax.baja.sys.BFacets + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.ui.util.UiLexicon + * javax.baja.util.BFormat + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.BConsoleRecipient; +import com.tridium.alarm.ui.BIAlarmServiceView; +import com.tridium.alarm.ui.ConsoleTableModel; +import java.util.ArrayList; +import java.util.HashMap; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.alarm.BAlarmService; +import javax.baja.naming.BOrd; +import javax.baja.naming.BOrdList; +import javax.baja.naming.SlotPath; +import javax.baja.nre.util.TextUtil; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BFacets; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.ui.util.UiLexicon; +import javax.baja.util.BFormat; + +public class ConsoleColumns { + protected ArrayList columns; + protected ArrayList models = new ArrayList(); + protected BIAlarmServiceView alarmServiceView; + protected HashMap alarmClassDisplayNames = new HashMap(); + private boolean inited = false; + Context cx; + public static final UiLexicon lexicon = new UiLexicon(class$com$tridium$alarm$ui$BAlarmConsole == null ? (class$com$tridium$alarm$ui$BAlarmConsole = ConsoleColumns.class$("com.tridium.alarm.ui.BAlarmConsole")) : class$com$tridium$alarm$ui$BAlarmConsole); + static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmConsole; + + public ConsoleColumns() { + BAlarmRecord bAlarmRecord = new BAlarmRecord(); + Property[] propertyArray = bAlarmRecord.getPropertiesArray(); + this.columns = new ArrayList(propertyArray.length); + for (int i = 0; i < propertyArray.length; ++i) { + if (propertyArray[i].getType() == BAbsTime.TYPE) { + this.columns.add(new TimeColumn(propertyArray[i])); + continue; + } + this.columns.add(new PropertyColumn(propertyArray[i])); + } + } + + public void init(BIAlarmServiceView bIAlarmServiceView, Context context) { + this.alarmServiceView = bIAlarmServiceView; + this.cx = context; + this.inited = true; + } + + public int getColumnCount() { + return this.columns.size(); + } + + public Column getColumn(int n) { + return (Column)this.columns.get(n); + } + + public void addDataColumn(String string, String string2) { + this.columns.add(new DataColumn(string, SlotPath.escape((String)string2))); + } + + public int removeDataColumn(String string) { + int n = this.dataColumnIndex(string); + if (n != -1) { + this.columns.remove(n); + } + return n; + } + + public int dataColumnIndex(String string) { + int n = this.columns.size(); + for (int i = 0; i < n; ++i) { + Column column = (Column)this.columns.get(i); + if (!(column instanceof DataColumn) || !((DataColumn)column).key.equals(SlotPath.escape((String)string))) continue; + return i; + } + return -1; + } + + public void addModel(ConsoleTableModel consoleTableModel) { + this.models.add(consoleTableModel); + } + + public void removeModel(ConsoleTableModel consoleTableModel) { + this.models.remove((Object)consoleTableModel); + } + + public void fireModified() { + int n = this.models.size(); + for (int i = 0; i < n; ++i) { + ((ConsoleTableModel)((Object)this.models.get(i))).columnsModified(); + } + } + + private BAlarmService getAlarmService(BConsoleRecipient bConsoleRecipient) { + try { + return (BAlarmService)BOrd.make((String)"serivce:alarm:AlarmService").resolve((BObject)bConsoleRecipient).get(); + } + catch (Exception exception) { + return null; + } + } + + protected String getAlarmClassDisplayName(BAlarmRecord bAlarmRecord) { + String string = bAlarmRecord.getAlarmClass(); + if (this.inited) { + AlarmClassKey alarmClassKey; + String string2; + BOrdList bOrdList = bAlarmRecord.getSource(); + BOrd bOrd = bOrdList.get(bOrdList.size() - 1); + String string3 = bOrd.toString(); + if (string3.indexOf("|station:|") >= 0) { + string3 = string3.substring(0, string3.indexOf("|station:|")); + } + if ((string2 = (String)this.alarmClassDisplayNames.get(alarmClassKey = new AlarmClassKey(string3, string))) == null) { + BAlarmService bAlarmService = this.alarmServiceView.getAlarmService(bAlarmRecord); + if (bAlarmService == null) { + string2 = string; + } else { + string2 = bAlarmService.getAlarmClassDisplayName(BString.make((String)string), this.cx).toString(); + this.alarmClassDisplayNames.put(alarmClassKey, string2); + } + } + return string2; + } + return string; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private class AlarmClassKey { + String station; + String alarmClass; + + public AlarmClassKey(String string, String string2) { + this.station = string; + this.alarmClass = string2; + } + + public boolean equals(Object object) { + if (object instanceof AlarmClassKey) { + AlarmClassKey alarmClassKey = (AlarmClassKey)object; + return alarmClassKey.station.equals(this.station) && alarmClassKey.alarmClass.equals(this.alarmClass); + } + return false; + } + + public int hashCode() { + return new String(this.station + "|" + this.alarmClass).hashCode(); + } + } + + public class DataColumn + extends Column { + private String name; + private String key; + + public DataColumn(String string, String string2) { + this.name = string; + this.key = string2; + } + + public String getName() { + if (this.name == null) { + this.name = lexicon.get("alarmData." + this.key, null); + } + if (this.name == null) { + this.name = TextUtil.toFriendly((String)this.key); + } + return SlotPath.unescape((String)this.name); + } + + public String getKey() { + return this.key; + } + + public Object getValue(BAlarmRecord bAlarmRecord) { + if (this.key.equals("sourceOrd")) { + return bAlarmRecord.getSource(); + } + BFacets bFacets = bAlarmRecord.getAlarmData(); + Object object = bFacets.get(this.key); + if (object == null) { + return ""; + } + object = BFormat.make((String)object.toString()).format((Object)bAlarmRecord); + return object; + } + + public String getQueryName() { + return "alarmData." + this.key; + } + } + + public class TimeColumn + extends PropertyColumn { + public TimeColumn(Property property) { + super(property); + } + + public Object getValue(BAlarmRecord bAlarmRecord) { + BAbsTime bAbsTime = (BAbsTime)super.getValue(bAlarmRecord); + return bAbsTime; + } + } + + public class PropertyColumn + extends Column { + private Property prop; + + public PropertyColumn(Property property) { + this.prop = property; + } + + public String getName() { + return this.prop.getDefaultDisplayName(null); + } + + public Object getValue(BAlarmRecord bAlarmRecord) { + return this.getValue(bAlarmRecord, null); + } + + public Object getValue(BAlarmRecord bAlarmRecord, Context context) { + if (this.prop.equals(BAlarmRecord.source)) { + BString bString = (BString)bAlarmRecord.getAlarmData().get("sourceName"); + if (bString != null && bString != BString.DEFAULT) { + return BFormat.make((String)bString.toString(context)).format((Object)bAlarmRecord); + } + return bAlarmRecord.get(this.prop); + } + if (this.prop.equals(BAlarmRecord.alarmClass)) { + return ConsoleColumns.this.getAlarmClassDisplayName(bAlarmRecord); + } + return bAlarmRecord.get(this.prop); + } + + public String getQueryName() { + return this.prop.getName(); + } + } + + public static abstract class Column { + public abstract String getName(); + + public abstract String getQueryName(); + + public abstract Object getValue(BAlarmRecord var1); + + public Object getValue(BAlarmRecord bAlarmRecord, Context context) { + return this.getValue(bAlarmRecord); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/ConsoleTableModel.java b/modules/cfr_output/com/tridium/alarm/ui/ConsoleTableModel.java new file mode 100644 index 0000000..4b9302a --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/ConsoleTableModel.java @@ -0,0 +1,228 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.data.BDataTable + * javax.baja.collection.BITable + * javax.baja.data.BIDataValue + * javax.baja.gx.BImage + * javax.baja.naming.BOrdList + * javax.baja.naming.SlotPath + * javax.baja.nre.util.TextUtil + * javax.baja.sys.BAbsTime + * javax.baja.sys.BFacets + * javax.baja.sys.BIcon + * javax.baja.sys.BObject + * javax.baja.sys.BString + * javax.baja.sys.Context + * javax.baja.sys.Type + * javax.baja.timezone.BTimeZone + * javax.baja.ui.table.DynamicTableModel + * javax.baja.ui.table.TableModel + * javax.baja.util.BFormat + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.ui.BAlarmConsoleOptions; +import com.tridium.alarm.ui.BIAlarmServiceView; +import com.tridium.alarm.ui.BTimeZoneDisplay; +import com.tridium.alarm.ui.ConsoleColumns; +import com.tridium.data.BDataTable; +import javax.baja.alarm.BAckState; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.alarm.BSourceState; +import javax.baja.collection.BITable; +import javax.baja.data.BIDataValue; +import javax.baja.gx.BImage; +import javax.baja.naming.BOrdList; +import javax.baja.naming.SlotPath; +import javax.baja.nre.util.TextUtil; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BFacets; +import javax.baja.sys.BIcon; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.Context; +import javax.baja.sys.Type; +import javax.baja.timezone.BTimeZone; +import javax.baja.ui.table.DynamicTableModel; +import javax.baja.ui.table.TableModel; +import javax.baja.util.BFormat; + +public abstract class ConsoleTableModel +extends TableModel { + private static BImage alarmImg = BImage.make((String)"module://icons/x16/alarm.png"); + private static BImage redAlarmImg = BImage.make((String)"module://alarm/com/tridium/alarm/icons/alarmRed.png"); + private static BImage greenAlarmImg = BImage.make((String)"module://alarm/com/tridium/alarm/icons/alarmGreen.png"); + private static BImage orangeAlarmImg = BImage.make((String)"module://alarm/com/tridium/alarm/icons/alarmOrange.png"); + private static BImage whiteAlarmImg = BImage.make((String)"module://alarm/com/tridium/alarm/icons/alarmWhite.png"); + public BAlarmConsoleOptions options = BAlarmConsoleOptions.getDefault(); + private ConsoleColumns columns; + private int sortCol = 5; + private boolean sortAsc = false; + public static final BFacets TIME_FACETS = BFacets.make((String)"showSeconds", (boolean)true); + + public ConsoleTableModel(ConsoleColumns consoleColumns) { + this.columns = consoleColumns; + consoleColumns.addModel(this); + } + + public void init(BIAlarmServiceView bIAlarmServiceView, Context context) { + this.columns.init(bIAlarmServiceView, context); + } + + public abstract BAlarmRecord getRecord(int var1); + + public BAlarmRecord getRecord(BOrdList bOrdList, int n) { + return this.getRecord(n); + } + + public abstract int getAlarmCount(); + + public int getAlarmCount(BOrdList bOrdList) { + return this.getAlarmCount(); + } + + public abstract int getSourceCount(); + + public ConsoleColumns getColumns() { + return this.columns; + } + + public int getColumnCount() { + return this.columns.getColumnCount(); + } + + public String getColumnName(int n) { + return this.columns.getColumn(n).getName(); + } + + public void addDataColumn(String string, String string2) { + this.columns.addDataColumn(string, string2); + } + + public void removeDataColumn(String string) { + this.columns.removeDataColumn(string); + } + + public void columnsModified() { + this.updateTable(); + } + + public Object getSubject(int n) { + return this.getRecord(n); + } + + public Object getValueAt(int n, int n2) { + BAlarmRecord bAlarmRecord; + ConsoleColumns.Column column = this.columns.getColumn(n2); + Object object = column.getValue(bAlarmRecord = this.getRecord(n)); + if (object instanceof BAbsTime) { + if (this.options.getTimeZoneDisplay() == BTimeZoneDisplay.source) { + return ((BAbsTime)object).toString((Context)BFacets.make((BFacets)bAlarmRecord.getAlarmData(), (BFacets)TIME_FACETS)); + } + return ((BAbsTime)object).toString((Context)BFacets.make((BFacets)TIME_FACETS, (String)"TimeZone", (BIDataValue)BTimeZone.getLocal())); + } + if (object instanceof BString || object instanceof String) { + return TextUtil.replace((String)object.toString(), (String)"\\n", (String)" "); + } + if (object instanceof BFacets) { + return BFormat.make((String)object.toString()).format((Object)bAlarmRecord).replace('\n', ' '); + } + if (object instanceof String) { + return TextUtil.replace((String)object.toString(), (String)"\\n", (String)" "); + } + return object; + } + + public BImage getRowIcon(int n) { + BAlarmRecord bAlarmRecord = this.getRecord(n); + BImage bImage = alarmImg; + BSourceState bSourceState = bAlarmRecord.getSourceState(); + BAckState bAckState = bAlarmRecord.getAckState(); + if (bSourceState == BSourceState.alert && bAckState != BAckState.acked) { + bImage = orangeAlarmImg; + } else if (bSourceState == BSourceState.alert && bAckState == BAckState.acked) { + bImage = whiteAlarmImg; + } else if (bAckState == BAckState.acked && bSourceState != BSourceState.normal) { + bImage = alarmImg; + } else if (bSourceState == BSourceState.normal && bAckState != BAckState.acked) { + bImage = greenAlarmImg; + } else if (bAckState != BAckState.acked && bSourceState != BSourceState.normal) { + bImage = redAlarmImg; + } else if (bAckState == BAckState.acked && bSourceState == BSourceState.normal) { + bImage = whiteAlarmImg; + } + if (bAlarmRecord.getAlarmData().get("notes") != null) { + return BImage.make((BIcon)BIcon.make((BIcon)BIcon.make((BOrdList)bImage.getOrdList()), (BIcon)BIcon.std((String)"badges/note.png"))); + } + return bImage; + } + + public void close() { + this.columns.removeModel(this); + } + + public BITable export() { + int n; + int n2 = this.getTable().getModel().getColumnCount(); + int n3 = this.getTable().getModel().getRowCount(); + BDataTable bDataTable = new BDataTable(); + for (n = 0; n < n2; ++n) { + String string = this.getTable().getModel().getColumnName(n); + String string2 = SlotPath.escape((String)string); + Type type = BIDataValue.TYPE; + bDataTable.addColumn(string2, string, type, 0, BFacets.NULL); + } + bDataTable.startRows(); + for (n = 0; n < n3; ++n) { + bDataTable.startRow(); + for (int i = 0; i < n2; ++i) { + int n4 = i; + if (this.getTable().getModel() instanceof DynamicTableModel) { + n4 = ((DynamicTableModel)this.getTable().getModel()).toRootColumnIndex(i); + } + bDataTable.set(this.export(n, n4).toDataValue(), BFacets.NULL); + } + bDataTable.endRow(); + } + bDataTable.endRows(); + return bDataTable; + } + + public BObject export(int n, int n2) { + ConsoleColumns.Column column = this.getColumns().getColumn(n2); + if (column instanceof ConsoleColumns.DataColumn) { + return BString.make((String)SlotPath.unescape((String)this.hexCorrection(this.getValueAt(n, n2).toString()))); + } + return super.export(n, n2); + } + + private String hexCorrection(String string) { + int n = string.split("at ").length; + int n2 = string.split(".java:").length; + string = string.replaceAll("\n", " ").trim(); + if (n == n2 && string.matches(".*java:[0-9]+\\)$")) { + string = string.replaceAll("\\$", "\\$24"); + } + return string; + } + + public boolean isColumnSortable(int n) { + return true; + } + + public void setInitialSort(int n, boolean bl) { + this.sortCol = n; + this.sortAsc = bl; + } + + public int getLastSortColumn() { + return this.sortCol; + } + + public boolean getLastSortAscending() { + return this.sortAsc; + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/MediaPlayer.java b/modules/cfr_output/com/tridium/alarm/ui/MediaPlayer.java new file mode 100644 index 0000000..2886a1c --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/MediaPlayer.java @@ -0,0 +1,79 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BAbstractFile + * javax.baja.sys.BRelTime + * javax.baja.sys.BValue + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.ui.SoundPlayer; +import java.io.BufferedInputStream; +import java.io.InputStream; +import javax.baja.file.BAbstractFile; +import javax.baja.sys.BRelTime; +import javax.baja.sys.BValue; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.DataLine; +import javax.sound.sampled.SourceDataLine; + +public class MediaPlayer +extends SoundPlayer { + static /* synthetic */ Class class$javax$sound$sampled$SourceDataLine; + + public MediaPlayer() { + } + + public MediaPlayer(BValue bValue, BAbstractFile bAbstractFile) { + this.addMediaObject(bValue, bAbstractFile); + } + + public MediaPlayer(BValue bValue, BAbstractFile bAbstractFile, BRelTime bRelTime) { + this.addMediaObject(bValue, bAbstractFile); + this.delay = bRelTime; + } + + protected void processMediaObject(Object object) throws Exception { + BAbstractFile bAbstractFile; + InputStream inputStream; + BufferedInputStream bufferedInputStream; + AudioInputStream audioInputStream; + AudioFormat audioFormat; + DataLine.Info info = new DataLine.Info(class$javax$sound$sampled$SourceDataLine == null ? (class$javax$sound$sampled$SourceDataLine = MediaPlayer.class$("javax.sound.sampled.SourceDataLine")) : class$javax$sound$sampled$SourceDataLine, audioFormat = (audioInputStream = AudioSystem.getAudioInputStream(bufferedInputStream = new BufferedInputStream(inputStream = (bAbstractFile = (BAbstractFile)object).getInputStream()))).getFormat()); + if (!AudioSystem.isLineSupported(info)) { + logger.warning("BAlarmConsole: audio system does not handle this type of audio: " + audioFormat); + return; + } + SourceDataLine sourceDataLine = (SourceDataLine)AudioSystem.getLine(info); + sourceDataLine.open(audioFormat); + sourceDataLine.start(); + int n = (int)bAbstractFile.getSize(); + if (n > 4096) { + n = 4096; + } + byte[] byArray = new byte[n]; + int n2 = 0; + int n3 = 0; + while (!this.stopRequest) { + ++n3; + n2 = audioInputStream.read(byArray, 0, byArray.length); + if (n2 < 0) break; + sourceDataLine.write(byArray, 0, n2); + } + sourceDataLine.drain(); + sourceDataLine.close(); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/SoundPlayer.java b/modules/cfr_output/com/tridium/alarm/ui/SoundPlayer.java new file mode 100644 index 0000000..ebd9263 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/SoundPlayer.java @@ -0,0 +1,196 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.log.Log + * javax.baja.nre.util.Array + * javax.baja.sys.BRelTime + * javax.baja.sys.BValue + * javax.baja.util.Queue + */ +package com.tridium.alarm.ui; + +import java.awt.Toolkit; +import java.util.ArrayList; +import java.util.HashMap; +import javax.baja.log.Log; +import javax.baja.nre.util.Array; +import javax.baja.sys.BRelTime; +import javax.baja.sys.BValue; +import javax.baja.util.Queue; + +public class SoundPlayer { + protected boolean stopRequest = false; + protected Queue media = new Queue(); + protected HashMap soundToSourcesMap = new HashMap(); + protected HashMap sourceToSoundMap = new HashMap(); + protected boolean isPlaying = false; + protected BRelTime delay = BRelTime.make((long)1000L); + public static final Log logger = Log.getLog((String)"bajaui"); + private ArrayList listeners = new ArrayList(); + static /* synthetic */ Class class$javax$baja$sys$BValue; + + public SoundPlayer() { + } + + public SoundPlayer(BRelTime bRelTime) { + this.delay = bRelTime; + } + + public boolean addMediaObject(BValue bValue, Object object) { + Array array = (Array)this.soundToSourcesMap.get(object); + if (array == null) { + array = new Array(class$javax$baja$sys$BValue == null ? (class$javax$baja$sys$BValue = SoundPlayer.class$("javax.baja.sys.BValue")) : class$javax$baja$sys$BValue); + array.add((Object)bValue); + this.soundToSourcesMap.put(object, array); + this.sourceToSoundMap.put(bValue, object); + this.media.enqueue(object); + return true; + } + if (!array.contains((Object)bValue)) { + array.add((Object)bValue); + this.soundToSourcesMap.put(object, array); + this.sourceToSoundMap.put(bValue, object); + this.media.enqueue(object); + return true; + } + return false; + } + + public void removeMediaObject(BValue bValue) { + Object v = this.sourceToSoundMap.remove(bValue); + Array array = (Array)this.soundToSourcesMap.get(v); + if (array != null) { + array.remove((Object)bValue); + if (array.size() == 0) { + this.soundToSourcesMap.remove(v); + } + } + } + + public boolean hasMediaObjects() { + return this.media.size() > 0 && this.soundToSourcesMap.size() > 0; + } + + public void setDelay(BRelTime bRelTime) { + this.delay = bRelTime.getMillis() < 1000L ? BRelTime.make((long)1000L) : bRelTime; + } + + public BRelTime getDelay() { + return this.delay; + } + + public void beep() { + Toolkit.getDefaultToolkit().beep(); + } + + protected void processMediaObject(Object object) throws Exception { + this.beep(); + } + + public boolean isPlaying() { + return this.isPlaying; + } + + public void play() throws Exception { + this.play(true); + } + + public void play(boolean bl) throws Exception { + this.play(bl, this.delay); + } + + public void play(boolean bl, BRelTime bRelTime) throws Exception { + this.delay = bRelTime; + if (this.media.isEmpty()) { + throw new Exception("Cannot play: Media File(s) not specified."); + } + if (this.isPlaying) { + return; + } + this.stopRequest = false; + PlayThread playThread = new PlayThread(bl); + playThread.start(); + } + + public void stop() { + this.stopRequest = true; + this.soundToSourcesMap.clear(); + this.sourceToSoundMap.clear(); + this.media.clear(); + } + + public void fireMediaPlayerStopped() { + for (int i = 0; i < this.listeners.size(); ++i) { + ((MediaPlayerListener)this.listeners.get(i)).mediaPlayerStopped(); + } + } + + public void addListener(MediaPlayerListener mediaPlayerListener) { + this.listeners.add(mediaPlayerListener); + } + + public void removeListener(MediaPlayerListener mediaPlayerListener) { + this.listeners.remove(mediaPlayerListener); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public static interface MediaPlayerListener { + public void mediaPlayerStopped(); + } + + private class PlayThread + extends Thread { + private boolean continuous; + + PlayThread(boolean bl) { + super("Alarm: MediaPlayer"); + this.continuous = bl; + } + + public void run() { + block4: while (true) { + try { + while (!SoundPlayer.this.media.isEmpty()) { + SoundPlayer.this.isPlaying = true; + Object object = SoundPlayer.this.media.dequeue(); + if (SoundPlayer.this.stopRequest) break block4; + if (SoundPlayer.this.soundToSourcesMap.get(object) != null) { + SoundPlayer.this.processMediaObject(object); + if (this.continuous) { + SoundPlayer.this.media.enqueue(object); + } + } + try { + Thread.sleep(SoundPlayer.this.delay.getMillis()); + continue block4; + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + break; + } + catch (Exception exception) { + logger.error("BAlarmConsole.soundAlarm: failed to play alarm sound: " + exception); + break; + } + } + if (SoundPlayer.this.stopRequest || !this.continuous && SoundPlayer.this.media.isEmpty()) { + SoundPlayer.this.fireMediaPlayerStopped(); + } + SoundPlayer.this.stopRequest = false; + SoundPlayer.this.isPlaying = false; + SoundPlayer.this.media.clear(); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/SourceTableModel.java b/modules/cfr_output/com/tridium/alarm/ui/SourceTableModel.java new file mode 100644 index 0000000..4e3dcf4 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/SourceTableModel.java @@ -0,0 +1,566 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.naming.BOrdList + * javax.baja.nre.util.SortUtil + * javax.baja.sys.BAbsTime + * javax.baja.sys.Context + * javax.baja.sys.Cursor + * javax.baja.ui.table.TableModel + * javax.baja.util.BUuid + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.BConsoleRecipient; +import com.tridium.alarm.ui.AlarmTableModel; +import com.tridium.alarm.ui.BIAlarmServiceView; +import com.tridium.alarm.ui.ConsoleColumns; +import com.tridium.alarm.ui.ConsoleTableModel; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; +import javax.baja.alarm.BAckState; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.naming.BOrdList; +import javax.baja.nre.util.SortUtil; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.Context; +import javax.baja.sys.Cursor; +import javax.baja.ui.table.TableModel; +import javax.baja.util.BUuid; + +public class SourceTableModel +extends ConsoleTableModel { + protected BConsoleRecipient recip; + private ArrayList srcList = new ArrayList(); + private HashMap bySrc = new HashMap(); + private UuidList byUuid = new UuidList(); + private boolean holdUpdates = false; + private boolean updatePending = false; + BIAlarmServiceView alarmServiceView; + public Context context; + + public SourceTableModel(ConsoleColumns consoleColumns, BConsoleRecipient bConsoleRecipient, Context context) { + super(consoleColumns); + this.recip = bConsoleRecipient; + this.context = context; + } + + public void init(BIAlarmServiceView bIAlarmServiceView, Context context) { + super.init(bIAlarmServiceView, context); + this.alarmServiceView = bIAlarmServiceView; + this.context = context; + } + + public synchronized void load(Cursor cursor) { + this.setHoldUpdates(true); + this.clear(); + this.doAdd(cursor); + this.setHoldUpdates(false); + } + + public synchronized void add(Cursor cursor) { + this.setHoldUpdates(true); + this.doAdd(cursor); + this.setHoldUpdates(false); + } + + private synchronized void doAdd(Cursor cursor) { + while (cursor.next()) { + BAlarmRecord bAlarmRecord = (BAlarmRecord)cursor.get(); + this.recip.lease(); + if (!this.recip.accept(bAlarmRecord)) continue; + bAlarmRecord = this.updateAlarmRecord(bAlarmRecord); + this.update(bAlarmRecord, false); + } + this.sortByColumn(this.getLastSortColumn(), this.getLastSortAscending()); + } + + protected BAlarmRecord updateAlarmRecord(BAlarmRecord bAlarmRecord) { + return bAlarmRecord; + } + + public synchronized BAlarmRecord getRecord(int n) { + if (n < this.srcList.size()) { + return ((AlarmList)this.srcList.get(n)).getMostRecentRecord(); + } + return null; + } + + public synchronized int getRecordCount(int n) { + return ((AlarmList)this.srcList.get(n)).size(); + } + + public synchronized BAlarmRecord getRecordAt(int n, int n2) { + AlarmList alarmList = (AlarmList)this.srcList.get(n); + AlarmEntry alarmEntry = alarmList.getEntry(n2); + return alarmEntry.rec; + } + + public synchronized void clear() { + this.srcList.clear(); + this.bySrc.clear(); + this.byUuid.clear(); + this.updateTable(); + } + + public int getAlarmCount() { + return this.byUuid.getAlarmCount(); + } + + public int getSourceCount() { + return this.getRowCount(); + } + + private synchronized void add(BAlarmRecord bAlarmRecord, boolean bl) { + BOrdList bOrdList = (bAlarmRecord = this.updateAlarmRecord(bAlarmRecord)).getSource(); + AlarmList alarmList = (AlarmList)this.bySrc.get(bOrdList); + if (alarmList == null) { + alarmList = new AlarmList(bOrdList); + this.srcList.add(alarmList); + this.bySrc.put(bOrdList, alarmList); + AlarmEntry alarmEntry = alarmList.add(bAlarmRecord); + this.byUuid.put(bAlarmRecord.getUuid(), alarmEntry); + } else { + AlarmEntry alarmEntry = alarmList.add(bAlarmRecord); + this.byUuid.put(bAlarmRecord.getUuid(), alarmEntry); + } + if (bl) { + this.sortListByColumn(alarmList, this.getLastSortColumn(), this.getLastSortAscending()); + this.sortByColumn(this.getLastSortColumn(), this.getLastSortAscending()); + } + this.updateTable(); + } + + public synchronized void update(BAlarmRecord bAlarmRecord) { + this.update(bAlarmRecord, true); + } + + public synchronized void update(BAlarmRecord bAlarmRecord, boolean bl) { + AlarmEntry alarmEntry = this.byUuid.get(bAlarmRecord.getUuid(), bAlarmRecord.getSource()); + if (alarmEntry != null && alarmEntry.rec.getSource().equals((Object)bAlarmRecord.getSource())) { + BAlarmRecord bAlarmRecord2 = alarmEntry.rec; + alarmEntry.rec = bAlarmRecord = this.updateAlarmRecord(bAlarmRecord); + if (!bAlarmRecord2.isAcknowledged() && !bAlarmRecord2.isAckPending() && alarmEntry.rec.isAckPending()) { + alarmEntry.list.ackPendingCount++; + alarmEntry.list.unackedCount--; + } else if (bAlarmRecord2.isAckPending() && alarmEntry.rec.isAcknowledged()) { + alarmEntry.list.ackPendingCount--; + alarmEntry.list.ackedCount++; + } else if (bAlarmRecord2.isAckPending() && !alarmEntry.rec.isAcknowledged() && !alarmEntry.rec.isAckPending()) { + alarmEntry.list.ackPendingCount--; + alarmEntry.list.unackedCount++; + } else if (bAlarmRecord2.isAcknowledged() && !alarmEntry.rec.isAcknowledged() && !alarmEntry.rec.isAckPending()) { + alarmEntry.list.ackedCount--; + alarmEntry.list.unackedCount++; + } else if (bAlarmRecord2.isAcknowledged() && alarmEntry.rec.isAckPending()) { + alarmEntry.list.ackedCount--; + alarmEntry.list.ackPendingCount++; + } else if (alarmEntry.rec.isAcknowledged() && !bAlarmRecord2.isAcknowledged() && !bAlarmRecord2.isAckPending()) { + alarmEntry.list.ackedCount++; + alarmEntry.list.unackedCount--; + } + alarmEntry.list.fireModified(); + this.updateTable(); + } else { + this.add(bAlarmRecord, bl); + } + } + + public synchronized void remove(BAlarmRecord bAlarmRecord) { + BUuid bUuid = bAlarmRecord.getUuid(); + AlarmEntry[] alarmEntryArray = this.byUuid.get(bUuid); + for (int i = 0; i < alarmEntryArray.length; ++i) { + AlarmEntry alarmEntry = alarmEntryArray[i]; + if (alarmEntry == null) { + return; + } + this.byUuid.remove(bUuid); + AlarmList alarmList = alarmEntry.list; + alarmList.remove(alarmEntry); + if (alarmList.size() != 0) continue; + this.bySrc.remove(alarmList.getSource()); + this.srcList.remove(alarmList); + } + this.sortByColumn(this.getLastSortColumn(), this.getLastSortAscending()); + this.updateTable(); + } + + public synchronized void removeSource(BOrdList bOrdList) { + AlarmList alarmList = (AlarmList)this.bySrc.get(bOrdList); + for (int i = 0; i < alarmList.size(); ++i) { + AlarmEntry alarmEntry = alarmList.getEntry(i); + this.byUuid.remove(alarmEntry.rec.getUuid()); + } + this.bySrc.remove(bOrdList); + this.srcList.remove(alarmList); + this.updateTable(); + } + + public synchronized int getRowCount() { + return this.srcList.size(); + } + + public synchronized Object getValueAt(int n, int n2) { + if (n2 == 3) { + ConsoleColumns.Column column = this.getColumns().getColumn(n2); + BAlarmRecord bAlarmRecord = this.getRecord(n); + if (bAlarmRecord == null) { + return ""; + } + AlarmList alarmList = (AlarmList)this.bySrc.get(bAlarmRecord.getSource()); + if (alarmList == null) { + return ""; + } + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(alarmList.getAckedCount() + " " + BAckState.acked.getDisplayTag(this.context) + " / " + alarmList.getUnackedCount() + " " + BAckState.unacked.getDisplayTag(this.context)); + if (alarmList.getAckPendingCount() > 0) { + stringBuffer.append(" / " + alarmList.getAckPendingCount() + " " + BAckState.ackPending.getDisplayTag(this.context)); + } + return stringBuffer.toString(); + } + return super.getValueAt(n, n2); + } + + public synchronized AlarmTableModel getModelForSource(BOrdList bOrdList) { + AlarmList alarmList = (AlarmList)this.bySrc.get(bOrdList); + if (alarmList == null) { + return null; + } + AlarmTableModel alarmTableModel = new AlarmTableModel(this.getColumns(), alarmList); + alarmTableModel.sortByColumn(this.getLastSortColumn(), this.getLastSortAscending()); + alarmTableModel.init(this.alarmServiceView, this.context); + return alarmTableModel; + } + + public synchronized int getUnackedCountForSource(BOrdList bOrdList) { + if (this.bySrc.get(bOrdList) == null) { + return 0; + } + return ((AlarmList)this.bySrc.get(bOrdList)).getUnackedCount(); + } + + public synchronized int getAckedCountForSource(BOrdList bOrdList) { + if (this.bySrc.get(bOrdList) == null) { + return 0; + } + return ((AlarmList)this.bySrc.get(bOrdList)).getAckedCount(); + } + + public synchronized int getAckPendingCountForSource(BOrdList bOrdList) { + if (this.bySrc.get(bOrdList) == null) { + return 0; + } + return ((AlarmList)this.bySrc.get(bOrdList)).getAckPendingCount(); + } + + public synchronized int getAlarmCount(BOrdList bOrdList) { + if (bOrdList == null) { + return 0; + } + AlarmList alarmList = (AlarmList)this.bySrc.get(bOrdList); + if (alarmList != null) { + return alarmList.size(); + } + return 0; + } + + public synchronized BAlarmRecord getRecord(BOrdList bOrdList, int n) { + if (bOrdList == null) { + return null; + } + AlarmList alarmList = (AlarmList)this.bySrc.get(bOrdList); + if (alarmList == null || alarmList.size() == 0) { + return null; + } + return alarmList.getRecord(n); + } + + private synchronized void setHoldUpdates(boolean bl) { + this.holdUpdates = bl; + if (!this.holdUpdates && this.updatePending) { + this.updatePending = false; + this.updateTable(); + } + } + + public synchronized void updateTable() { + if (this.holdUpdates) { + this.updatePending = true; + } else { + super.updateTable(); + } + } + + public synchronized void updateTable(boolean bl) { + if (this.holdUpdates) { + this.updatePending = true; + } else { + super.updateTable(bl); + } + } + + public synchronized void sortByColumn(int n, boolean bl) { + if (n < 0 || n >= super.getColumnCount()) { + return; + } + this.setInitialSort(n, bl); + ConsoleColumns.Column column = this.getColumns().getColumn(n); + if (bl) { + this.sortSrcList(column, SortUtil.ASCENDING); + } else { + this.sortSrcList(column, SortUtil.DESCENDING); + } + } + + public void sortSrcList(ConsoleColumns.Column column, Comparator comparator) { + int n = this.srcList.size(); + for (int i = n / 2; i >= 1; i /= 2) { + for (int j = i; j < n; ++j) { + int n2; + AlarmList alarmList = (AlarmList)this.srcList.get(j); + Object object = column.getValue(alarmList.getMostRecentRecord()); + for (n2 = j; n2 >= i && comparator.compare(object, column.getValue(((AlarmList)this.srcList.get(n2 - i)).getMostRecentRecord())) <= 0; n2 -= i) { + if (comparator.compare(object, column.getValue(((AlarmList)this.srcList.get(n2 - i)).getMostRecentRecord())) == 0) { + BAbsTime bAbsTime = alarmList.getMostRecentRecord().getTimestamp(); + BAbsTime bAbsTime2 = ((AlarmList)this.srcList.get(n2 - i)).getMostRecentRecord().getTimestamp(); + if (!bAbsTime2.isBefore(bAbsTime)) break; + this.srcList.set(n2, this.srcList.get(n2 - i)); + continue; + } + this.srcList.set(n2, this.srcList.get(n2 - i)); + } + this.srcList.set(n2, alarmList); + } + } + } + + public synchronized void sortListByColumn(AlarmList alarmList, int n, boolean bl) { + if (n < 0 || n >= super.getColumnCount()) { + return; + } + this.setInitialSort(n, bl); + ConsoleColumns.Column column = this.getColumns().getColumn(n); + if (bl) { + alarmList.sort(column, SortUtil.ASCENDING); + } else { + alarmList.sort(column, SortUtil.DESCENDING); + } + } + + class UuidList { + private HashMap byUuid = new HashMap(); + + UuidList() { + } + + public void put(BUuid bUuid, AlarmEntry alarmEntry) { + HashMap hashMap = (HashMap)this.byUuid.get(bUuid); + if (hashMap == null) { + hashMap = new HashMap(); + } + hashMap.put(alarmEntry.rec.getSource(), alarmEntry); + this.byUuid.put(bUuid, hashMap); + } + + public AlarmEntry get(BUuid bUuid, BOrdList bOrdList) { + HashMap hashMap = (HashMap)this.byUuid.get(bUuid); + if (hashMap == null) { + return null; + } + return (AlarmEntry)hashMap.get(bOrdList); + } + + public AlarmEntry[] get(BUuid bUuid) { + HashMap hashMap = (HashMap)this.byUuid.get(bUuid); + if (hashMap == null) { + return new AlarmEntry[0]; + } + Object[] objectArray = hashMap.values().toArray(); + AlarmEntry[] alarmEntryArray = new AlarmEntry[objectArray.length]; + for (int i = 0; i < objectArray.length; ++i) { + alarmEntryArray[i] = (AlarmEntry)objectArray[i]; + } + return alarmEntryArray; + } + + public int size() { + return this.byUuid.size(); + } + + public int getAlarmCount() { + int n = 0; + Iterator iterator = this.byUuid.values().iterator(); + while (iterator.hasNext()) { + HashMap hashMap = (HashMap)iterator.next(); + if (hashMap == null) continue; + n += hashMap.size(); + } + return n; + } + + public void clear() { + this.byUuid.clear(); + } + + public void remove(BUuid bUuid) { + this.byUuid.remove(bUuid); + } + } + + class AlarmEntry { + public AlarmList list; + public BAlarmRecord rec; + + public AlarmEntry(AlarmList alarmList, BAlarmRecord bAlarmRecord) { + this.list = alarmList; + this.rec = bAlarmRecord; + } + } + + class AlarmList { + private BOrdList src; + private ArrayList entries; + private TableModel tableModel; + private AlarmEntry mostRecentEntry; + private int ackedCount = 0; + private int unackedCount = 0; + private int ackPendingCount = 0; + + public AlarmList(BOrdList bOrdList) { + this.src = bOrdList; + this.entries = new ArrayList(1); + } + + public void setModel(TableModel tableModel) { + this.tableModel = tableModel; + } + + public TableModel getModel() { + return this.tableModel; + } + + public void fireModified() { + if (this.tableModel != null) { + this.tableModel.updateTable(); + } + } + + public BOrdList getSource() { + return this.src; + } + + public int size() { + return this.entries.size(); + } + + public AlarmEntry getEntry(int n) { + return (AlarmEntry)this.entries.get(n); + } + + public AlarmEntry getEntry(BUuid bUuid) { + for (int i = 0; i < this.entries.size(); ++i) { + AlarmEntry alarmEntry = (AlarmEntry)this.entries.get(i); + if (!alarmEntry.rec.getUuid().equals((Object)bUuid)) continue; + return alarmEntry; + } + return null; + } + + public int getAckedCount() { + return this.ackedCount; + } + + public int getUnackedCount() { + return this.unackedCount; + } + + public int getAckPendingCount() { + return this.ackPendingCount; + } + + public BAlarmRecord getMostRecentRecord() { + return this.mostRecentEntry.rec; + } + + public BAlarmRecord getRecord(int n) { + return this.getEntry((int)n).rec; + } + + public AlarmEntry add(BAlarmRecord bAlarmRecord) { + BAbsTime bAbsTime = bAlarmRecord.getTimestamp(); + AlarmEntry alarmEntry = new AlarmEntry(this, bAlarmRecord); + this.entries.add(alarmEntry); + if (alarmEntry.rec.isAcknowledged()) { + ++this.ackedCount; + } else if (alarmEntry.rec.getAckState() == BAckState.ackPending) { + ++this.ackPendingCount; + } else { + ++this.unackedCount; + } + if (this.mostRecentEntry == null || bAbsTime.isAfter(this.mostRecentEntry.rec.getTimestamp())) { + this.mostRecentEntry = alarmEntry; + } + this.fireModified(); + return alarmEntry; + } + + public void remove(AlarmEntry alarmEntry) { + this.entries.remove(alarmEntry); + if (alarmEntry.rec.isAcknowledged()) { + --this.ackedCount; + } else if (alarmEntry.rec.getAckState() == BAckState.ackPending) { + --this.ackPendingCount; + } else { + --this.unackedCount; + } + if (alarmEntry.rec.getUuid().equals((Object)this.mostRecentEntry.rec.getUuid())) { + int n = this.entries.size(); + this.mostRecentEntry = null; + for (int i = 0; i < n; ++i) { + if (this.mostRecentEntry == null) { + this.mostRecentEntry = (AlarmEntry)this.entries.get(i); + } + AlarmEntry alarmEntry2 = (AlarmEntry)this.entries.get(i); + if (!alarmEntry2.rec.getTimestamp().isAfter(this.mostRecentEntry.rec.getTimestamp())) continue; + this.mostRecentEntry = alarmEntry2; + } + } + this.fireModified(); + } + + public void removeAll() { + this.entries.clear(); + this.mostRecentEntry = null; + this.ackedCount = 0; + this.unackedCount = 0; + this.ackPendingCount = 0; + this.fireModified(); + } + + public void sort(ConsoleColumns.Column column, Comparator comparator) { + int n = this.entries.size(); + for (int i = n / 2; i >= 1; i /= 2) { + for (int j = i; j < n; ++j) { + int n2; + AlarmEntry alarmEntry = (AlarmEntry)this.entries.get(j); + Object object = column.getValue(alarmEntry.rec); + for (n2 = j; n2 >= i && comparator.compare(object, column.getValue(((AlarmEntry)this.entries.get((int)(n2 - i))).rec)) <= 0; n2 -= i) { + if (comparator.compare(object, column.getValue(((AlarmEntry)this.entries.get((int)(n2 - i))).rec)) == 0) { + BAbsTime bAbsTime = alarmEntry.rec.getTimestamp(); + BAbsTime bAbsTime2 = ((AlarmEntry)this.entries.get((int)(n2 - i))).rec.getTimestamp(); + if (!bAbsTime2.isBefore(bAbsTime)) break; + this.entries.set(n2, this.entries.get(n2 - i)); + continue; + } + this.entries.set(n2, this.entries.get(n2 - i)); + } + this.entries.set(n2, alarmEntry); + } + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/TrayIconListener.java b/modules/cfr_output/com/tridium/alarm/ui/TrayIconListener.java new file mode 100644 index 0000000..1cf1ccb --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/TrayIconListener.java @@ -0,0 +1,13 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.alarm.ui; + +import com.tridium.alarm.ui.BTrayIcon; + +public interface TrayIconListener { + public void onTrayIconClicked(BTrayIcon var1); + + public void onTrayIconDoubleClicked(BTrayIcon var1); +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/portal/AddConsoleWizard.java b/modules/cfr_output/com/tridium/alarm/ui/portal/AddConsoleWizard.java new file mode 100644 index 0000000..d3b13a5 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/portal/AddConsoleWizard.java @@ -0,0 +1,391 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.fox.sys.BFoxClientConnection$Interest + * com.tridium.fox.sys.BFoxSession + * com.tridium.fox.sys.broker.BFoxStationSpace + * com.tridium.workbench.auth.AuthUtil + * com.tridium.workbench.auth.CredentialsList + * com.tridium.workbench.util.CollectionTableModel + * javax.baja.collection.BICollection + * javax.baja.gx.BImage + * javax.baja.gx.Size + * javax.baja.log.Log + * javax.baja.naming.BHost + * javax.baja.naming.BOrd + * javax.baja.naming.SlotPath + * javax.baja.security.BICredentials + * javax.baja.security.BUsernameAndPassword + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BTextField + * javax.baja.ui.BWidget + * javax.baja.ui.event.BKeyEvent + * javax.baja.ui.event.BMouseEvent + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.table.BTable + * javax.baja.ui.table.TableController + * javax.baja.ui.table.TableModel + * javax.baja.ui.table.TableSelection + * javax.baja.ui.util.UiLexicon + * javax.baja.ui.wizard.WizardModel + */ +package com.tridium.alarm.ui.portal; + +import com.tridium.alarm.ui.portal.BConsoleRecord; +import com.tridium.alarm.ui.portal.BConsoleRecordList; +import com.tridium.alarm.ui.portal.BHostSelectPane; +import com.tridium.fox.sys.BFoxClientConnection; +import com.tridium.fox.sys.BFoxSession; +import com.tridium.fox.sys.broker.BFoxStationSpace; +import com.tridium.workbench.auth.AuthUtil; +import com.tridium.workbench.auth.CredentialsList; +import com.tridium.workbench.util.CollectionTableModel; +import javax.baja.collection.BICollection; +import javax.baja.gx.BImage; +import javax.baja.gx.Size; +import javax.baja.log.Log; +import javax.baja.naming.BHost; +import javax.baja.naming.BOrd; +import javax.baja.naming.SlotPath; +import javax.baja.security.BICredentials; +import javax.baja.security.BUsernameAndPassword; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BTextField; +import javax.baja.ui.BWidget; +import javax.baja.ui.event.BKeyEvent; +import javax.baja.ui.event.BMouseEvent; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.table.BTable; +import javax.baja.ui.table.TableController; +import javax.baja.ui.table.TableModel; +import javax.baja.ui.table.TableSelection; +import javax.baja.ui.util.UiLexicon; +import javax.baja.ui.wizard.WizardModel; + +public class AddConsoleWizard +extends WizardModel +implements BFoxClientConnection.Interest { + static UiLexicon lex = new UiLexicon(class$com$tridium$alarm$ui$portal$AddConsoleWizard == null ? (class$com$tridium$alarm$ui$portal$AddConsoleWizard = AddConsoleWizard.class$("com.tridium.alarm.ui.portal.AddConsoleWizard")) : class$com$tridium$alarm$ui$portal$AddConsoleWizard); + static UiLexicon uiLex = UiLexicon.bajaui; + static BImage banner = BImage.make((String)"module://bajaui/com/tridium/ui/images/wizard/wizardShortcut.png"); + int currentStep = 0; + BWidget step0; + BWidget step1; + boolean edit = false; + boolean online = true; + BHostSelectPane openPane; + BTable acTable; + BOrd consoleOrd; + CollectionTableModel acTableModel; + BTextField offlineOrdField; + BICredentials credentials; + BConsoleRecordList list; + BOrd ord; + String station; + BOrd hostOrd; + int port; + boolean useFoxs; + static /* synthetic */ Class class$com$tridium$alarm$ui$portal$AddConsoleWizard; + + public AddConsoleWizard(BConsoleRecordList bConsoleRecordList) { + this.list = bConsoleRecordList; + this.buildStep0(); + } + + public AddConsoleWizard(BConsoleRecordList bConsoleRecordList, BOrd bOrd, int n, boolean bl, BOrd bOrd2) { + this.list = bConsoleRecordList; + this.hostOrd = bOrd; + this.port = n; + this.consoleOrd = bOrd2; + this.useFoxs = false; + this.edit = true; + this.openPane = new BHostSelectPane(bOrd, n, bl); + this.step0 = this.openPane; + } + + private void buildStep0() { + this.openPane = new BHostSelectPane(); + this.step0 = this.openPane; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + private void buildStep1() throws Exception { + boolean bl; + BUsernameAndPassword bUsernameAndPassword; + BFoxSession bFoxSession = null; + this.port = 1911; + this.useFoxs = false; + try { + this.credentials = this.openPane.getCredentials(); + bUsernameAndPassword = (BUsernameAndPassword)this.credentials; + this.port = this.openPane.getPort(); + this.useFoxs = this.openPane.getUseFoxs(); + this.hostOrd = this.openPane.getHostOrd(); + bl = this.openPane.getRememberCredentials(); + if (bl) { + AuthUtil.saveCredentials((String)this.openPane.getRealm(), (BICredentials)this.credentials); + } else { + CredentialsList.INSTANCE.remove(this.openPane.getRealm()); + } + } + catch (Exception exception) { + if (exception.getCause() != null) { + exception.getCause().printStackTrace(); + } + BDialog.error((BWidget)this.getWizard(), (String)UiLexicon.bajaui.getText("dialog.error"), (Object)exception.getMessage(), (Throwable)exception); + return; + } + this.getWizard().enterBusy(); + try { + BICredentials bICredentials; + String string; + String string2; + BUsernameAndPassword bUsernameAndPassword2; + bUsernameAndPassword = BOrd.make((String)"station:"); + BHost bHost = (BHost)this.hostOrd.get(); + bFoxSession = BFoxSession.make((BHost)bHost, (int)this.port, (boolean)this.useFoxs); + if (!bFoxSession.isConnected()) { + bUsernameAndPassword2 = (BUsernameAndPassword)this.credentials; + bFoxSession.setCredentials(this.credentials); + bFoxSession.connect(); + } else { + bUsernameAndPassword2 = (BUsernameAndPassword)this.credentials; + string2 = bUsernameAndPassword2.getUsername(); + if (!string2.equals(string = bFoxSession.getUsername())) { + Log.getLog((String)"alarm").message(lex.getText("portal.reconnectingAs", new Object[]{string2})); + bFoxSession.disconnect(); + bFoxSession.setCredentials(this.credentials); + bFoxSession.connect(); + } else { + bICredentials = bFoxSession.getCredentials(); + if (bICredentials instanceof BUsernameAndPassword) { + if (!bUsernameAndPassword2.getPassword().getValue().equals(((BUsernameAndPassword)bICredentials).getPassword().getValue())) { + throw new Exception("Invalid username/password"); + } + } else { + throw new Exception("Unsupported credential type for re-validation."); + } + } + } + bUsernameAndPassword2 = bUsernameAndPassword.get((BObject)bFoxSession); + string2 = (BFoxStationSpace)bUsernameAndPassword2; + string = BOrd.make((String)"station:|slot:/|bql:select slotPathOrd from alarm:ConsoleRecipient"); + bICredentials = (BICollection)string.get((BObject)string2.getRootComponent()); + this.acTable = new BTable(); + this.acTable.setController((TableController)new Controller()); + this.acTableModel = new CollectionTableModel((BICollection)bICredentials, null); + this.acTable.setModel((TableModel)this.acTableModel); + this.acTable.setSelection(new TableSelection(){ + + public void select(int n, boolean bl) { + super.select(n, true); + } + + public void select(int n, int n2, boolean bl) { + super.select(n2, true); + } + + public void select(int[] nArray) { + super.select(nArray[0], true); + } + }); + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setCenter((BWidget)this.acTable); + this.step1 = bEdgePane; + this.online = true; + if (this.acTableModel.getRowCount() == 1) { + TableSelection tableSelection = this.acTable.getSelection(); + tableSelection.selectAll(); + this.acTable.setSelection(tableSelection); + this.update(5); + } else if (this.edit) { + TableSelection tableSelection = this.acTable.getSelection(); + for (int i = 0; i < this.acTableModel.getRowCount(); ++i) { + if (!this.acTableModel.getValueAt(i, 0).equals(this.consoleOrd.toString())) continue; + tableSelection.select(i); + } + this.acTable.setSelection(tableSelection); + this.update(5); + } + } + catch (Exception exception) { + this.online = false; + BLabel bLabel = new BLabel(lex.getText("messages.connectionError", new Object[]{this.openPane.getHostOrd()})); + BLabel bLabel2 = new BLabel(exception.toString()); + BLabel bLabel3 = new BLabel(lex.getText("portal.wizard.alarmConsoleOrd")); + this.offlineOrdField = this.edit ? new BTextField(this.consoleOrd.toString(), 40) : new BTextField("slot:/", 40); + BGridPane bGridPane = new BGridPane(1); + bGridPane.add(null, (BValue)bLabel); + bGridPane.add(null, (BValue)bLabel2); + bGridPane.add(null, (BValue)new BLabel("")); + bGridPane.add(null, (BValue)bLabel3); + bGridPane.add(null, (BValue)this.offlineOrdField); + this.step1 = bGridPane; + } + finally { + if (bFoxSession != null && !this.openPane.getRealm().equals(bFoxSession.getAuthenticationRealmName())) { + if (bl) { + AuthUtil.saveCredentials((String)bFoxSession.getAuthenticationRealmName(), (BICredentials)this.credentials); + } else { + CredentialsList.INSTANCE.remove(bFoxSession.getAuthenticationRealmName()); + } + } + this.getWizard().exitBusy(); + } + } + + public String getTitle() { + if (this.edit) { + return lex.getText("portal.wizard.editTitle"); + } + return lex.getText("portal.wizard.addTitle"); + } + + public Size getPreferredSizeOfSteps() { + return new Size(360.0, 180.0); + } + + public void init() { + this.updateTo0(); + } + + public void back() { + switch (this.currentStep) { + case 1: { + this.updateTo0(); + } + } + } + + public void next() { + switch (this.currentStep) { + case 0: { + this.hostOrd = this.openPane.getHostOrd(); + this.updateTo1(); + } + } + } + + public boolean finish() { + try { + if (!this.online) { + this.doit(); + } else if (this.acTable.getSelection() != null) { + this.doit(); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + return true; + } + + private void updateTo0() { + this.update(this.step0, 2); + this.getWizard().setNextAsDefault(); + this.currentStep = 0; + } + + private void updateTo1() { + try { + this.buildStep1(); + } + catch (Exception exception) { + BDialog.error((BWidget)this.getWizard().getOwner(), (String)"", (Object)exception.toString(), (Throwable)exception); + } + int n = 1; + if (this.acTable != null && this.acTable.getSelection().getRowCount() == 1) { + n |= 4; + } + if (this.step1 != null) { + this.update(this.step1, n); + this.currentStep = 1; + } + if (!this.online) { + this.update(5); + } + } + + private void doit() throws Exception { + if (this.online) { + int[] nArray = this.acTableModel.getSelection().getRows(); + for (int i = 0; i < nArray.length; ++i) { + String string = (String)this.acTableModel.getValueAt(nArray[i], 0); + BConsoleRecord bConsoleRecord = new BConsoleRecord(); + bConsoleRecord.setHostOrd(this.hostOrd); + bConsoleRecord.setPort(this.port); + bConsoleRecord.setUseFoxs(this.useFoxs); + bConsoleRecord.setConsoleOrd(BOrd.make((String)string)); + this.list = BConsoleRecordList.add(this.list, bConsoleRecord); + } + } else { + BConsoleRecord bConsoleRecord = new BConsoleRecord(); + bConsoleRecord.setHostOrd(this.hostOrd); + bConsoleRecord.setPort(this.port); + bConsoleRecord.setUseFoxs(this.useFoxs); + bConsoleRecord.setConsoleOrd(BOrd.make((String)this.offlineOrdField.getText())); + this.list = BConsoleRecordList.add(this.list, bConsoleRecord); + } + } + + public BConsoleRecordList getConsoleRecordList() { + return this.list; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + class Model + extends CollectionTableModel { + public Model(BICollection bICollection) { + super(bICollection, null); + } + + public Object getValueAt(int n, int n2) { + String string = super.getValueAt(n, n2).toString(); + return SlotPath.unescape((String)string); + } + } + + class Controller + extends TableController { + Controller() { + } + + public void keyReleased(BKeyEvent bKeyEvent) { + super.keyReleased(bKeyEvent); + this.updateFinish(); + } + + public void mouseReleased(BMouseEvent bMouseEvent) { + super.mouseReleased(bMouseEvent); + this.updateFinish(); + } + + private void updateFinish() { + if (AddConsoleWizard.this.acTable.getSelection().getRowCount() == 1) { + AddConsoleWizard.this.update(5); + } else { + AddConsoleWizard.this.update(1); + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/portal/BAlarmPortal.java b/modules/cfr_output/com/tridium/alarm/ui/portal/BAlarmPortal.java new file mode 100644 index 0000000..a5b1cf6 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/portal/BAlarmPortal.java @@ -0,0 +1,597 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.fox.sys.BFoxSession + * com.tridium.workbench.shell.BNiagaraWbShell + * javax.baja.collection.BICollection + * javax.baja.gx.BBrush + * javax.baja.gx.BColor + * javax.baja.log.Log + * javax.baja.naming.BOrd + * javax.baja.status.BStatus + * javax.baja.sys.BAbsTime + * javax.baja.sys.BBoolean + * javax.baja.sys.BComponentEvent + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Cursor + * javax.baja.sys.Subscriber + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BCheckBox + * javax.baja.ui.BDialog + * javax.baja.ui.BMenu + * javax.baja.ui.BSeparator + * javax.baja.ui.BToolBar + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.ToggleCommand + * javax.baja.ui.enums.BOrientation + * javax.baja.ui.event.BMouseEvent + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.pane.BSplitPane + * javax.baja.ui.table.BTable + * javax.baja.ui.table.DefaultTableModel + * javax.baja.ui.table.TableCellRenderer + * javax.baja.ui.table.TableCellRenderer$Cell + * javax.baja.ui.table.TableController + * javax.baja.ui.table.TableModel + * javax.baja.ui.table.TableSelection + * javax.baja.ui.util.BTitlePane + * javax.baja.ui.util.UiLexicon + * javax.baja.ui.wizard.BWizard + * javax.baja.ui.wizard.WizardModel + * javax.baja.workbench.view.BWbView + */ +package com.tridium.alarm.ui.portal; + +import com.tridium.alarm.BConsoleRecipient; +import com.tridium.alarm.ui.portal.AddConsoleWizard; +import com.tridium.alarm.ui.portal.BAlarmPortalTool; +import com.tridium.alarm.ui.portal.BConsoleRecord; +import com.tridium.alarm.ui.portal.BConsoleRecordList; +import com.tridium.alarm.ui.portal.BPortalAlarmConsole; +import com.tridium.fox.sys.BFoxSession; +import com.tridium.workbench.shell.BNiagaraWbShell; +import java.util.ArrayList; +import java.util.Hashtable; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.collection.BICollection; +import javax.baja.gx.BBrush; +import javax.baja.gx.BColor; +import javax.baja.log.Log; +import javax.baja.naming.BOrd; +import javax.baja.status.BStatus; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BComponentEvent; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Cursor; +import javax.baja.sys.Subscriber; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BCheckBox; +import javax.baja.ui.BDialog; +import javax.baja.ui.BMenu; +import javax.baja.ui.BSeparator; +import javax.baja.ui.BToolBar; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.ToggleCommand; +import javax.baja.ui.enums.BOrientation; +import javax.baja.ui.event.BMouseEvent; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.pane.BSplitPane; +import javax.baja.ui.table.BTable; +import javax.baja.ui.table.DefaultTableModel; +import javax.baja.ui.table.TableCellRenderer; +import javax.baja.ui.table.TableController; +import javax.baja.ui.table.TableModel; +import javax.baja.ui.table.TableSelection; +import javax.baja.ui.util.BTitlePane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.ui.wizard.BWizard; +import javax.baja.ui.wizard.WizardModel; +import javax.baja.workbench.view.BWbView; + +public class BAlarmPortal +extends BWbView { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$portal$BAlarmPortal == null ? (class$com$tridium$alarm$ui$portal$BAlarmPortal = BAlarmPortal.class$("com.tridium.alarm.ui.portal.BAlarmPortal")) : class$com$tridium$alarm$ui$portal$BAlarmPortal)); + private ConsoleRecipientSubscriber subscriber; + BGridPane controlPane; + ToggleCommand trayIconEnabled; + ToggleCommand alarmPopupEnabled; + ToggleCommand alarmPopupAlwaysOnTop; + ToggleCommand alarmPopupUncloseable; + Command addCommand; + BButton startButton; + BButton stopButton; + BCheckBox autoStart; + public static final UiLexicon lexicon = new UiLexicon(class$com$tridium$alarm$ui$portal$BAlarmPortal == null ? (class$com$tridium$alarm$ui$portal$BAlarmPortal = BAlarmPortal.class$("com.tridium.alarm.ui.portal.BAlarmPortal")) : class$com$tridium$alarm$ui$portal$BAlarmPortal); + public static final Log log = Log.getLog((String)"alarm"); + BAlarmPortalTool tool; + BPortalAlarmConsole console; + BTable acMonitor = new BTable(); + static /* synthetic */ Class class$com$tridium$alarm$ui$portal$BAlarmPortal; + + public Type getType() { + return TYPE; + } + + public BAlarmPortal() throws Exception { + this.acMonitor.setController((TableController)new MonitorController()); + this.acMonitor.setModel((TableModel)new MonitorModel()); + this.acMonitor.setCellRenderer((TableCellRenderer)new MonitorCellRenderer()); + this.acMonitor.setSelection(new TableSelection(){ + + public void select(int n, boolean bl) { + super.select(n, true); + } + + public void select(int n, int n2, boolean bl) { + super.select(n2, true); + } + + public void select(int[] nArray) { + super.select(nArray[0], true); + } + }); + BSplitPane bSplitPane = new BSplitPane(BOrientation.vertical, 20.0); + bSplitPane.setWidget1((BWidget)BTitlePane.makePane((String)lexicon.getText("portal.alarmConsoleMonitor"), (BTable)this.acMonitor, (String)"Consoles")); + this.console = new BPortalAlarmConsole(); + bSplitPane.setWidget2((BWidget)this.console); + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setCenter((BWidget)bSplitPane); + this.setContent((BWidget)bEdgePane); + } + + public void doLoadValue(BObject bObject, Context context) throws Exception { + this.tool = (BAlarmPortalTool)bObject; + this.trayIconEnabled = new ToggleCommand((BWidget)this.getWbShell(), BAlarmPortal.lexicon.module, "commands.trayIconEnabled"){ + + public CommandArtifact doInvoke() { + BAlarmPortal.this.tool.options.setTrayIconEnabled(this.isSelected()); + BAlarmPortal.this.tool.updateTrayIcon(BAlarmPortal.this.console.getAckedAlarmCount(), BAlarmPortal.this.console.getUnackedAlarmCount(), BAlarmPortal.this.console.sourcesInAlarm()); + return null; + } + }; + this.trayIconEnabled.setSelected(this.tool.options.getTrayIconEnabled()); + this.alarmPopupEnabled = new ToggleCommand((BWidget)this.getWbShell(), BAlarmPortal.lexicon.module, "commands.alarmPopupEnabled"){ + + public CommandArtifact doInvoke() { + BAlarmPortal.this.tool.options.setAlarmPopupEnabled(this.isSelected()); + BAlarmPortal.this.alarmPopupAlwaysOnTop.setEnabled(this.isSelected()); + BAlarmPortal.this.alarmPopupUncloseable.setEnabled(this.isSelected()); + if (this.isSelected()) { + BAlarmPortal.this.tool.showAlarmDialog(BAlarmPortal.this.console.getAckedAlarmCount(), BAlarmPortal.this.console.getUnackedAlarmCount(), BAlarmPortal.this.console.sourcesInAlarm(), BAlarmPortal.this.console.getMostRecentRecord()); + } else { + BAlarmPortal.this.tool.closeAlarmDialog(); + } + return null; + } + }; + this.alarmPopupEnabled.setSelected(this.tool.options.getAlarmPopupEnabled()); + this.alarmPopupAlwaysOnTop = new ToggleCommand((BWidget)this.getWbShell(), BAlarmPortal.lexicon.module, "commands.alarmPopupAlwaysOnTop"){ + + public CommandArtifact doInvoke() { + BAlarmPortal.this.tool.options.setAlarmPopupAlwaysOnTop(this.isSelected()); + if (BAlarmPortalTool.alarmDialog != null) { + BAlarmPortalTool.alarmDialog.setAlwaysOnTop(this.isSelected()); + } + BAlarmPortal.this.tool.showAlarmDialog(BAlarmPortal.this.console.getAckedAlarmCount(), BAlarmPortal.this.console.getUnackedAlarmCount(), BAlarmPortal.this.console.sourcesInAlarm(), null); + return null; + } + }; + this.alarmPopupAlwaysOnTop.setEnabled(this.alarmPopupEnabled.isSelected()); + this.alarmPopupAlwaysOnTop.setSelected(this.tool.options.getAlarmPopupAlwaysOnTop()); + this.alarmPopupUncloseable = new ToggleCommand((BWidget)this.getWbShell(), BAlarmPortal.lexicon.module, "commands.alarmPopupUncloseable"){ + + public CommandArtifact doInvoke() { + BAlarmPortal.this.tool.options.setAlarmPopupUncloseable(this.isSelected()); + if (BAlarmPortalTool.alarmDialog != null) { + BAlarmPortalTool.alarmDialog.setUncloseable(this.isSelected()); + } + BAlarmPortal.this.tool.showAlarmDialog(BAlarmPortal.this.console.getAckedAlarmCount(), BAlarmPortal.this.console.getUnackedAlarmCount(), BAlarmPortal.this.console.sourcesInAlarm(), null); + return null; + } + }; + this.alarmPopupUncloseable.setEnabled(this.alarmPopupEnabled.isSelected()); + this.alarmPopupUncloseable.setSelected(this.tool.options.getAlarmPopupUncloseable()); + this.addCommand = new Command((BWidget)this.getWbShell(), BAlarmPortal.lexicon.module, "commands.add"){ + + public CommandArtifact doInvoke() { + BAlarmPortal.this.addConsoleRecipient(); + return null; + } + }; + BConsoleRecordList bConsoleRecordList = this.tool.options.getConsoleList(); + for (int i = 0; i < bConsoleRecordList.size(); ++i) { + BConsoleRecord bConsoleRecord = bConsoleRecordList.get(i); + ((MonitorModel)this.acMonitor.getModel()).addConsoleRecord(bConsoleRecord); + } + this.tool.viewActivated(); + new LoadThread().start(); + } + + public void deactivated() { + this.tool.viewDeactivated(); + super.deactivated(); + if (this.subscriber != null) { + this.subscriber.unsubscribeAll(); + } + } + + public BMenu[] getViewMenus() { + BMenu[] bMenuArray = this.console.getViewMenus(); + bMenuArray[0].add("portalSep", (BValue)new BSeparator()); + bMenuArray[0].add("addConsole", this.addCommand); + bMenuArray[0].add("portalSep2", (BValue)new BSeparator()); + bMenuArray[0].add("trayIconEnabled", (Command)this.trayIconEnabled); + bMenuArray[0].add("alarmPopupEnabled", (Command)this.alarmPopupEnabled); + bMenuArray[0].add("alarmPopupAlwaysOnTop", (Command)this.alarmPopupAlwaysOnTop); + bMenuArray[0].add("alarmPopupUncloseable", (Command)this.alarmPopupUncloseable); + return bMenuArray; + } + + public BToolBar getViewToolBar() { + BToolBar bToolBar = new BToolBar(); + bToolBar.add("addConsole", this.addCommand); + return bToolBar; + } + + private void addConsoleRecipient() { + BConsoleRecordList bConsoleRecordList = this.tool.options.getConsoleList(); + int n = bConsoleRecordList.size(); + AddConsoleWizard addConsoleWizard = new AddConsoleWizard(bConsoleRecordList); + BWizard.open((BWidget)this.getWbShell(), (WizardModel)addConsoleWizard); + bConsoleRecordList = addConsoleWizard.getConsoleRecordList(); + int n2 = bConsoleRecordList.size() - n; + if (n2 > 0) { + this.tool.options.setConsoleList(bConsoleRecordList); + this.tool.options.save(); + for (int i = n2; i > 0; --i) { + BConsoleRecord bConsoleRecord = bConsoleRecordList.get(bConsoleRecordList.size() - i); + ((MonitorModel)this.acMonitor.getModel()).addConsoleRecord(bConsoleRecord); + this.connect(bConsoleRecord, bConsoleRecordList.size() - i); + } + this.acMonitor.sizeColumnsToFit(); + this.acMonitor.getModel().updateTable(); + } + } + + void connect(BConsoleRecord bConsoleRecord, int n) { + BAbsTime bAbsTime = (BAbsTime)this.acMonitor.getModel().getValueAt(n, 5); + ConnectThread connectThread = new ConnectThread(bConsoleRecord, n, bAbsTime); + connectThread.start(); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + class MonitorCellRenderer + extends TableCellRenderer { + int i = -1; + + MonitorCellRenderer() { + } + + public BBrush getBackground(TableCellRenderer.Cell cell) { + boolean bl; + BOrd bOrd = (BOrd)this.getTable().getModel().getValueAt(cell.row, 0); + Integer n = (Integer)this.getTable().getModel().getValueAt(cell.row, 1); + BBoolean bBoolean = (BBoolean)this.getTable().getModel().getValueAt(cell.row, 2); + BOrd bOrd2 = (BOrd)this.getTable().getModel().getValueAt(cell.row, 3); + BConsoleRecipient bConsoleRecipient = bBoolean.getBoolean() ? (BConsoleRecipient)((Object)BAlarmPortal.this.tool.recipients.get(bOrd + "|foxs:" + n + "|station:|" + bOrd2)) : (BConsoleRecipient)((Object)BAlarmPortal.this.tool.recipients.get(bOrd + "|fox:" + n + "|station:|" + bOrd2)); + boolean bl2 = bl = bConsoleRecipient != null && bConsoleRecipient.isMounted(); + if (!bl) { + if (BAlarmPortal.this.console != null && BAlarmPortal.this.tool != null) { + BAlarmPortal.this.tool.updateTrayIcon(BAlarmPortal.this.console.getAckedAlarmCount(), BAlarmPortal.this.console.getUnackedAlarmCount(), BAlarmPortal.this.console.sourcesInAlarm()); + BAlarmPortal.this.tool.showAlarmDialog(BAlarmPortal.this.console.getAckedAlarmCount(), BAlarmPortal.this.console.getUnackedAlarmCount(), BAlarmPortal.this.console.sourcesInAlarm(), null); + } + return BBrush.makeSolid((BColor)((BColor)BStatus.downBg)); + } + return null; + } + } + + class MonitorController + extends TableController { + MonitorController() { + } + + public void cellPopup(BMouseEvent bMouseEvent, int n, int n2) { + Command command = new Command((BWidget)BAlarmPortal.this.getWbShell(), BAlarmPortal.lexicon.module, "commands.connect"){ + + public CommandArtifact doInvoke() { + int n = MonitorController.this.getTable().getSelection().getRow(); + BAbsTime bAbsTime = (BAbsTime)MonitorController.this.getTable().getModel().getValueAt(n, 5); + BConsoleRecord bConsoleRecord = ((MonitorModel)MonitorController.this.getTable().getModel()).getConsoleEntry(n); + try { + ((MonitorController)MonitorController.this).BAlarmPortal.this.tool.connectToServer((BWidget)BAlarmPortal.this, bConsoleRecord); + BConsoleRecipient bConsoleRecipient = ((MonitorController)MonitorController.this).BAlarmPortal.this.tool.getRecipientForRecord(bConsoleRecord); + BOrd bOrd = bConsoleRecord.getUseFoxs() ? BOrd.make((BOrd)bConsoleRecord.getHostOrd(), (String)("foxs:" + bConsoleRecord.getPort() + "|station:|" + bConsoleRecord.getConsoleOrd().toString())) : BOrd.make((BOrd)bConsoleRecord.getHostOrd(), (String)("fox:" + bConsoleRecord.getPort() + "|station:|" + bConsoleRecord.getConsoleOrd().toString())); + String string = ((MonitorController)MonitorController.this).BAlarmPortal.this.console.channel(bConsoleRecipient).getInitialAlarmQuery(((MonitorController)MonitorController.this).BAlarmPortal.this.console, bConsoleRecipient, bOrd).toString(); + BOrd bOrd2 = BOrd.make((String)(string + " and timestamp >= AbsTime '" + bAbsTime.encodeToString() + "'")); + BICollection bICollection = (BICollection)bOrd2.get((BObject)bConsoleRecipient); + ((MonitorModel)MonitorController.this.getTable().getModel()).set(n, 5, BAbsTime.now()); + Cursor cursor = bICollection.cursor(); + BPortalAlarmConsole.SourceModCursor sourceModCursor = new BPortalAlarmConsole.SourceModCursor(bOrd, cursor); + while (sourceModCursor.next()) { + BAlarmRecord bAlarmRecord = (BAlarmRecord)sourceModCursor.get(); + ((MonitorController)MonitorController.this).BAlarmPortal.this.console.processAlarm(bAlarmRecord); + } + } + catch (Exception exception) { + BDialog.error((BWidget)BAlarmPortal.this, (String)lexicon.getText("alarm.connectFailed"), (Object)lexicon.getText("messages.connectionError", new Object[]{bConsoleRecord.getHostOrd()}), (Throwable)exception); + } + return null; + } + }; + Command command2 = new Command((BWidget)BAlarmPortal.this.getWbShell(), BAlarmPortal.lexicon.module, "commands.disconnect"){ + + public CommandArtifact doInvoke() { + try { + int n = MonitorController.this.getTable().getSelection().getRow(); + BConsoleRecord bConsoleRecord = ((MonitorModel)MonitorController.this.getTable().getModel()).getConsoleEntry(n); + BConsoleRecipient bConsoleRecipient = bConsoleRecord.getUseFoxs() ? (BConsoleRecipient)((Object)((MonitorController)MonitorController.this).BAlarmPortal.this.tool.recipients.get(bConsoleRecord.getHostOrd() + "|foxs:" + bConsoleRecord.getPort() + "|station:|" + bConsoleRecord.getConsoleOrd())) : (BConsoleRecipient)((Object)((MonitorController)MonitorController.this).BAlarmPortal.this.tool.recipients.get(bConsoleRecord.getHostOrd() + "|fox:" + bConsoleRecord.getPort() + "|station:|" + bConsoleRecord.getConsoleOrd())); + if (bConsoleRecipient != null && bConsoleRecipient.getSession() != null) { + ((BFoxSession)bConsoleRecipient.getSession()).disconnect(); + } + ((MonitorModel)MonitorController.this.getTable().getModel()).set(n, 5, BAbsTime.now()); + } + catch (Exception exception) { + log.error("Cannot disconnect: " + exception); + } + return null; + } + }; + Command command3 = new Command((BWidget)BAlarmPortal.this.getWbShell(), BAlarmPortal.lexicon.module, "commands.edit"){ + + public CommandArtifact doInvoke() { + MonitorController.this.editConsoleRecipient(); + return null; + } + }; + Command command4 = new Command((BWidget)BAlarmPortal.this.getWbShell(), BAlarmPortal.lexicon.module, "commands.remove"){ + + public CommandArtifact doInvoke() { + MonitorController.this.deleteConsoleRecipient(); + return null; + } + }; + Command command5 = null; + command5 = this.getTable().getModel().getValueAt(n, 4).toString().equals(lexicon.getText("portal.connected")) ? command2 : command; + BMenu bMenu = new BMenu(); + bMenu.add("connect", command5); + bMenu.add("sep", (BValue)new BSeparator()); + bMenu.add("edit", command3); + bMenu.add("remove", command4); + bMenu.open((BWidget)this.getTable(), bMouseEvent.getX(), bMouseEvent.getY()); + } + + protected void backgroundPopup(BMouseEvent bMouseEvent) { + BMenu bMenu = new BMenu(); + bMenu.add("add", BAlarmPortal.this.addCommand); + bMenu.open((BWidget)this.getTable(), bMouseEvent.getX(), bMouseEvent.getY()); + } + + private void editConsoleRecipient() { + int n = this.getTable().getSelection().getRow(); + BOrd bOrd = (BOrd)this.getTable().getModel().getValueAt(n, 0); + int n2 = (Integer)this.getTable().getModel().getValueAt(n, 1); + boolean bl = ((BBoolean)this.getTable().getModel().getValueAt(n, 2)).getBoolean(); + BOrd bOrd2 = (BOrd)this.getTable().getModel().getValueAt(n, 3); + int n3 = BAlarmPortal.this.acMonitor.getModel().getRowCount(); + BConsoleRecordList bConsoleRecordList = BAlarmPortal.this.tool.options.getConsoleList(); + int n4 = bConsoleRecordList.size(); + AddConsoleWizard addConsoleWizard = new AddConsoleWizard(bConsoleRecordList, bOrd, n2, bl, bOrd2); + BWizard.open((BWidget)BAlarmPortal.this.getWbShell(), (WizardModel)addConsoleWizard); + bConsoleRecordList = addConsoleWizard.getConsoleRecordList(); + int n5 = bConsoleRecordList.size() - n4; + if (n5 > 0) { + BAlarmPortal.this.tool.options.setConsoleList(bConsoleRecordList); + BAlarmPortal.this.tool.options.save(); + for (int i = n5; i > 0; --i) { + BConsoleRecord bConsoleRecord = bConsoleRecordList.get(bConsoleRecordList.size() - i); + ((MonitorModel)BAlarmPortal.this.acMonitor.getModel()).addConsoleRecord(bConsoleRecord); + } + BAlarmPortal.this.acMonitor.sizeColumnsToFit(); + BAlarmPortal.this.acMonitor.getModel().updateTable(); + } + if (BAlarmPortal.this.acMonitor.getModel().getRowCount() > n3) { + this.deleteConsoleRecipient(); + } + } + + private void deleteConsoleRecipient() { + int[] nArray = this.getTable().getSelection().getRows(); + nArray = this.sort(nArray); + BConsoleRecord[] bConsoleRecordArray = new BConsoleRecord[nArray.length]; + for (int i = nArray.length - 1; i >= 0; --i) { + bConsoleRecordArray[i] = ((MonitorModel)this.getTable().getModel()).getConsoleEntry(nArray[i]); + BConsoleRecipient bConsoleRecipient = bConsoleRecordArray[i].getUseFoxs() ? (BConsoleRecipient)((Object)BAlarmPortal.this.tool.recipients.get(bConsoleRecordArray[i].getHostOrd() + "|foxs:" + bConsoleRecordArray[i].getPort() + "|station:|" + bConsoleRecordArray[i].getConsoleOrd())) : (BConsoleRecipient)((Object)BAlarmPortal.this.tool.recipients.get(bConsoleRecordArray[i].getHostOrd() + "|fox:" + bConsoleRecordArray[i].getPort() + "|station:|" + bConsoleRecordArray[i].getConsoleOrd())); + if (bConsoleRecipient != null && bConsoleRecipient.getSession() != null) { + ((BFoxSession)bConsoleRecipient.getSession()).disconnect(); + } + BAlarmPortal.this.console.removeAlarmsFrom(bConsoleRecordArray[i]); + } + BConsoleRecordList bConsoleRecordList = BAlarmPortal.this.tool.options.getConsoleList(); + for (int i = nArray.length - 1; i >= 0; --i) { + bConsoleRecordList = BConsoleRecordList.remove(bConsoleRecordList, nArray[i]); + ((MonitorModel)this.getTable().getModel()).removeConsoleRecordAt(nArray[i]); + } + BAlarmPortal.this.tool.options.setConsoleList(bConsoleRecordList); + BAlarmPortal.this.tool.options.save(); + ((MonitorModel)this.getTable().getModel()).updateTable(); + this.getTable().sizeColumnsToFit(); + BAlarmPortal.this.tool.showAlarmDialog(BAlarmPortal.this.console.getAckedAlarmCount(), BAlarmPortal.this.console.getUnackedAlarmCount(), BAlarmPortal.this.console.sourcesInAlarm(), null); + } + + private int[] sort(int[] nArray) { + for (int i = nArray.length - 1; i >= 0; --i) { + for (int j = 1; j <= i; ++j) { + if (nArray[j - 1] <= nArray[j]) continue; + int n = nArray[j - 1]; + nArray[j - 1] = nArray[j]; + nArray[j] = n; + } + } + return nArray; + } + } + + class MonitorModel + extends DefaultTableModel { + ArrayList entries; + Hashtable wasConnectedList = new Hashtable(); + + public MonitorModel() { + super(new String[]{lexicon.getText("portal.station"), lexicon.getText("portal.port"), lexicon.getText("auth.foxs"), lexicon.getText("portal.consoleOrd"), lexicon.getText("portal.status"), lexicon.getText("portal.lastConnectTime"), lexicon.getText("portal.lastDisconnectTime")}); + this.entries = new ArrayList(); + } + + public void addConsoleRecord(BConsoleRecord bConsoleRecord) { + this.entries.add(bConsoleRecord); + Object[] objectArray = new Object[]{bConsoleRecord.getHostOrd(), new Integer(bConsoleRecord.getPort()), BBoolean.make((boolean)bConsoleRecord.getUseFoxs()), bConsoleRecord.getConsoleOrd(), lexicon.getText("portal.notConnected"), BAbsTime.NULL, BAbsTime.NULL}; + this.addRow(null, objectArray); + } + + public void removeConsoleRecordAt(int n) { + this.removeRow(n); + BConsoleRecord bConsoleRecord = (BConsoleRecord)((Object)this.entries.remove(n)); + if (bConsoleRecord != null) { + String string = bConsoleRecord.getUseFoxs() ? "|foxs:" : "|fox:"; + BConsoleRecipient bConsoleRecipient = (BConsoleRecipient)((Object)BAlarmPortal.this.tool.recipients.get(bConsoleRecord.getHostOrd() + string + bConsoleRecord.getPort() + "|station:|" + bConsoleRecord.getConsoleOrd())); + if (bConsoleRecipient != null && BAlarmPortal.this.subscriber != null) { + BAlarmPortal.this.subscriber.unsubscribe(bConsoleRecipient); + } + } + } + + public BConsoleRecord getConsoleEntry(int n) { + return (BConsoleRecord)((Object)this.entries.get(n)); + } + + public Object getValueAt(int n, int n2) { + if (n2 == 4) { + boolean bl; + BOrd bOrd = (BOrd)this.getTable().getModel().getValueAt(n, 0); + Integer n3 = (Integer)this.getTable().getModel().getValueAt(n, 1); + BBoolean bBoolean = (BBoolean)this.getTable().getModel().getValueAt(n, 2); + BOrd bOrd2 = (BOrd)this.getTable().getModel().getValueAt(n, 3); + String string = bBoolean.getBoolean() ? "|foxs:" : "|fox:"; + BConsoleRecipient bConsoleRecipient = (BConsoleRecipient)((Object)BAlarmPortal.this.tool.recipients.get(bOrd + string + n3 + "|station:|" + bOrd2)); + Boolean bl2 = new Boolean(false); + if (bConsoleRecipient == null) { + return lexicon.getText("portal.notConnected"); + } + bl2 = (Boolean)this.wasConnectedList.get((Object)bConsoleRecipient); + boolean bl3 = bl2 != null ? bl2 : false; + boolean bl4 = bl = bConsoleRecipient != null && bConsoleRecipient.isMounted(); + if (bl3 && !bl) { + this.set(n, 6, BAbsTime.now()); + } else if (!bl3 && bl) { + BConsoleRecord bConsoleRecord = ((MonitorModel)this.getTable().getModel()).getConsoleEntry(n); + BAlarmPortal.this.connect(bConsoleRecord, n); + this.set(n, 5, BAbsTime.now()); + } + this.wasConnectedList.put(bConsoleRecipient, new Boolean(bl)); + return bl ? lexicon.getText("portal.connected") : lexicon.getText("portal.notConnected"); + } + return super.getValueAt(n, n2); + } + } + + private class ConsoleRecipientSubscriber + extends Subscriber { + private ConsoleRecipientSubscriber() { + } + + public void event(BComponentEvent bComponentEvent) { + } + } + + class ConnectThread + extends Thread { + BConsoleRecord rec; + int currentRow; + BAbsTime sinceTime; + + ConnectThread(BConsoleRecord bConsoleRecord, int n, BAbsTime bAbsTime) { + super("alarm: Portal Reconnect"); + this.rec = bConsoleRecord; + this.currentRow = n; + this.sinceTime = bAbsTime; + } + + public void run() { + try { + BAlarmPortal.this.tool.connectToServer((BWidget)BAlarmPortal.this, this.rec); + BConsoleRecipient bConsoleRecipient = BAlarmPortal.this.tool.getRecipientForRecord(this.rec); + if (BAlarmPortal.this.subscriber == null) { + BAlarmPortal.this.subscriber = new ConsoleRecipientSubscriber(); + } + BAlarmPortal.this.subscriber.subscribe(bConsoleRecipient); + String string = this.rec.getUseFoxs() ? "|foxs:" : "|fox:"; + BOrd bOrd = BOrd.make((String)(this.rec.getHostOrd() + string + this.rec.getPort() + "|station:|" + this.rec.getConsoleOrd())); + String string2 = BAlarmPortal.this.console.channel(bConsoleRecipient).getInitialAlarmQuery(BAlarmPortal.this.console, bConsoleRecipient, bOrd).toString(); + boolean bl = this.sinceTime.isNull(); + BOrd bOrd2 = bl ? BOrd.make((String)string2) : BOrd.make((String)(string2 + " and timestamp >= AbsTime '" + this.sinceTime.encodeToString() + "'")); + BICollection bICollection = (BICollection)bOrd2.get((BObject)bConsoleRecipient); + ((MonitorModel)BAlarmPortal.this.acMonitor.getModel()).set(this.currentRow, 5, BAbsTime.now()); + Cursor cursor = bICollection.cursor(); + BPortalAlarmConsole.SourceModCursor sourceModCursor = new BPortalAlarmConsole.SourceModCursor(bOrd, cursor); + int n = 0; + while (sourceModCursor.next()) { + BAlarmRecord bAlarmRecord = (BAlarmRecord)sourceModCursor.get(); + BAlarmPortal.this.console.doProcessAlarm(bAlarmRecord); + ++n; + } + this.rec.setInitialLoadComplete(true); + BAlarmPortal.this.console.init(); + } + catch (Exception exception) { + String string = this.rec.getUseFoxs() ? "|foxs:" : "|fox:"; + log.error("Cannot connect to: " + this.rec.getHostOrd() + string + this.rec.getPort() + "|station:|" + this.rec.getConsoleOrd() + " : ", (Throwable)exception); + } + } + } + + class LoadThread + extends Thread { + LoadThread() { + } + + public void run() { + BAlarmPortal.this.console.loadValue((BObject)BAlarmPortal.this.tool); + BAlarmPortal.this.tool.connect((BWidget)BAlarmPortal.this); + try { + BNiagaraWbShell bNiagaraWbShell = (BNiagaraWbShell)BAlarmPortal.this.getWbShell(); + bNiagaraWbShell.pane.update(bNiagaraWbShell.tab()); + } + catch (Exception exception) { + // empty catch block + } + int n = BAlarmPortal.this.console.getAckedAlarmCount(); + int n2 = BAlarmPortal.this.console.getUnackedAlarmCount(); + BAlarmPortal.this.tool.showAlarmDialog(n, n2, BAlarmPortal.this.console.sourcesInAlarm(), null); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/portal/BAlarmPortalOptions.java b/modules/cfr_output/com/tridium/alarm/ui/portal/BAlarmPortalOptions.java new file mode 100644 index 0000000..eed5087 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/portal/BAlarmPortalOptions.java @@ -0,0 +1,133 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.bql.util.BDynamicTimeRange + * javax.baja.gx.BPoint + * javax.baja.sys.BRelTime + * javax.baja.sys.BValue + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.options.BUserOptions + */ +package com.tridium.alarm.ui.portal; + +import com.tridium.alarm.ui.portal.BConsoleRecordList; +import com.tridium.bql.util.BDynamicTimeRange; +import javax.baja.gx.BPoint; +import javax.baja.sys.BRelTime; +import javax.baja.sys.BValue; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.options.BUserOptions; + +public class BAlarmPortalOptions +extends BUserOptions { + public static final Property consoleList = BAlarmPortalOptions.newProperty((int)4, (BValue)BConsoleRecordList.DEFAULT, null); + public static final Property trayIconEnabled = BAlarmPortalOptions.newProperty((int)0, (boolean)true, null); + public static final Property alarmPopupEnabled = BAlarmPortalOptions.newProperty((int)0, (boolean)true, null); + public static final Property alarmPopupAlwaysOnTop = BAlarmPortalOptions.newProperty((int)0, (boolean)true, null); + public static final Property alarmPopupUncloseable = BAlarmPortalOptions.newProperty((int)0, (boolean)true, null); + public static final Property popupPosition = BAlarmPortalOptions.newProperty((int)4, (BValue)BPoint.make((double)0.0, (double)0.0), null); + public static final Property kioskMode = BAlarmPortalOptions.newProperty((int)0, (boolean)false, null); + public static final Property reconnectInterval = BAlarmPortalOptions.newProperty((int)0, (BValue)BRelTime.make((long)120000L), null); + public static final Property defaultTimeRange = BAlarmPortalOptions.newProperty((int)0, (BValue)BDynamicTimeRange.TODAY, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$portal$BAlarmPortalOptions == null ? (class$com$tridium$alarm$ui$portal$BAlarmPortalOptions = BAlarmPortalOptions.class$("com.tridium.alarm.ui.portal.BAlarmPortalOptions")) : class$com$tridium$alarm$ui$portal$BAlarmPortalOptions)); + private static BAlarmPortalOptions options; + static /* synthetic */ Class class$com$tridium$alarm$ui$portal$BAlarmPortalOptions; + + public BConsoleRecordList getConsoleList() { + return (BConsoleRecordList)this.get(consoleList); + } + + public void setConsoleList(BConsoleRecordList bConsoleRecordList) { + this.set(consoleList, (BValue)bConsoleRecordList, null); + } + + public boolean getTrayIconEnabled() { + return this.getBoolean(trayIconEnabled); + } + + public void setTrayIconEnabled(boolean bl) { + this.setBoolean(trayIconEnabled, bl, null); + } + + public boolean getAlarmPopupEnabled() { + return this.getBoolean(alarmPopupEnabled); + } + + public void setAlarmPopupEnabled(boolean bl) { + this.setBoolean(alarmPopupEnabled, bl, null); + } + + public boolean getAlarmPopupAlwaysOnTop() { + return this.getBoolean(alarmPopupAlwaysOnTop); + } + + public void setAlarmPopupAlwaysOnTop(boolean bl) { + this.setBoolean(alarmPopupAlwaysOnTop, bl, null); + } + + public boolean getAlarmPopupUncloseable() { + return this.getBoolean(alarmPopupUncloseable); + } + + public void setAlarmPopupUncloseable(boolean bl) { + this.setBoolean(alarmPopupUncloseable, bl, null); + } + + public BPoint getPopupPosition() { + return (BPoint)this.get(popupPosition); + } + + public void setPopupPosition(BPoint bPoint) { + this.set(popupPosition, (BValue)bPoint, null); + } + + public boolean getKioskMode() { + return this.getBoolean(kioskMode); + } + + public void setKioskMode(boolean bl) { + this.setBoolean(kioskMode, bl, null); + } + + public BRelTime getReconnectInterval() { + return (BRelTime)this.get(reconnectInterval); + } + + public void setReconnectInterval(BRelTime bRelTime) { + this.set(reconnectInterval, (BValue)bRelTime, null); + } + + public BDynamicTimeRange getDefaultTimeRange() { + return (BDynamicTimeRange)this.get(defaultTimeRange); + } + + public void setDefaultTimeRange(BDynamicTimeRange bDynamicTimeRange) { + this.set(defaultTimeRange, (BValue)bDynamicTimeRange, null); + } + + public Type getType() { + return TYPE; + } + + public static BAlarmPortalOptions getDefault() { + if (options == null) { + options = (BAlarmPortalOptions)BAlarmPortalOptions.load((Type)TYPE); + } + return options; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/portal/BAlarmPortalProfile.java b/modules/cfr_output/com/tridium/alarm/ui/portal/BAlarmPortalProfile.java new file mode 100644 index 0000000..c714476 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/portal/BAlarmPortalProfile.java @@ -0,0 +1,113 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.ui.UiEnv + * javax.baja.naming.BOrd + * javax.baja.registry.TypeInfo + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BMenu + * javax.baja.ui.BMenuBar + * javax.baja.ui.BToolBar + * javax.baja.ui.BWidgetShell + * javax.baja.workbench.BWbLocatorBar + * javax.baja.workbench.BWbProfile + * javax.baja.workbench.BWbShell + */ +package com.tridium.alarm.ui.portal; + +import com.tridium.alarm.ui.portal.BAlarmPortalOptions; +import com.tridium.ui.UiEnv; +import javax.baja.naming.BOrd; +import javax.baja.registry.TypeInfo; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BMenu; +import javax.baja.ui.BMenuBar; +import javax.baja.ui.BToolBar; +import javax.baja.ui.BWidgetShell; +import javax.baja.workbench.BWbLocatorBar; +import javax.baja.workbench.BWbProfile; +import javax.baja.workbench.BWbShell; + +public class BAlarmPortalProfile +extends BWbProfile { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$portal$BAlarmPortalProfile == null ? (class$com$tridium$alarm$ui$portal$BAlarmPortalProfile = BAlarmPortalProfile.class$("com.tridium.alarm.ui.portal.BAlarmPortalProfile")) : class$com$tridium$alarm$ui$portal$BAlarmPortalProfile)); + static /* synthetic */ Class class$com$tridium$alarm$ui$portal$BAlarmPortalProfile; + + public Type getType() { + return TYPE; + } + + public BAlarmPortalProfile(BWbShell bWbShell) { + super(bWbShell); + BAlarmPortalOptions bAlarmPortalOptions = BAlarmPortalOptions.getDefault(); + if (bAlarmPortalOptions.getKioskMode()) { + UiEnv.get().setKiosk((BWidgetShell)bWbShell); + } + } + + public BOrd getStartOrd() { + return BOrd.make((String)"tool:alarm:AlarmPortalTool|slot:/"); + } + + public BOrd getHomeOrd() { + return this.getStartOrd(); + } + + public BMenuBar makeMenuBar() { + BMenuBar bMenuBar = super.makeMenuBar(); + BMenu bMenu = (BMenu)bMenuBar.get("file"); + bMenu.remove("open"); + bMenu.remove("save"); + bMenu.remove("saveBog"); + bMenu.remove("saveAll"); + bMenu.remove("export"); + bMenuBar.remove("search"); + bMenuBar.remove("edit"); + bMenuBar.remove("window"); + bMenuBar.remove("bookmarks"); + BMenu bMenu2 = (BMenu)bMenuBar.get("tools"); + bMenu2.remove("options"); + return bMenuBar; + } + + public BToolBar makeToolBar() { + BToolBar bToolBar = super.makeToolBar(); + bToolBar.remove("save"); + bToolBar.remove("saveBog"); + bToolBar.remove("cut"); + bToolBar.remove("copy"); + bToolBar.remove("duplicate"); + bToolBar.remove("paste"); + bToolBar.remove("delete"); + bToolBar.remove("undo"); + bToolBar.remove("redo"); + bToolBar.remove("export"); + bToolBar.remove("open"); + return bToolBar; + } + + public BWbLocatorBar makeLocatorBar() { + return null; + } + + public boolean hasSideBar() { + return false; + } + + public boolean hasTool(TypeInfo typeInfo) { + return typeInfo.toString().equals("wbutil:ManageCredentialsTool") || typeInfo.toString().equals("platCrypto:CertManagerTool") || typeInfo.toString().equals("platform:LicenseDatabaseTool"); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/portal/BAlarmPortalTool.java b/modules/cfr_output/com/tridium/alarm/ui/portal/BAlarmPortalTool.java new file mode 100644 index 0000000..1aa7036 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/portal/BAlarmPortalTool.java @@ -0,0 +1,761 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.fox.sys.BFoxClientConnection + * com.tridium.fox.sys.BFoxClientConnection$Interest + * com.tridium.fox.sys.BFoxSession + * com.tridium.fox.sys.broker.BFoxStationSpace + * com.tridium.workbench.auth.AuthUtil + * javax.baja.agent.AgentList + * javax.baja.collection.BICollection + * javax.baja.gx.BImage + * javax.baja.gx.BPoint + * javax.baja.log.Log + * javax.baja.naming.BHost + * javax.baja.naming.BOrd + * javax.baja.nav.BNavRoot + * javax.baja.nav.NavEvent + * javax.baja.nav.NavListener + * javax.baja.nre.util.Array + * javax.baja.security.AuthenticationRealm + * javax.baja.security.BICredentials + * javax.baja.security.BUsernameAndPassword + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BIcon + * javax.baja.sys.BLink + * javax.baja.sys.BObject + * javax.baja.sys.BRelTime + * javax.baja.sys.BValue + * javax.baja.sys.Clock + * javax.baja.sys.Clock$Ticket + * javax.baja.sys.Context + * javax.baja.sys.Cursor + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Topic + * javax.baja.sys.Type + * javax.baja.ui.BHyperlinkMode + * javax.baja.ui.BWidget + * javax.baja.ui.BWidgetShell + * javax.baja.ui.HyperlinkInfo + * javax.baja.ui.util.UiLexicon + * javax.baja.workbench.BWbShell + * javax.baja.workbench.tool.BWbService + */ +package com.tridium.alarm.ui.portal; + +import com.tridium.alarm.BAlarmConsoleChannel; +import com.tridium.alarm.BConsoleRecipient; +import com.tridium.alarm.ui.BAlarmConsole; +import com.tridium.alarm.ui.BAlarmConsoleUIChannel; +import com.tridium.alarm.ui.BAlarmDialog; +import com.tridium.alarm.ui.BTrayIcon; +import com.tridium.alarm.ui.TrayIconListener; +import com.tridium.alarm.ui.portal.BAlarmPortalOptions; +import com.tridium.alarm.ui.portal.BConsoleRecord; +import com.tridium.alarm.ui.portal.BConsoleRecordList; +import com.tridium.alarm.ui.portal.BPortalConsoleRecipient; +import com.tridium.fox.sys.BFoxClientConnection; +import com.tridium.fox.sys.BFoxSession; +import com.tridium.fox.sys.broker.BFoxStationSpace; +import com.tridium.workbench.auth.AuthUtil; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Iterator; +import javax.baja.agent.AgentList; +import javax.baja.alarm.BAckState; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.alarm.BSourceState; +import javax.baja.collection.BICollection; +import javax.baja.gx.BImage; +import javax.baja.gx.BPoint; +import javax.baja.log.Log; +import javax.baja.naming.BHost; +import javax.baja.naming.BOrd; +import javax.baja.nav.BNavRoot; +import javax.baja.nav.NavEvent; +import javax.baja.nav.NavListener; +import javax.baja.nre.util.Array; +import javax.baja.security.AuthenticationRealm; +import javax.baja.security.BICredentials; +import javax.baja.security.BUsernameAndPassword; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BIcon; +import javax.baja.sys.BLink; +import javax.baja.sys.BObject; +import javax.baja.sys.BRelTime; +import javax.baja.sys.BValue; +import javax.baja.sys.Clock; +import javax.baja.sys.Context; +import javax.baja.sys.Cursor; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Topic; +import javax.baja.sys.Type; +import javax.baja.ui.BHyperlinkMode; +import javax.baja.ui.BWidget; +import javax.baja.ui.BWidgetShell; +import javax.baja.ui.HyperlinkInfo; +import javax.baja.ui.util.UiLexicon; +import javax.baja.workbench.BWbShell; +import javax.baja.workbench.tool.BWbService; + +public class BAlarmPortalTool +extends BWbService +implements TrayIconListener, +NavListener, +BFoxClientConnection.Interest { + public static final Property alarmPortalConsoleRecipient = BAlarmPortalTool.newProperty((int)4, (BValue)new BConsoleRecipient(), null); + public static final Action connect = BAlarmPortalTool.newAction((int)4, (BValue)new BWidget(), null); + public static final Action routeAlarm = BAlarmPortalTool.newAction((int)4, (BValue)new BAlarmRecord(), null); + public static final Action updateConnectionStatus = BAlarmPortalTool.newAction((int)4, null); + public static final Action scanForReconnect = BAlarmPortalTool.newAction((int)4, null); + public static final Topic newUnackedAlarm = BAlarmPortalTool.newTopic((int)0, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$portal$BAlarmPortalTool == null ? (class$com$tridium$alarm$ui$portal$BAlarmPortalTool = BAlarmPortalTool.class$("com.tridium.alarm.ui.portal.BAlarmPortalTool")) : class$com$tridium$alarm$ui$portal$BAlarmPortalTool)); + Hashtable recipients = new Hashtable(); + Hashtable recipToRecord = new Hashtable(); + Array stations = new Array(class$javax$baja$naming$BOrd == null ? (class$javax$baja$naming$BOrd = BAlarmPortalTool.class$("javax.baja.naming.BOrd")) : class$javax$baja$naming$BOrd); + BWidget view; + Clock.Ticket reconnectTicket; + BTrayIcon trayIcon = new BTrayIcon(); + protected int acked = 0; + protected int unacked = 0; + int activeViewCount = 0; + int unackedTrayIconImg = BTrayIcon.loadImage(System.mapLibraryName("trayIcon"), BTrayIcon.YELLOW_ICON); + int inactiveTrayIconImg = BTrayIcon.loadImage(System.mapLibraryName("trayIcon"), BTrayIcon.GRAY_ICON); + int activeTrayIconImg = BTrayIcon.loadImage(System.mapLibraryName("trayIcon"), BTrayIcon.RED_ICON); + int normalTrayIconImg = BTrayIcon.loadImage(System.mapLibraryName("trayIcon"), BTrayIcon.GREEN_ICON); + int clearedTrayIconImg = BTrayIcon.loadImage(System.mapLibraryName("trayIcon"), BTrayIcon.WHITE_ICON); + protected BAlarmPortalOptions options; + static BAlarmDialog alarmDialog; + private static final Object ALARM_DIALOG_LOCK; + Hashtable alarms = new Hashtable(); + Hashtable sourceStates = new Hashtable(); + boolean sourcesInAlarm = false; + Clock.Ticket updateTicket; + private boolean running = false; + static BImage alarmImg; + public static final UiLexicon lexicon; + private static final BIcon icon; + public static final Log logger; + static /* synthetic */ Class class$com$tridium$alarm$ui$portal$BAlarmPortalTool; + static /* synthetic */ Class class$com$tridium$alarm$BConsoleRecipient; + static /* synthetic */ Class class$javax$baja$naming$BOrd; + + public BConsoleRecipient getAlarmPortalConsoleRecipient() { + return (BConsoleRecipient)this.get(alarmPortalConsoleRecipient); + } + + public void setAlarmPortalConsoleRecipient(BConsoleRecipient bConsoleRecipient) { + this.set(alarmPortalConsoleRecipient, (BValue)bConsoleRecipient, null); + } + + public void connect(BWidget bWidget) { + this.invoke(connect, (BValue)bWidget, null); + } + + public void routeAlarm(BAlarmRecord bAlarmRecord) { + this.invoke(routeAlarm, (BValue)bAlarmRecord, null); + } + + public void updateConnectionStatus() { + this.invoke(updateConnectionStatus, null, null); + } + + public void scanForReconnect() { + this.invoke(scanForReconnect, null, null); + } + + public void fireNewUnackedAlarm(BAlarmRecord bAlarmRecord) { + this.fire(newUnackedAlarm, (BValue)bAlarmRecord, null); + } + + public Type getType() { + return TYPE; + } + + public BAlarmPortalTool() { + this.options = BAlarmPortalOptions.getDefault(); + this.setAlarmPortalConsoleRecipient(new BPortalConsoleRecipient(this)); + BNavRoot.INSTANCE.addNavListener((NavListener)this); + this.start(); + } + + private void doConnect() { + this.doConnect(null); + } + + public void doConnect(BWidget bWidget) { + this.view = bWidget; + this.acked = 0; + this.unacked = 0; + this.sourcesInAlarm = false; + BLink[] bLinkArray = this.getLinks(); + for (int i = 0; i < bLinkArray.length; ++i) { + this.remove(bLinkArray[i].getName()); + } + this.recipients = new Hashtable(); + BConsoleRecordList bConsoleRecordList = this.options.getConsoleList(); + ArrayList arrayList = new ArrayList(); + for (int i = 0; i < bConsoleRecordList.size(); ++i) { + Object object; + BConsoleRecord bConsoleRecord = bConsoleRecordList.get(i); + try { + BConsoleRecipient bConsoleRecipient = this.connectToServer(bWidget, bConsoleRecord); + object = this.getInitialAlarmCounts(bConsoleRecipient); + this.acked += object[0]; + this.unacked += object[1]; + continue; + } + catch (Exception exception) { + object = bConsoleRecord.getUseFoxs() ? "|foxs:" : "|fox:"; + Object[] objectArray = new Object[]{bConsoleRecord.getHostOrd() + (String)object + bConsoleRecord.getPort() + "|station:|" + bConsoleRecord.getConsoleOrd()}; + arrayList.add(lexicon.getText("messages.connectionError", objectArray)); + } + } + if (arrayList.size() > 0) { + StringBuffer stringBuffer = new StringBuffer(); + for (int i = 0; i < arrayList.size(); ++i) { + stringBuffer.append(arrayList.get(i) + "\n"); + } + } + this.updateTrayIcon(this.acked, this.unacked, this.sourcesInAlarm); + this.showAlarmDialog(this.acked, this.unacked, this.sourcesInAlarm, null); + Clock.Ticket ticket = Clock.schedulePeriodically((BComponent)this, (BRelTime)this.options.getReconnectInterval(), (Action)scanForReconnect, null); + } + + public void doRouteAlarm(BAlarmRecord bAlarmRecord) { + this.getAlarmPortalConsoleRecipient().doRouteAlarm(bAlarmRecord); + } + + public void doUpdateConnectionStatus() { + this.updateTicket.cancel(); + this.updateTrayIcon(this.acked, this.unacked, this.sourcesInAlarm); + boolean bl = this.fullyConnected(); + if (alarmDialog != null) { + alarmDialog.setFullyConnected(bl); + } + if (!bl) { + if ((this.running || this.activeViewCount > 0) && this.options.getAlarmPopupEnabled() && alarmDialog == null) { + this.showAlarmDialog(this.acked, this.unacked, this.sourcesInAlarm, null); + } + } else { + if (this.updateTicket != null) { + this.updateTicket.cancel(); + } + this.updateTicket = Clock.schedulePeriodically((BComponent)this, (BRelTime)BRelTime.make((long)30000L), (Action)updateConnectionStatus, null); + } + } + + public BConsoleRecipient connectToServer(BWidget bWidget, BConsoleRecord bConsoleRecord) throws Exception { + String string = bConsoleRecord.getHostOrd().toString(); + BOrd bOrd = bConsoleRecord.getHostOrd(); + BFoxSession bFoxSession = BFoxSession.make((BHost)((BHost)bOrd.get()), (int)bConsoleRecord.getPort(), (boolean)bConsoleRecord.getUseFoxs()); + BOrd bOrd2 = bConsoleRecord.getConsoleOrd(); + BICredentials bICredentials = AuthUtil.getCredentials((AuthenticationRealm)bFoxSession); + if (((BUsernameAndPassword)bICredentials).getUsername().isEmpty()) { + AuthUtil.challenge(null, (AuthenticationRealm)bFoxSession); + } else { + bFoxSession.setCredentials(bICredentials); + } + try { + bFoxSession.connect(); + BOrd bOrd3 = BOrd.make((String)"station:"); + BObject bObject = bOrd3.get((BObject)bFoxSession); + BFoxStationSpace bFoxStationSpace = (BFoxStationSpace)bObject; + BOrd bOrd4 = BOrd.make((String)("station:|" + bOrd2.toString())); + BConsoleRecipient bConsoleRecipient = (BConsoleRecipient)bOrd4.get((BObject)bFoxStationSpace.getRootComponent()); + if (!this.recipients.contains((Object)bConsoleRecipient)) { + if (!this.stations.contains((Object)bConsoleRecord.getHostOrd())) { + this.stations.add((Object)bConsoleRecord.getHostOrd()); + } + String string2 = bConsoleRecord.getUseFoxs() ? "|foxs:" : "|fox:"; + this.recipients.put(bConsoleRecord.getHostOrd() + string2 + bConsoleRecord.getPort() + "|station:|" + bOrd2, bConsoleRecipient); + this.recipToRecord.put(bConsoleRecipient, bConsoleRecord); + } + boolean bl = this.fullyConnected(); + this.updateTrayIcon(this.acked, this.unacked, this.sourcesInAlarm); + this.showAlarmDialog(this.acked, this.unacked, this.sourcesInAlarm, null); + return bConsoleRecipient; + } + catch (Exception exception) { + return null; + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + private BAlarmConsoleUIChannel channel(BConsoleRecipient bConsoleRecipient) { + if (bConsoleRecipient == null) { + return null; + } + try { + BFoxSession bFoxSession = (BFoxSession)bConsoleRecipient.getSession(); + if (bFoxSession != null) { + BFoxClientConnection bFoxClientConnection = bFoxSession.getConnection(); + Object object = BAlarmConsoleChannel.channelMutex; + synchronized (object) { + BAlarmConsoleChannel bAlarmConsoleChannel = (BAlarmConsoleChannel)bFoxClientConnection.getChannels().get("alarmui"); + if (bAlarmConsoleChannel == null || !(bAlarmConsoleChannel instanceof BAlarmConsoleUIChannel)) { + bAlarmConsoleChannel = new BAlarmConsoleUIChannel(); + ((BFoxSession)bConsoleRecipient.getSession()).getConnection().getChannels().remove("alarmui"); + ((BFoxSession)bConsoleRecipient.getSession()).getConnection().getChannels().add("alarmui", (BValue)bAlarmConsoleChannel); + } + return (BAlarmConsoleUIChannel)bAlarmConsoleChannel; + } + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + return null; + } + + protected int[] getInitialAlarmCounts(BConsoleRecipient bConsoleRecipient) { + if (bConsoleRecipient == null) { + return new int[]{0, 0}; + } + try { + String string = this.channel(bConsoleRecipient).getInitialAlarmQuery(this, bConsoleRecipient).toString(); + BOrd bOrd = BOrd.make((String)string); + BICollection bICollection = (BICollection)bOrd.get((BObject)bConsoleRecipient); + Cursor cursor = bICollection.cursor(); + int n = 0; + int n2 = 0; + while (cursor.next()) { + BAlarmRecord bAlarmRecord = (BAlarmRecord)cursor.get(); + if (!this.accept(bAlarmRecord)) continue; + if (this.alarms == null) { + this.alarms = new Hashtable(); + } + this.alarms.put(bAlarmRecord.getUuid(), bAlarmRecord.getAckState()); + if (this.sourceStates == null) { + this.sourceStates = new Hashtable(); + } + this.sourceStates.put(bAlarmRecord.getSource(), bAlarmRecord.getSourceState()); + if (bAlarmRecord.isAcknowledged()) { + ++n; + } else { + ++n2; + } + if (bAlarmRecord.isNormal()) continue; + this.sourcesInAlarm = true; + } + return new int[]{n, n2}; + } + catch (Exception exception) { + exception.printStackTrace(); + return new int[]{0, 0}; + } + } + + protected BConsoleRecord getConsoleRecordForStation(BOrd bOrd) { + BConsoleRecordList bConsoleRecordList = this.options.getConsoleList(); + for (int i = 0; i < bConsoleRecordList.size(); ++i) { + BConsoleRecord bConsoleRecord = bConsoleRecordList.get(i); + String string = bConsoleRecord.getUseFoxs() ? "|foxs:" : "|fox:"; + String string2 = bConsoleRecord.getHostOrd() + string + bConsoleRecord.getPort(); + if (!string2.equals(bOrd.toString())) continue; + return bConsoleRecordList.get(i); + } + return null; + } + + public BConsoleRecipient getRecipientForRecord(BConsoleRecord bConsoleRecord) { + if (bConsoleRecord == null) { + return null; + } + String string = bConsoleRecord.getUseFoxs() ? "|foxs:" : "|fox:"; + return (BConsoleRecipient)((Object)this.recipients.get(bConsoleRecord.getHostOrd() + string + bConsoleRecord.getPort() + "|station:|" + bConsoleRecord.getConsoleOrd())); + } + + protected BConsoleRecord getRecordForRecipient(BConsoleRecipient bConsoleRecipient) { + return (BConsoleRecord)((Object)this.recipToRecord.get((Object)bConsoleRecipient)); + } + + protected BConsoleRecord getConsoleRecordFor(BOrd bOrd) { + String string; + Object object; + String string2; + String string3 = string2 = bOrd.toString(); + if (string2.indexOf("|fox:") < 0 && string2.indexOf("|foxs:") < 0) { + int n = string2.indexOf("|station"); + StringBuffer stringBuffer = new StringBuffer(); + object = new StringBuffer(); + string = string2.substring(0, n); + stringBuffer.append(string); + ((StringBuffer)object).append(string); + stringBuffer.append("|fox:1911"); + ((StringBuffer)object).append("|foxs:4911"); + String string4 = string2.substring(n); + stringBuffer.append(string4); + ((StringBuffer)object).append(string4); + string2 = stringBuffer.toString(); + string3 = ((StringBuffer)object).toString(); + } + BConsoleRecordList bConsoleRecordList = this.options.getConsoleList(); + for (int i = 0; i < bConsoleRecordList.size(); ++i) { + object = bConsoleRecordList.get(i); + string = object.getHostOrd() + "|fox:" + object.getPort() + "|station:|" + object.getConsoleOrd(); + if (string.toString().equals(string2)) { + return object; + } + string = object.getHostOrd() + "|foxs:" + object.getPort() + "|station:|" + object.getConsoleOrd(); + if (!string.toString().equals(string3)) continue; + return object; + } + return null; + } + + protected BConsoleRecipient[] getRecipientsFor(BOrd bOrd) { + Array array = new Array(class$com$tridium$alarm$BConsoleRecipient == null ? (class$com$tridium$alarm$BConsoleRecipient = BAlarmPortalTool.class$("com.tridium.alarm.BConsoleRecipient")) : class$com$tridium$alarm$BConsoleRecipient); + Enumeration enumeration = this.recipients.keys(); + while (enumeration.hasMoreElements()) { + String string = (String)enumeration.nextElement(); + if (!string.equals(bOrd.toString())) continue; + array.add(this.recipients.get(string)); + } + return (BConsoleRecipient[])array.array(); + } + + public final void handleAlarm(BAlarmRecord bAlarmRecord) { + this.getAlarmPortalConsoleRecipient().fireNewUnackedAlarm(bAlarmRecord); + } + + public void processAlarm(BAlarmRecord bAlarmRecord) { + if (this.running && this.accept(bAlarmRecord)) { + BAckState bAckState = (BAckState)((Object)this.alarms.get(bAlarmRecord.getUuid())); + BSourceState bSourceState = (BSourceState)((Object)this.sourceStates.get(bAlarmRecord.getSource())); + if (bAckState == null) { + ++this.unacked; + } else if (bAckState != BAckState.acked && bAlarmRecord.isAcknowledged()) { + ++this.acked; + --this.unacked; + } + if (bSourceState == null) { + this.sourcesInAlarm = true; + } else if (bSourceState != BSourceState.normal && bAlarmRecord.isNormal()) { + this.sourcesInAlarm = false; + } else if (bSourceState == BSourceState.normal && !bAlarmRecord.isNormal()) { + this.sourcesInAlarm = false; + Iterator iterator = this.sourceStates.values().iterator(); + while (iterator.hasNext()) { + if ((BSourceState)((Object)iterator.next()) == BSourceState.normal) continue; + this.sourcesInAlarm = true; + break; + } + } + this.alarms.put(bAlarmRecord.getUuid(), bAlarmRecord.getAckState()); + this.sourceStates.put(bAlarmRecord.getSource(), bAlarmRecord.getSourceState()); + this.showAlarmDialog(this.acked, this.unacked, this.sourcesInAlarm, bAlarmRecord); + this.updateTrayIcon(this.acked, this.unacked, this.sourcesInAlarm); + } + } + + public boolean accept(BAlarmRecord bAlarmRecord) { + Iterator iterator = this.recipients.values().iterator(); + while (iterator.hasNext()) { + BConsoleRecipient bConsoleRecipient = (BConsoleRecipient)((Object)iterator.next()); + if (!bConsoleRecipient.accept(bAlarmRecord)) continue; + return true; + } + return false; + } + + public void navEvent(NavEvent navEvent) { + } + + public boolean fullyConnected() { + if (this.options.getConsoleList().size() <= 0) { + return false; + } + for (int i = 0; i < this.options.getConsoleList().size(); ++i) { + BConsoleRecipient bConsoleRecipient = this.getRecipientForRecord(this.options.getConsoleList().get(i)); + if (bConsoleRecipient != null && bConsoleRecipient.isMounted() && bConsoleRecipient.getSession() != null && ((BFoxSession)bConsoleRecipient.getSession()).isConnected()) continue; + return false; + } + return true; + } + + public boolean partiallyConnected() { + if (this.options.getConsoleList().size() <= 0) { + return false; + } + if (this.fullyConnected()) { + return false; + } + Enumeration enumeration = this.recipients.keys(); + while (enumeration.hasMoreElements()) { + BConsoleRecipient bConsoleRecipient = (BConsoleRecipient)((Object)this.recipients.get(enumeration.nextElement())); + if (!bConsoleRecipient.isMounted()) continue; + return true; + } + return false; + } + + public boolean serviceRunning() { + return BAlarmPortalTool.getManager().isRunning(this.getType().getTypeInfo()); + } + + protected BWbShell getToolWbShell() { + int n; + BWidgetShell[] bWidgetShellArray = BWidget.getApplication().getShells(); + if (bWidgetShellArray.length <= 0) { + return null; + } + for (n = 0; n < bWidgetShellArray.length && !(bWidgetShellArray[n] instanceof BWbShell); ++n) { + } + try { + return (BWbShell)bWidgetShellArray[n]; + } + catch (Exception exception) { + return null; + } + } + + protected void updateTrayIcon(int n, int n2, boolean bl) { + if (this.running || this.activeViewCount > 0) { + if (this.options.getTrayIconEnabled()) { + if (this.trayIcon == null) { + this.trayIcon = new BTrayIcon(); + } + int n3 = this.activeTrayIconImg; + if (!this.fullyConnected()) { + n3 = this.inactiveTrayIconImg; + } else if (n == 0 && n2 == 0) { + n3 = this.clearedTrayIconImg; + } else if (n > 0 && n2 == 0) { + n3 = this.unackedTrayIconImg; + } else if (!bl) { + n3 = this.normalTrayIconImg; + } + this.trayIcon.updateTrayIcon(n3, lexicon.getText("AlarmPortalTool.displayName") + ": " + n + " " + lexicon.getText("trayIcon.acked") + " / " + n2 + " " + lexicon.getText("trayIcon.unackedAlarms")); + if (!this.trayIcon.isShowing()) { + this.trayIcon.show(); + } + if (n3 != this.inactiveTrayIconImg) { + if (this.updateTicket != null) { + this.updateTicket.cancel(); + } + this.updateTicket = Clock.schedulePeriodically((BComponent)this, (BRelTime)BRelTime.make((long)30000L), (Action)updateConnectionStatus, null); + } + } else if (this.trayIcon != null && this.trayIcon.isShowing()) { + this.trayIcon.hide(); + } + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + protected void showAlarmDialog(int n, int n2, boolean bl, BAlarmRecord bAlarmRecord) { + if ((this.running || this.activeViewCount > 0) && this.options.getAlarmPopupEnabled()) { + Object object = ALARM_DIALOG_LOCK; + synchronized (object) { + if (alarmDialog == null) { + alarmDialog = new BAlarmDialog(this, lexicon.getText("AlarmPortalTool.displayName"), alarmImg, bAlarmRecord, n, n2, this.options.getAlarmPopupAlwaysOnTop(), this.options.getAlarmPopupUncloseable()); + alarmDialog.open(); + } else { + alarmDialog.setVisible(true); + } + } + alarmDialog.setFullyConnected(this.fullyConnected()); + alarmDialog.updateAlarmCounts(n, n2, bl); + alarmDialog.updateLastAlarm(bAlarmRecord); + alarmDialog.setFullyConnected(this.fullyConnected()); + if (this.fullyConnected()) { + if (this.updateTicket != null) { + this.updateTicket.cancel(); + } + this.updateTicket = Clock.schedulePeriodically((BComponent)this, (BRelTime)BRelTime.make((long)30000L), (Action)updateConnectionStatus, null); + } + } + } + + protected void updateLastAlarm(BAlarmRecord bAlarmRecord) { + if (alarmDialog != null) { + alarmDialog.updateLastAlarm(bAlarmRecord); + if (!alarmDialog.isVisible()) { + alarmDialog.setVisible(true); + alarmDialog.open(); + } + } + } + + public void closeAlarmDialog() { + if (alarmDialog != null) { + alarmDialog = null; + } + } + + protected void viewActivated() { + ++this.activeViewCount; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + protected void viewDeactivated() { + if (alarmDialog != null) { + this.options.setPopupPosition(BPoint.make((double)alarmDialog.getScreenBounds().x(), (double)alarmDialog.getScreenBounds().y())); + this.options.save(); + } + --this.activeViewCount; + if (this.activeViewCount == 0) { + Object object = ALARM_DIALOG_LOCK; + synchronized (object) { + if (alarmDialog != null) { + alarmDialog.close(); + } + } + if (this.trayIcon != null) { + this.trayIcon.removeTrayIconListener(this); + if (this.trayIcon.isShowing()) { + this.trayIcon.hide(); + } + } + if (!this.serviceRunning()) { + try { + this.serviceStopped(); + } + catch (Exception exception) { + // empty catch block + } + } + } + } + + public void serviceStarted() throws Exception { + this.running = true; + this.alarms = new Hashtable(); + try { + this.doConnect(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + this.updateTrayIcon(this.acked, this.unacked, this.sourcesInAlarm); + this.showAlarmDialog(this.acked, this.unacked, this.sourcesInAlarm, null); + if (this.trayIcon != null) { + this.trayIcon.addTrayIconListener(this); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void serviceStopped() throws Exception { + this.running = false; + this.alarms = null; + this.sourceStates = null; + BConsoleRecordList bConsoleRecordList = this.options.getConsoleList(); + for (int i = 0; i < bConsoleRecordList.size(); ++i) { + try { + BConsoleRecord bConsoleRecord = bConsoleRecordList.get(i); + this.channel(this.getRecipientForRecord(bConsoleRecord)).unregister((BAlarmConsole)null); + continue; + } + catch (Exception exception) { + // empty catch block + } + } + if (this.activeViewCount == 0) { + if (this.trayIcon != null) { + this.trayIcon.removeTrayIconListener(this); + } + if (this.trayIcon.isShowing()) { + this.trayIcon.hide(); + } + this.options.save(); + Object object = ALARM_DIALOG_LOCK; + synchronized (object) { + alarmDialog.close(); + alarmDialog = null; + } + this.trayIcon = null; + } + if (this.reconnectTicket != null) { + this.reconnectTicket.cancel(); + } + } + + public void onTrayIconClicked(BTrayIcon bTrayIcon) { + } + + public void onTrayIconDoubleClicked(BTrayIcon bTrayIcon) { + try { + this.getToolWbShell().hyperlink(this.getNavOrd()); + } + catch (Exception exception) { + // empty catch block + } + } + + public void onAlarmDialogHyperlink(BAlarmDialog bAlarmDialog, BOrd bOrd) { + try { + this.getToolWbShell().hyperlink(new HyperlinkInfo(bOrd, BHyperlinkMode.newTab)); + } + catch (Exception exception) { + // empty catch block + } + } + + public void onAlarmDialogClosed(BAlarmDialog bAlarmDialog) { + this.options.setPopupPosition(BPoint.make((double)bAlarmDialog.getScreenBounds().x(), (double)bAlarmDialog.getScreenBounds().y())); + alarmDialog = null; + } + + public void doScanForReconnect() throws Exception { + if (this.options.getConsoleList().size() <= 0) { + return; + } + if (this.recipients.size() == 0) { + return; + } + Enumeration enumeration = this.recipients.keys(); + while (enumeration.hasMoreElements()) { + try { + BConsoleRecipient bConsoleRecipient = (BConsoleRecipient)((Object)this.recipients.get(enumeration.nextElement())); + if (bConsoleRecipient.isMounted()) continue; + this.connectToServer(this.view, this.getRecordForRecipient(bConsoleRecipient)); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + } + + public AgentList getAgents(Context context) { + AgentList agentList = super.getAgents(context); + agentList.remove("alarm:AlarmConsole"); + agentList.remove("alarm:PortalAlarmConsole"); + return agentList; + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + ALARM_DIALOG_LOCK = new Object(); + alarmImg = BImage.make((String)"module://icons/x16/alarm.png"); + lexicon = new UiLexicon(class$com$tridium$alarm$ui$portal$BAlarmPortalTool == null ? (class$com$tridium$alarm$ui$portal$BAlarmPortalTool = BAlarmPortalTool.class$("com.tridium.alarm.ui.portal.BAlarmPortalTool")) : class$com$tridium$alarm$ui$portal$BAlarmPortalTool); + icon = BIcon.std((String)"alarm.png"); + logger = Log.getLog((String)"alarm"); + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/portal/BConsoleRecord.java b/modules/cfr_output/com/tridium/alarm/ui/portal/BConsoleRecord.java new file mode 100644 index 0000000..f43c316 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/portal/BConsoleRecord.java @@ -0,0 +1,123 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.naming.BOrd + * javax.baja.sys.BObject + * javax.baja.sys.BStruct + * javax.baja.sys.BValue + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.alarm.ui.portal; + +import java.io.IOException; +import java.util.StringTokenizer; +import javax.baja.naming.BOrd; +import javax.baja.sys.BObject; +import javax.baja.sys.BStruct; +import javax.baja.sys.BValue; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public class BConsoleRecord +extends BStruct { + public static final Property hostOrd = BConsoleRecord.newProperty((int)0, (BValue)BOrd.NULL, null); + public static final Property port = BConsoleRecord.newProperty((int)0, (int)1911, null); + public static final Property useFoxs = BConsoleRecord.newProperty((int)0, (boolean)false, null); + public static final Property consoleOrd = BConsoleRecord.newProperty((int)0, (BValue)BOrd.NULL, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$portal$BConsoleRecord == null ? (class$com$tridium$alarm$ui$portal$BConsoleRecord = BConsoleRecord.class$("com.tridium.alarm.ui.portal.BConsoleRecord")) : class$com$tridium$alarm$ui$portal$BConsoleRecord)); + boolean loaded = false; + static /* synthetic */ Class class$com$tridium$alarm$ui$portal$BConsoleRecord; + + public BOrd getHostOrd() { + return (BOrd)this.get(hostOrd); + } + + public void setHostOrd(BOrd bOrd) { + this.set(hostOrd, (BValue)bOrd, null); + } + + public int getPort() { + return this.getInt(port); + } + + public void setPort(int n) { + this.setInt(port, n, null); + } + + public boolean getUseFoxs() { + return this.getBoolean(useFoxs); + } + + public void setUseFoxs(boolean bl) { + this.setBoolean(useFoxs, bl, null); + } + + public BOrd getConsoleOrd() { + return (BOrd)this.get(consoleOrd); + } + + public void setConsoleOrd(BOrd bOrd) { + this.set(consoleOrd, (BValue)bOrd, null); + } + + public Type getType() { + return TYPE; + } + + public BConsoleRecord() { + } + + public BConsoleRecord(BOrd bOrd, int n, boolean bl, BOrd bOrd2) { + this.setHostOrd(bOrd); + this.setPort(n); + this.setUseFoxs(bl); + this.setConsoleOrd(bOrd2); + } + + protected void setInitialLoadComplete(boolean bl) { + this.loaded = bl; + } + + protected boolean isInitialLoadComplete() { + return this.loaded; + } + + public String encodeToString() throws IOException { + return this.getHostOrd().encodeToString() + "\\" + this.getPort() + "\\" + this.getConsoleOrd().encodeToString() + "\\" + this.getUseFoxs(); + } + + public BObject decodeFromString(String string) throws IOException { + StringTokenizer stringTokenizer = new StringTokenizer(string, "\\"); + BOrd bOrd = (BOrd)BOrd.NULL.decodeFromString(stringTokenizer.nextToken()); + int n = 1911; + try { + n = Integer.parseInt(stringTokenizer.nextToken()); + } + catch (Exception exception) { + // empty catch block + } + BOrd bOrd2 = BOrd.make((String)stringTokenizer.nextToken()); + boolean bl = false; + try { + bl = Boolean.parseBoolean(stringTokenizer.nextToken()); + } + catch (Exception exception) { + // empty catch block + } + return new BConsoleRecord(bOrd, n, bl, bOrd2); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/portal/BConsoleRecordList.java b/modules/cfr_output/com/tridium/alarm/ui/portal/BConsoleRecordList.java new file mode 100644 index 0000000..f74623e --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/portal/BConsoleRecordList.java @@ -0,0 +1,157 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BObject + * javax.baja.sys.BSimple + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.alarm.ui.portal; + +import com.tridium.alarm.ui.portal.BConsoleRecord; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.ArrayList; +import java.util.StringTokenizer; +import javax.baja.sys.BObject; +import javax.baja.sys.BSimple; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public final class BConsoleRecordList +extends BSimple { + public static final BConsoleRecordList NULL; + public static final BConsoleRecordList DEFAULT; + public static final Type TYPE; + private int hashCode = -1; + private BConsoleRecord[] ords; + private String string; + static /* synthetic */ Class class$com$tridium$alarm$ui$portal$BConsoleRecordList; + + public static BConsoleRecordList make(BConsoleRecord bConsoleRecord) { + return new BConsoleRecordList(new BConsoleRecord[]{bConsoleRecord}); + } + + public static BConsoleRecordList make(BConsoleRecord[] bConsoleRecordArray) { + if (bConsoleRecordArray.length == 0) { + return NULL; + } + return new BConsoleRecordList((BConsoleRecord[])bConsoleRecordArray.clone()); + } + + public static BConsoleRecordList add(BConsoleRecordList bConsoleRecordList, BConsoleRecord bConsoleRecord) { + BConsoleRecord[] bConsoleRecordArray = new BConsoleRecord[bConsoleRecordList.ords.length + 1]; + System.arraycopy(bConsoleRecordList.ords, 0, bConsoleRecordArray, 0, bConsoleRecordList.ords.length); + bConsoleRecordArray[bConsoleRecordArray.length - 1] = bConsoleRecord; + return new BConsoleRecordList(bConsoleRecordArray); + } + + public static BConsoleRecordList remove(BConsoleRecordList bConsoleRecordList, int n) { + BConsoleRecord[] bConsoleRecordArray = new BConsoleRecord[bConsoleRecordList.ords.length - 1]; + System.arraycopy(bConsoleRecordList.ords, 0, bConsoleRecordArray, 0, n); + if (n < bConsoleRecordList.ords.length) { + System.arraycopy(bConsoleRecordList.ords, n + 1, bConsoleRecordArray, n, bConsoleRecordList.ords.length - n - 1); + } + return new BConsoleRecordList(bConsoleRecordArray); + } + + private BConsoleRecordList(BConsoleRecord[] bConsoleRecordArray) { + this.ords = bConsoleRecordArray; + } + + public BConsoleRecord get(int n) { + return this.ords[n]; + } + + public int size() { + return this.ords.length; + } + + public boolean isNull() { + return this.ords.length == 0; + } + + public BConsoleRecord[] toArray() { + return (BConsoleRecord[])this.ords.clone(); + } + + public int hashCode() { + if (this.hashCode == -1) { + int n = 11; + for (int i = 0; i < this.ords.length; ++i) { + n ^= this.ords[i].hashCode(); + } + this.hashCode = n; + } + return this.hashCode; + } + + public boolean equals(Object object) { + if (object instanceof BConsoleRecordList) { + BConsoleRecord[] bConsoleRecordArray = this.ords; + BConsoleRecord[] bConsoleRecordArray2 = ((BConsoleRecordList)((Object)object)).ords; + if (bConsoleRecordArray.length != bConsoleRecordArray2.length) { + return false; + } + for (int i = 0; i < bConsoleRecordArray.length; ++i) { + if (bConsoleRecordArray[i].equals((Object)bConsoleRecordArray2[i])) continue; + return false; + } + return true; + } + return false; + } + + public void encode(DataOutput dataOutput) throws IOException { + dataOutput.writeUTF(this.string); + } + + public BObject decode(DataInput dataInput) throws IOException { + return this.decodeFromString(dataInput.readUTF()); + } + + public String encodeToString() throws IOException { + if (this.string == null) { + StringBuffer stringBuffer = new StringBuffer(); + for (int i = 0; i < this.ords.length; ++i) { + if (i > 0) { + stringBuffer.append('\n'); + } + stringBuffer.append(this.ords[i].encodeToString()); + } + this.string = stringBuffer.toString(); + } + return this.string; + } + + public BObject decodeFromString(String string) throws IOException { + ArrayList arrayList = new ArrayList(); + StringTokenizer stringTokenizer = new StringTokenizer(string, "\n"); + while (stringTokenizer.hasMoreTokens()) { + arrayList.add(new BConsoleRecord().decodeFromString(stringTokenizer.nextToken())); + } + BConsoleRecord[] bConsoleRecordArray = arrayList.toArray(new BConsoleRecord[arrayList.size()]); + return new BConsoleRecordList(bConsoleRecordArray); + } + + public Type getType() { + return TYPE; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + DEFAULT = NULL = new BConsoleRecordList(new BConsoleRecord[0]); + TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$portal$BConsoleRecordList == null ? (class$com$tridium$alarm$ui$portal$BConsoleRecordList = BConsoleRecordList.class$("com.tridium.alarm.ui.portal.BConsoleRecordList")) : class$com$tridium$alarm$ui$portal$BConsoleRecordList)); + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/portal/BHostSelectPane.java b/modules/cfr_output/com/tridium/alarm/ui/portal/BHostSelectPane.java new file mode 100644 index 0000000..3ec03f9 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/portal/BHostSelectPane.java @@ -0,0 +1,287 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.ui.theme.Theme + * com.tridium.workbench.auth.AuthUtil + * com.tridium.workbench.auth.BUsernameAndPasswordFE + * com.tridium.workbench.auth.CredentialsList + * com.tridium.workbench.fieldeditors.BBooleanFE + * com.tridium.workbench.fieldeditors.BIntegerFE + * com.tridium.workbench.ord.BHostOrdFE + * com.tridium.workbench.shell.BGeneralOptions + * javax.baja.data.BIDataValue + * javax.baja.gx.BFont + * javax.baja.gx.BImage + * javax.baja.naming.BOrd + * javax.baja.security.BICredentials + * javax.baja.security.BUsernameAndPassword + * javax.baja.sys.Action + * javax.baja.sys.BBoolean + * javax.baja.sys.BComplex + * javax.baja.sys.BComponent + * javax.baja.sys.BFacets + * javax.baja.sys.BInteger + * javax.baja.sys.BLink + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BCheckBox + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.enums.BValign + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.util.UiLexicon + * javax.baja.workbench.BWbPlugin + */ +package com.tridium.alarm.ui.portal; + +import com.tridium.ui.theme.Theme; +import com.tridium.workbench.auth.AuthUtil; +import com.tridium.workbench.auth.BUsernameAndPasswordFE; +import com.tridium.workbench.auth.CredentialsList; +import com.tridium.workbench.fieldeditors.BBooleanFE; +import com.tridium.workbench.fieldeditors.BIntegerFE; +import com.tridium.workbench.ord.BHostOrdFE; +import com.tridium.workbench.shell.BGeneralOptions; +import javax.baja.data.BIDataValue; +import javax.baja.gx.BFont; +import javax.baja.gx.BImage; +import javax.baja.naming.BOrd; +import javax.baja.security.BICredentials; +import javax.baja.security.BUsernameAndPassword; +import javax.baja.sys.Action; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BInteger; +import javax.baja.sys.BLink; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BCheckBox; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.enums.BValign; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.workbench.BWbPlugin; + +public class BHostSelectPane +extends BEdgePane { + public static final Action addressModified = BHostSelectPane.newAction((int)0, null); + public static final Action foxsModified = BHostSelectPane.newAction((int)0, null); + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$portal$BHostSelectPane == null ? (class$com$tridium$alarm$ui$portal$BHostSelectPane = BHostSelectPane.class$("com.tridium.alarm.ui.portal.BHostSelectPane")) : class$com$tridium$alarm$ui$portal$BHostSelectPane)); + public static final BImage logo = BImage.make((String)"module://icons/x32/connect.png"); + public static final BImage keys = BImage.make((String)"module://icons/x16/keys.png"); + BIntegerFE portFE; + BBooleanFE useFoxsFE; + BHostOrdFE hostOrdFE; + BLink link = null; + BUsernameAndPasswordFE credentialsEditor; + BCheckBox saveCredentials; + static /* synthetic */ Class class$com$tridium$alarm$ui$portal$BHostSelectPane; + + public void addressModified() { + this.invoke(addressModified, null, null); + } + + public void foxsModified() { + this.invoke(foxsModified, null, null); + } + + public Type getType() { + return TYPE; + } + + public BHostSelectPane() { + this(BOrd.NULL, BGeneralOptions.make().getIsDefaultConnectionTypeSsl() ? 4911 : 1911, BGeneralOptions.make().getIsDefaultConnectionTypeSsl()); + } + + public BHostSelectPane(BOrd bOrd, int n, boolean bl) { + UiLexicon uiLexicon = UiLexicon.bajaui; + BLabel bLabel = new BLabel(logo); + bLabel.setValign(BValign.top); + String string = uiLexicon.getText("auth.title"); + String string2 = uiLexicon.getText("auth.description"); + String string3 = uiLexicon.getText("auth.host"); + String string4 = uiLexicon.getText("auth.port"); + String string5 = uiLexicon.getText("auth.foxs"); + String string6 = uiLexicon.getText("auth.credentials"); + String string7 = uiLexicon.getText("auth.saveCredentials"); + BFont bFont = Theme.widget().getBoldText(); + BGridPane bGridPane = new BGridPane(2); + bGridPane.setHalign(BHalign.left); + bGridPane.add(null, (BValue)new BLabel(string3, bFont)); + this.hostOrdFE = new BHostOrdFE(); + BFacets bFacets = BFacets.make((String)"ordRelativize", (BIDataValue)BBoolean.FALSE, (String)"mruAutoSave", (BIDataValue)BBoolean.FALSE); + BGeneralOptions bGeneralOptions = BGeneralOptions.make(); + boolean bl2 = bGeneralOptions.getAllowUserCredentialCaching(); + if (!bl2) { + AuthUtil.saveCredentials = false; + } + this.saveCredentials = new BCheckBox(string7, AuthUtil.saveCredentials); + this.saveCredentials.setEnabled(bl2); + this.hostOrdFE.loadValue((BObject)bOrd, (Context)bFacets); + this.link = this.linkTo((BComponent)this.hostOrdFE, (Slot)BHostOrdFE.pluginModified, (Slot)addressModified); + bGridPane.add(null, (BValue)this.hostOrdFE); + bGridPane.add(null, (BValue)new BLabel(string4, bFont)); + this.portFE = new BIntegerFE(); + this.portFE.loadValue((BObject)BInteger.make((int)n)); + bGridPane.add(null, (BValue)this.portFE); + bGridPane.add(null, (BValue)new BLabel(string5, bFont)); + this.useFoxsFE = new BBooleanFE(); + this.useFoxsFE.loadValue((BObject)BBoolean.make((boolean)bl)); + bGridPane.add(null, (BValue)this.useFoxsFE); + this.linkTo((BComponent)this.useFoxsFE, (Slot)BWbPlugin.pluginModified, (Slot)foxsModified); + this.credentialsEditor = new BUsernameAndPasswordFE(); + this.credentialsEditor.loadValue((BObject)new BUsernameAndPassword()); + BGridPane bGridPane2 = new BGridPane(1); + bGridPane2.setHalign(BHalign.left); + bGridPane2.add(null, (BValue)new BLabel(string6, bFont)); + bGridPane2.add(null, (BValue)new BBorderPane((BWidget)this.credentialsEditor, 0.0, 0.0, 0.0, 20.0)); + BGridPane bGridPane3 = new BGridPane(1); + bGridPane3.setHalign(BHalign.left); + bGridPane3.setRowGap(10.0); + bGridPane3.add(null, (BValue)bGridPane); + bGridPane3.add(null, (BValue)bGridPane2); + bGridPane3.add(null, (BValue)this.saveCredentials); + this.setCenter((BWidget)new BBorderPane((BWidget)bGridPane3, 5.0, 5.0, 5.0, 5.0)); + if (bOrd != BOrd.NULL) { + String string8 = this.addressToOrdString(this.getHostOrd(), this.getPort(), bl); + BUsernameAndPassword bUsernameAndPassword = (BUsernameAndPassword)CredentialsList.INSTANCE.lookup(string8); + try { + if (!((BOrd)this.hostOrdFE.saveValue()).equals((Object)BOrd.make((String)"ip:")) && (bUsernameAndPassword == null || bUsernameAndPassword.getUsername() == null || bUsernameAndPassword.getUsername().isEmpty())) { + this.saveCredentials.setSelected(false); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + this.doAddressModified(); + } + + public String getHostString() { + try { + return this.hostOrdFE.saveValue().toString(); + } + catch (Exception exception) { + return null; + } + } + + public int getPort() { + try { + return ((BInteger)this.portFE.saveValue()).getInt(); + } + catch (Exception exception) { + return 1911; + } + } + + public boolean getUseFoxs() { + try { + return ((BBoolean)this.useFoxsFE.saveValue()).getBoolean(); + } + catch (Exception exception) { + return false; + } + } + + public BOrd getHostOrd() { + try { + this.remove((BComplex)this.link); + this.hostOrdFE.setModified(); + this.addressToOrdString(this.getHostOrd(), this.getPort(), this.getUseFoxs()); + this.link = this.linkTo((BComponent)this.hostOrdFE, (Slot)BHostOrdFE.pluginModified, (Slot)addressModified); + BOrd bOrd = (BOrd)this.hostOrdFE.saveValue(); + return bOrd; + } + catch (Exception exception) { + return BOrd.NULL; + } + } + + public BICredentials getCredentials() { + try { + BICredentials bICredentials = (BICredentials)this.credentialsEditor.saveValue(); + BUsernameAndPassword bUsernameAndPassword = (BUsernameAndPassword)bICredentials; + return bICredentials; + } + catch (Exception exception) { + exception.printStackTrace(); + return new BUsernameAndPassword(); + } + } + + public boolean getRememberCredentials() { + return this.saveCredentials.isSelected(); + } + + public String getRealm() { + return this.addressToOrdString(this.getHostOrd(), this.getPort(), this.getUseFoxs()); + } + + protected String addressToOrdString(BOrd bOrd, int n, boolean bl) { + String string = bOrd.toString(); + if (bl) { + string = string + "|foxs:"; + if (n != 4911) { + string = string + n; + } + } else { + string = string + "|fox:"; + if (n != 1911) { + string = string + n; + } + } + return string; + } + + public void doAddressModified() { + try { + String string = this.addressToOrdString(this.getHostOrd(), this.getPort(), this.getUseFoxs()); + BUsernameAndPassword bUsernameAndPassword = (BUsernameAndPassword)CredentialsList.INSTANCE.lookup(string); + if (bUsernameAndPassword != null) { + this.credentialsEditor.loadValue((BObject)bUsernameAndPassword); + } else { + this.credentialsEditor.loadValue((BObject)new BUsernameAndPassword()); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + public void doFoxsModified() { + if (this.getUseFoxs()) { + this.portFE.loadValue((BObject)BInteger.make((int)4911)); + } else { + this.portFE.loadValue((BObject)BInteger.make((int)1911)); + } + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/portal/BPortalAlarmConsole.java b/modules/cfr_output/com/tridium/alarm/ui/portal/BPortalAlarmConsole.java new file mode 100644 index 0000000..53b1f99 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/portal/BPortalAlarmConsole.java @@ -0,0 +1,577 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.bql.filter.BAbsTimeFilter + * com.tridium.bql.util.BDynamicTimeRange + * com.tridium.fox.sys.BFoxSession + * javax.baja.collection.BICollection + * javax.baja.gx.BBrush + * javax.baja.gx.BColor + * javax.baja.naming.BOrd + * javax.baja.naming.BOrdList + * javax.baja.nre.util.Array + * javax.baja.sys.BAbsTime + * javax.baja.sys.BComplex + * javax.baja.sys.BObject + * javax.baja.sys.Context + * javax.baja.sys.Cursor + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.Command + * javax.baja.ui.ToggleCommand + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.table.DynamicTableModel + * javax.baja.ui.table.TableCellRenderer + * javax.baja.ui.table.TableCellRenderer$Cell + * javax.baja.ui.table.TableSelection + * javax.baja.workbench.BWbShell + */ +package com.tridium.alarm.ui.portal; + +import com.tridium.alarm.BConsoleRecipient; +import com.tridium.alarm.ui.BAlarmClassDef; +import com.tridium.alarm.ui.BAlarmClassMapping; +import com.tridium.alarm.ui.BAlarmConsole; +import com.tridium.alarm.ui.SourceTableModel; +import com.tridium.alarm.ui.portal.BAlarmPortalTool; +import com.tridium.alarm.ui.portal.BConsoleRecord; +import com.tridium.bql.filter.BAbsTimeFilter; +import com.tridium.bql.util.BDynamicTimeRange; +import com.tridium.fox.sys.BFoxSession; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.Hashtable; +import javax.baja.alarm.BAckState; +import javax.baja.alarm.BAlarmClass; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.alarm.BAlarmService; +import javax.baja.collection.BICollection; +import javax.baja.gx.BBrush; +import javax.baja.gx.BColor; +import javax.baja.naming.BOrd; +import javax.baja.naming.BOrdList; +import javax.baja.nre.util.Array; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BComplex; +import javax.baja.sys.BObject; +import javax.baja.sys.Context; +import javax.baja.sys.Cursor; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.Command; +import javax.baja.ui.ToggleCommand; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.table.DynamicTableModel; +import javax.baja.ui.table.TableCellRenderer; +import javax.baja.ui.table.TableSelection; +import javax.baja.workbench.BWbShell; + +public class BPortalAlarmConsole +extends BAlarmConsole { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$portal$BPortalAlarmConsole == null ? (class$com$tridium$alarm$ui$portal$BPortalAlarmConsole = BPortalAlarmConsole.class$("com.tridium.alarm.ui.portal.BPortalAlarmConsole")) : class$com$tridium$alarm$ui$portal$BPortalAlarmConsole)); + BAlarmPortalTool tool; + BButton serviceToggle; + public Command startCommand; + public Command stopCommand; + public ToggleCommand autoStartCommand; + static /* synthetic */ Class class$com$tridium$alarm$ui$portal$BPortalAlarmConsole; + static /* synthetic */ Class class$javax$baja$alarm$BAlarmRecord; + + public Type getType() { + return TYPE; + } + + public void stopped() throws Exception { + Object object; + Object object2; + if (this.sourceTable.getModel() instanceof DynamicTableModel) { + object2 = (DynamicTableModel)this.sourceTable.getModel(); + object = new StringBuffer(); + for (int i = 0; i < object2.getRootColumnCount(); ++i) { + if (!object2.showColumn(i)) continue; + object.append(i + ","); + } + if (object2.getRootColumnCount() > 0) { + this.options.setDisplayColumns(object.toString()); + } + } + this.options.setSortColumn(this.sourceModel.getLastSortColumn()); + this.options.setSortAscending(this.sourceModel.getLastSortAscending()); + this.options.save(); + if (!this.tool.serviceRunning()) { + object2 = this.tool.recipients.keys(); + while (object2.hasMoreElements()) { + object = (BConsoleRecipient)((Object)this.tool.recipients.get(object2.nextElement())); + if (this.channel((BConsoleRecipient)((Object)object)) == null) continue; + this.channel((BConsoleRecipient)((Object)object)).unregister((BConsoleRecipient)((Object)object)); + this.channel((BConsoleRecipient)((Object)object)).unregister(this); + } + if (this.tool.trayIcon != null && this.tool.trayIcon.isShowing()) { + this.tool.trayIcon.hide(); + } + } + } + + public void doLoadValue(BObject bObject, Context context) throws Exception { + this.tool = (BAlarmPortalTool)bObject; + super.doLoadValue((BObject)this.tool.getAlarmPortalConsoleRecipient(), context); + this.sourceTable.setCellRenderer((TableCellRenderer)new AlarmPortalTableCellRenderer()); + } + + public BGridPane makeToolBar() { + BGridPane bGridPane = super.makeToolBar(); + return bGridPane; + } + + public void doProcessAlarm(BAlarmRecord bAlarmRecord) { + super.doProcessAlarm(bAlarmRecord); + if (this.options.getAlarmFilters().accept((BComplex)bAlarmRecord)) { + int n = this.getAckedAlarmCount(); + int n2 = this.getUnackedAlarmCount(); + this.tool.updateTrayIcon(n, n2, this.sourcesInAlarm()); + this.tool.showAlarmDialog(n, n2, this.sourcesInAlarm(), bAlarmRecord); + } + } + + public void doTimeRangeModified() throws Exception { + this.timeRange = (BDynamicTimeRange)this.timeRangeEd.saveValue(); + this.reload(); + } + + public int getAckedAlarmCount() { + if (this.sourceModel == null || this.tool == null) { + return 0; + } + int n = 0; + int n2 = this.sourceModel.getRowCount(); + for (int i = 0; i < n2; ++i) { + n += this.sourceModel.getAckedCountForSource(this.sourceModel.getRecord(i).getSource()); + } + this.tool.acked = n; + return n; + } + + public int getUnackedAlarmCount() { + if (this.sourceModel == null || this.tool == null) { + return 0; + } + int n = 0; + int n2 = this.sourceModel.getRowCount(); + for (int i = 0; i < n2; ++i) { + n += this.sourceModel.getUnackedCountForSource(this.sourceModel.getRecord(i).getSource()); + } + this.tool.unacked = n; + return n; + } + + public boolean sourcesInAlarm() { + if (this.sourceModel == null || this.tool == null) { + return false; + } + boolean bl = false; + int n = this.sourceModel.getRowCount(); + for (int i = 0; i < n; ++i) { + bl |= !this.sourceModel.getRecord(i).isNormal(); + } + this.tool.sourcesInAlarm = bl; + return bl; + } + + public BAlarmRecord getMostRecentRecord() { + if (this.sourceModel == null || this.tool == null) { + return null; + } + BAlarmRecord bAlarmRecord = new BAlarmRecord(); + bAlarmRecord.setTimestamp(BAbsTime.NULL); + int n = this.sourceModel.getRowCount(); + for (int i = 0; i < n; ++i) { + BAlarmRecord bAlarmRecord2 = this.sourceModel.getRecord(i); + if (!bAlarmRecord2.getTimestamp().isAfter(bAlarmRecord.getTimestamp())) continue; + bAlarmRecord = bAlarmRecord2; + } + return bAlarmRecord; + } + + public void removeAlarmsFrom(BConsoleRecord bConsoleRecord) { + int n; + String string = bConsoleRecord.getUseFoxs() ? "|foxs:" : "|fox:"; + BOrd bOrd = BOrd.make((String)(bConsoleRecord.getHostOrd() + string + bConsoleRecord.getPort() + "|station:|" + bConsoleRecord.getConsoleOrd())); + if (this.sourceModel == null) { + return; + } + int n2 = this.sourceModel.getRowCount(); + ArrayList arrayList = new ArrayList(); + for (n = 0; n < n2; ++n) { + BOrdList bOrdList = this.sourceModel.getRecord(n).getSource(); + if (!this.ordListContains(bOrdList, bOrd)) continue; + arrayList.add(bOrdList); + } + for (n = 0; n < arrayList.size(); ++n) { + try { + this.sourceModel.removeSource((BOrdList)arrayList.get(n)); + continue; + } + catch (Exception exception) { + // empty catch block + } + } + } + + private boolean ordListContains(BOrdList bOrdList, BOrd bOrd) { + for (int i = 0; i < bOrdList.size(); ++i) { + BOrd bOrd2 = bOrdList.get(i); + if (!bOrd2.equals((Object)bOrd)) continue; + return true; + } + return false; + } + + public void load() { + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void reload() { + Object object; + Object object2; + this.sourceModel.clear(); + Enumeration enumeration = this.tool.recipients.keys(); + while (enumeration.hasMoreElements()) { + object2 = (BConsoleRecipient)((Object)this.tool.recipients.get(enumeration.nextElement())); + BConsoleRecord bConsoleRecord = this.tool.getRecordForRecipient((BConsoleRecipient)((Object)object2)); + object = bConsoleRecord.getUseFoxs() ? "foxs:" : "fox:"; + BOrd bOrd = BOrd.make((BOrd)bConsoleRecord.getHostOrd(), (String)((String)object + bConsoleRecord.getPort() + "|station:|" + bConsoleRecord.getConsoleOrd().toString())); + this.enterBusy(); + try { + String string; + BAbsTimeFilter bAbsTimeFilter; + StringBuffer stringBuffer = new StringBuffer(this.channel((BConsoleRecipient)((Object)object2)).getInitialAlarmQuery(this, (BConsoleRecipient)((Object)object2), bOrd).toString()); + StringBuffer stringBuffer2 = new StringBuffer(64); + String string2 = this.options.getAlarmFilters().getPredicate(); + if (string2 != null && string2.length() > 0) { + if (stringBuffer2.length() != 0) { + stringBuffer2.append(" and "); + } + stringBuffer2.append(string2); + } + if (stringBuffer2.length() != 0) { + stringBuffer.append(" and ").append(stringBuffer2.toString()); + } + if (!this.timeRange.equals((Object)BDynamicTimeRange.DEFAULT)) { + bAbsTimeFilter = new BAbsTimeFilter(); + bAbsTimeFilter.initFromDynamicTimeRange(this.timeRange); + string = bAbsTimeFilter.getPredicate(BAlarmRecord.timestamp.getName()); + stringBuffer.append(" and ").append(string.toString()); + } + stringBuffer.append(" order by timestamp desc, "); + stringBuffer.append(this.sourceModel.getColumns().getColumn(this.options.getSortColumn()).getQueryName()); + if (this.options.getSortAscending()) { + stringBuffer.append(" asc"); + } else { + stringBuffer.append(" desc"); + } + bAbsTimeFilter = BOrd.make((BOrd)((BWbShell)this.getShell()).getActiveOrd(), (BOrd)BOrd.make((String)stringBuffer.toString())); + string = (BICollection)bAbsTimeFilter.resolve((BObject)object2).get(); + Cursor cursor = string.cursor(); + BAlarmRecord bAlarmRecord = null; + if (!cursor.next()) continue; + bAlarmRecord = (BAlarmRecord)cursor.get(); + BOrdList bOrdList = bAlarmRecord.getSource(); + bOrdList = BOrdList.add((BOrdList)bOrdList, (BOrd)bOrd); + bAlarmRecord.setSource(bOrdList); + this.sourceModel.update(bAlarmRecord); + this.sourceTable.sizeColumnsToFit(); + while (cursor.next()) { + bAlarmRecord = (BAlarmRecord)cursor.get(); + bOrdList = bAlarmRecord.getSource(); + bOrdList = BOrdList.add((BOrdList)bOrdList, (BOrd)bOrd); + bAlarmRecord.setSource(bOrdList); + this.sourceModel.update(bAlarmRecord, false); + } + this.sourceModel.sortByColumn(this.sourceModel.getLastSortColumn(), this.sourceModel.getLastSortAscending()); + this.sourceModel.updateTable(); + this.sourceTable.sizeColumnsToFit(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + finally { + this.exitBusy(); + this.loadComplete(); + this.sourceModel.init(this, this.ctx); + this.sourceTable.sizeColumnsToFit(); + } + } + this.exitBusy(); + object2 = null; + for (int i = 0; i < this.sourceModel.getRowCount(); ++i) { + object = this.sourceModel.getRecord(i); + if (object.isAlarm()) { + this.soundAlarmFor((BAlarmRecord)((Object)object)); + } + if (object2 == null) { + object2 = object; + continue; + } + if (!((BAlarmRecord)((Object)object2)).getTimestamp().isBefore(object.getTimestamp())) continue; + object2 = object; + } + } + + protected void init() { + this.sourceModel.init(this, this.ctx); + } + + protected void ackAlarms(BAlarmRecord[] bAlarmRecordArray) { + try { + BOrdList bOrdList; + Object object; + Hashtable hashtable = new Hashtable(); + for (int i = 0; i < bAlarmRecordArray.length && !((BAlarmRecord)((Object)(object = (BAlarmRecord)bAlarmRecordArray[i].newCopy()))).isAcknowledged(); ++i) { + bOrdList = ((BAlarmRecord)((Object)object)).getSource(); + BOrd bOrd = bOrdList.get(bOrdList.size() - 1); + BConsoleRecord bConsoleRecord = this.tool.getConsoleRecordFor(bOrd); + BConsoleRecipient bConsoleRecipient = this.tool.getRecipientForRecord(bConsoleRecord); + ((BAlarmRecord)((Object)object)).setUser(this.getUsername((BAlarmRecord)((Object)object))); + ((BAlarmRecord)((Object)object)).setAckTime(BAbsTime.now()); + ((BAlarmRecord)((Object)object)).setAckState(BAckState.ackPending); + this.sourceModel.update((BAlarmRecord)((Object)object)); + Array array = (Array)hashtable.get((Object)bConsoleRecipient); + if (array == null) { + array = new Array(class$javax$baja$alarm$BAlarmRecord == null ? BPortalAlarmConsole.class$("javax.baja.alarm.BAlarmRecord") : class$javax$baja$alarm$BAlarmRecord); + } + BAlarmRecord bAlarmRecord = (BAlarmRecord)object.newCopy(); + bAlarmRecord.setSource(BOrdList.remove((BOrdList)((BAlarmRecord)((Object)object)).getSource(), (int)(((BAlarmRecord)((Object)object)).getSource().size() - 1))); + array.add((Object)bAlarmRecord); + hashtable.put(bConsoleRecipient, array); + } + Enumeration enumeration = hashtable.keys(); + while (enumeration.hasMoreElements()) { + object = (BConsoleRecipient)((Object)enumeration.nextElement()); + bOrdList = (Array)hashtable.get(object); + this.channel((BConsoleRecipient)((Object)object)).ackAlarms(this.tool.getAlarmPortalConsoleRecipient(), (BAlarmRecord[])bOrdList.trim()); + } + this.sourceTable.sizeColumnsToFit(); + this.sourceTable.fireTableModified(null); + if (this.alarmTable != null) { + this.alarmTable.fireTableModified(null); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + protected String getUsername(BAlarmRecord bAlarmRecord) { + BOrdList bOrdList = bAlarmRecord.getSource(); + BOrd bOrd = bOrdList.get(bOrdList.size() - 1); + BConsoleRecord bConsoleRecord = this.tool.getConsoleRecordFor(bOrd); + if (bConsoleRecord == null) { + return null; + } + BConsoleRecipient bConsoleRecipient = this.tool.getRecipientForRecord(bConsoleRecord); + if (!bConsoleRecipient.isMounted()) { + return null; + } + return ((BFoxSession)bConsoleRecipient.getSession()).getConnection().getUsername(); + } + + public BAlarmService getAlarmService() { + SourceTableModel sourceTableModel = (SourceTableModel)((DynamicTableModel)this.sourceModel.getModel()).getRootModel(); + BAlarmRecord bAlarmRecord = sourceTableModel.getRecord(this.sourceModel.getSelection().getSelection().getRow()); + BOrdList bOrdList = bAlarmRecord.getSource(); + BOrd bOrd = bOrdList.get(bOrdList.size() - 1); + String string = bOrd.toString(); + string = string.substring(0, string.indexOf("|station:|")); + BConsoleRecord bConsoleRecord = this.tool.getConsoleRecordForStation(BOrd.make((String)string)); + BConsoleRecipient bConsoleRecipient = this.tool.getRecipientForRecord(bConsoleRecord); + BOrd bOrd2 = BOrd.make((String)"service:alarm:AlarmService"); + BAlarmService bAlarmService = (BAlarmService)bOrd2.resolve((BObject)bConsoleRecipient).get(); + bAlarmService.lease(); + return bAlarmService; + } + + protected boolean canModifySelectedAlarms(TableSelection tableSelection) { + if (tableSelection == null || tableSelection.isEmpty()) { + return false; + } + int[] nArray = tableSelection.getRows(); + SourceTableModel sourceTableModel = (SourceTableModel)((DynamicTableModel)this.sourceModel.getModel()).getRootModel(); + for (int i = 0; i < nArray.length; ++i) { + BAlarmRecord bAlarmRecord = sourceTableModel.getRecord(nArray[i]); + BOrdList bOrdList = bAlarmRecord.getSource(); + BOrd bOrd = bOrdList.get(bOrdList.size() - 1); + String string = bOrd.toString(); + string = string.substring(0, string.indexOf("|station:|")); + BConsoleRecord bConsoleRecord = this.tool.getConsoleRecordForStation(BOrd.make((String)string)); + BConsoleRecipient bConsoleRecipient = this.tool.getRecipientForRecord(bConsoleRecord); + BOrd bOrd2 = BOrd.make((String)"service:alarm:AlarmService"); + BAlarmService bAlarmService = (BAlarmService)bOrd2.resolve((BObject)bConsoleRecipient).get(); + bAlarmService.lease(); + BAlarmClass bAlarmClass = bAlarmService.lookupAlarmClass(bAlarmRecord.getAlarmClass()); + if (!(bAlarmClass == null ? !bAlarmService.getDefaultAlarmClass().getPermissions(this.ctx).hasOperatorWrite() : !bAlarmClass.getPermissions(this.ctx).hasOperatorWrite())) continue; + return false; + } + return true; + } + + protected void hyperlink(BAlarmRecord bAlarmRecord) { + BWbShell bWbShell = this.getWbShell(); + if (bWbShell != null) { + BAlarmClassDef bAlarmClassDef; + BAlarmClassMapping bAlarmClassMapping; + BOrd bOrd = BOrd.make((String)bAlarmRecord.getAlarmData().get("hyperlinkOrd").toString()); + if (bOrd == null || bOrd.isNull()) { + bAlarmClassMapping = this.options.getAlarmClassMapping(); + bAlarmClassDef = bAlarmClassMapping.getAlarmClassDefFor(bAlarmRecord.getAlarmClass()); + bOrd = bAlarmClassDef.getAlarmUrl(); + } + if (!bOrd.isNull()) { + bAlarmClassMapping = bAlarmRecord.getSource(); + bAlarmClassDef = bAlarmClassMapping.get(bAlarmClassMapping.size() - 1); + String string = bAlarmClassDef.toString(); + string = string.substring(0, string.indexOf("|station:|")); + BConsoleRecord bConsoleRecord = this.tool.getConsoleRecordForStation(BOrd.make((String)string)); + BConsoleRecipient bConsoleRecipient = this.tool.getRecipientForRecord(bConsoleRecord); + BOrd bOrd2 = BOrd.make((BOrd)bConsoleRecipient.getNavOrd(), (BOrd)bOrd); + bWbShell.hyperlink(bOrd2); + if (this.detailsDlg != null) { + this.detailsDlg.close(); + } + if (this.alarmReport != null) { + this.alarmReport.close(); + } + } + } + } + + public void soundAlarmFor(BAlarmRecord bAlarmRecord) { + BOrd bOrd = BOrd.NULL; + if (bAlarmRecord.getAlarmData().get("soundFile") != null) { + bOrd = BOrd.make((BOrd)BOrd.toSpace((BObject)this.getRecipientForAlarm(bAlarmRecord)).getNavOrd(), (String)bAlarmRecord.getAlarmData().get("soundFile").toString()); + } + if (bOrd == null || bOrd.isNull()) { + BAlarmClassMapping bAlarmClassMapping; + BAlarmClassDef bAlarmClassDef = null; + if (this.options != null && (bAlarmClassMapping = this.options.getAlarmClassMapping()) != null && (bAlarmClassDef = bAlarmClassMapping.getAlarmClassDefFor(bAlarmRecord.getAlarmClass())) != null) { + bOrd = bAlarmClassDef.getAlarmSound(); + } + } + try { + if (bOrd == null || bOrd.isNull()) { + this.soundAlarm(bAlarmRecord); + } else { + this.soundAlarm(bAlarmRecord.getSource(), bOrd); + } + } + catch (Exception exception) { + // empty catch block + } + } + + protected BConsoleRecipient getRecipientForAlarm(BAlarmRecord bAlarmRecord) { + if (bAlarmRecord == null) { + return null; + } + BOrdList bOrdList = bAlarmRecord.getSource(); + BOrd bOrd = bOrdList.get(bOrdList.size() - 1); + String string = bOrd.toString(); + string = string.substring(0, string.indexOf("|station:|")); + BConsoleRecord bConsoleRecord = this.tool.getConsoleRecordForStation(BOrd.make((String)string)); + return this.tool.getRecipientForRecord(bConsoleRecord); + } + + public BAlarmService getAlarmService(BAlarmRecord bAlarmRecord) { + BConsoleRecipient bConsoleRecipient = this.getRecipientForAlarm(bAlarmRecord); + BConsoleRecord bConsoleRecord = this.tool.getRecordForRecipient(bConsoleRecipient); + if (bConsoleRecipient == null) { + return null; + } + if (bConsoleRecord == null || !bConsoleRecord.isInitialLoadComplete()) { + return null; + } + try { + return (BAlarmService)BOrd.make((String)"service:alarm:AlarmService").resolve((BObject)bConsoleRecipient).get(); + } + catch (Exception exception) { + exception.printStackTrace(); + return null; + } + } + + protected void sendUpdatedAlarm(BAlarmRecord bAlarmRecord) throws Exception { + BOrdList bOrdList = bAlarmRecord.getSource(); + BOrd bOrd = bOrdList.get(bOrdList.size() - 1); + BConsoleRecord bConsoleRecord = this.tool.getConsoleRecordFor(bOrd); + BConsoleRecipient bConsoleRecipient = this.tool.getRecipientForRecord(bConsoleRecord); + BAlarmRecord bAlarmRecord2 = (BAlarmRecord)bAlarmRecord.newCopy(); + bAlarmRecord2.setSource(BOrdList.remove((BOrdList)bOrdList, (int)(bOrdList.size() - 1))); + this.channel(bConsoleRecipient).updateAlarm(bAlarmRecord2); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public class AlarmPortalTableCellRenderer + extends BAlarmConsole.AlarmTableCellRenderer { + public BBrush getForeground(TableCellRenderer.Cell cell) { + int n = cell.row; + BAlarmRecord bAlarmRecord = BPortalAlarmConsole.this.sourceModel.getRecord(n); + BOrd bOrd = bAlarmRecord.getSource().get(bAlarmRecord.getSource().size() - 1); + BConsoleRecipient bConsoleRecipient = (BConsoleRecipient)((Object)BPortalAlarmConsole.this.tool.recipients.get(bOrd.toString())); + return bConsoleRecipient != null && bConsoleRecipient.isMounted() ? super.getForeground(cell) : BBrush.makeSolid((BColor)BColor.gray); + } + } + + public static class SourceModCursor + implements Cursor { + Cursor inner; + BOrd srcAdd; + BAlarmRecord rec; + + public SourceModCursor(BOrd bOrd, Cursor cursor) { + this.srcAdd = bOrd; + this.inner = cursor; + } + + public Context getContext() { + return this.inner.getContext(); + } + + public BObject get() { + if (this.rec == null) { + this.rec = (BAlarmRecord)this.inner.get(); + BOrdList bOrdList = this.rec.getSource(); + bOrdList = BOrdList.add((BOrdList)bOrdList, (BOrd)this.srcAdd); + this.rec.setSource(bOrdList); + } + return this.rec; + } + + public boolean next() { + this.rec = null; + return this.inner.next(); + } + + public boolean nextComponent() { + this.rec = null; + return this.inner.nextComponent(); + } + + public boolean next(Class clazz) { + this.rec = null; + return this.inner.next(clazz); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/ui/portal/BPortalConsoleRecipient.java b/modules/cfr_output/com/tridium/alarm/ui/portal/BPortalConsoleRecipient.java new file mode 100644 index 0000000..af13e34 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/ui/portal/BPortalConsoleRecipient.java @@ -0,0 +1,62 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.bql.util.BDynamicTimeRange + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.alarm.ui.portal; + +import com.tridium.alarm.BConsoleRecipient; +import com.tridium.alarm.ui.portal.BAlarmPortalTool; +import com.tridium.bql.util.BDynamicTimeRange; +import javax.baja.alarm.BAlarmRecord; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public class BPortalConsoleRecipient +extends BConsoleRecipient { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$portal$BPortalConsoleRecipient == null ? (class$com$tridium$alarm$ui$portal$BPortalConsoleRecipient = BPortalConsoleRecipient.class$("com.tridium.alarm.ui.portal.BPortalConsoleRecipient")) : class$com$tridium$alarm$ui$portal$BPortalConsoleRecipient)); + BAlarmPortalTool tool; + static /* synthetic */ Class class$com$tridium$alarm$ui$portal$BPortalConsoleRecipient; + + public Type getType() { + return TYPE; + } + + public BPortalConsoleRecipient() { + throw new IllegalStateException(); + } + + public BPortalConsoleRecipient(BAlarmPortalTool bAlarmPortalTool) { + this.tool = bAlarmPortalTool; + } + + public void handleAlarm(BAlarmRecord bAlarmRecord) { + this.tool.handleAlarm(bAlarmRecord); + } + + public boolean accept(BAlarmRecord bAlarmRecord) { + return this.tool.accept(bAlarmRecord); + } + + public BDynamicTimeRange getDefaultTimeRange() { + return this.tool.options.getDefaultTimeRange(); + } + + public void setDefaultTimeRange(BDynamicTimeRange bDynamicTimeRange) { + this.tool.options.setDefaultTimeRange(bDynamicTimeRange); + this.tool.options.save(); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/alarm/user/BIUserAlarmRecipient.java b/modules/cfr_output/com/tridium/alarm/user/BIUserAlarmRecipient.java new file mode 100644 index 0000000..c586325 --- /dev/null +++ b/modules/cfr_output/com/tridium/alarm/user/BIUserAlarmRecipient.java @@ -0,0 +1,32 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BInterface + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.user.BUser + */ +package com.tridium.alarm.user; + +import javax.baja.alarm.BAlarmRecord; +import javax.baja.sys.BInterface; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.user.BUser; + +public interface BIUserAlarmRecipient +extends BInterface { + public static final Type TYPE; + + public void handleAlarmForUser(BUser var1, BAlarmRecord var2); + + static { + Class clazz = 1.class$com$tridium$alarm$user$BIUserAlarmRecipient; + if (clazz == null) { + clazz = 1.class$com$tridium$alarm$user$BIUserAlarmRecipient = 1.class("[Lcom.tridium.alarm.user.BIUserAlarmRecipient;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/asm/Assembler.java b/modules/cfr_output/com/tridium/asm/Assembler.java new file mode 100644 index 0000000..0e526a6 --- /dev/null +++ b/modules/cfr_output/com/tridium/asm/Assembler.java @@ -0,0 +1,103 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.asm; + +import com.tridium.asm.AttributeInfo; +import com.tridium.asm.Buffer; +import com.tridium.asm.ConstantPool; +import com.tridium.asm.FieldInfo; +import com.tridium.asm.MethodInfo; +import java.util.ArrayList; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class Assembler { + public final int thisClass; + public final int superClass; + public final int[] interfaces; + public final int accessFlags; + public final ConstantPool cp; + private ArrayList fields; + private ArrayList methods; + private ArrayList attributes; + + public void addField(FieldInfo fieldInfo) { + this.fields.add(fieldInfo); + } + + public void addMethod(MethodInfo methodInfo) { + this.methods.add(methodInfo); + } + + public void addAttribute(AttributeInfo attributeInfo) { + this.attributes.add(attributeInfo); + } + + public Buffer compile() { + Buffer buffer = new Buffer(); + buffer.u4(-889275714); + buffer.u2(3); + buffer.u2(45); + buffer.u2(this.cp.count + 1); + buffer.append(this.cp.buf); + buffer.u2(this.accessFlags); + buffer.u2(this.thisClass); + buffer.u2(this.superClass); + buffer.u2(this.interfaces.length); + int n = 0; + while (n < this.interfaces.length) { + buffer.u2(this.interfaces[n]); + ++n; + } + buffer.u2(this.fields.size()); + n = 0; + while (n < this.fields.size()) { + ((FieldInfo)this.fields.get(n)).compile(buffer); + ++n; + } + buffer.u2(this.methods.size()); + n = 0; + while (n < this.methods.size()) { + ((MethodInfo)this.methods.get(n)).compile(buffer); + ++n; + } + buffer.u2(this.attributes.size()); + n = 0; + while (n < this.attributes.size()) { + ((AttributeInfo)this.attributes.get(n)).compile(buffer); + ++n; + } + return buffer; + } + + private final /* synthetic */ void this() { + this.cp = new ConstantPool(); + this.fields = new ArrayList(); + this.methods = new ArrayList(); + this.attributes = new ArrayList(); + } + + public Assembler(String string, String string2, int n, String[] stringArray) { + this.this(); + this.thisClass = this.cp.cls(string); + int n2 = 0; + if (string2 != null) { + n2 = this.cp.cls(string2); + } + this.superClass = n2; + this.accessFlags = n; + int n3 = 0; + if (stringArray != null) { + n3 = stringArray.length; + } + this.interfaces = new int[n3]; + int n4 = 0; + while (n4 < this.interfaces.length) { + this.interfaces[n4] = this.cp.cls(stringArray[n4]); + ++n4; + } + } +} + diff --git a/modules/cfr_output/com/tridium/asm/AttributeInfo.java b/modules/cfr_output/com/tridium/asm/AttributeInfo.java new file mode 100644 index 0000000..0647305 --- /dev/null +++ b/modules/cfr_output/com/tridium/asm/AttributeInfo.java @@ -0,0 +1,64 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.asm; + +import com.tridium.asm.Assembler; +import com.tridium.asm.Buffer; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class AttributeInfo { + private static byte[] EMPTY = new byte[0]; + public final Assembler asm; + public final int name; + public byte[] info; + + void compile(Buffer buffer) { + buffer.u2(this.name); + buffer.u4(this.info.length); + buffer.append(this.info); + } + + private final /* synthetic */ void this() { + this.info = EMPTY; + } + + public AttributeInfo(Assembler assembler, int n, byte[] byArray) { + this.this(); + this.asm = assembler; + this.name = n; + this.info = byArray; + } + + public AttributeInfo(Assembler assembler, String string, byte[] byArray) { + this.this(); + this.asm = assembler; + this.name = assembler.cp.utf(string); + this.info = byArray; + } + + public AttributeInfo(Assembler assembler, String string, String string2) { + this.this(); + this.asm = assembler; + this.name = assembler.cp.utf(string); + int n = assembler.cp.utf(string2); + this.info = new byte[2]; + this.info[0] = (byte)(n >>> 8 & 0xFF); + this.info[1] = (byte)(n & 0xFF); + } + + public AttributeInfo(Assembler assembler, int n) { + this.this(); + this.asm = assembler; + this.name = n; + } + + public AttributeInfo(Assembler assembler, String string) { + this.this(); + this.asm = assembler; + this.name = assembler.cp.utf(string); + } +} + diff --git a/modules/cfr_output/com/tridium/asm/Buffer.java b/modules/cfr_output/com/tridium/asm/Buffer.java new file mode 100644 index 0000000..76080ce --- /dev/null +++ b/modules/cfr_output/com/tridium/asm/Buffer.java @@ -0,0 +1,148 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nre.util.ByteArrayUtil + */ +package com.tridium.asm; + +import javax.baja.nre.util.ByteArrayUtil; + +public class Buffer { + public byte[] bytes; + public int count; + + public final int u1(int n) { + int n2 = this.count; + if (this.count + 1 >= this.bytes.length) { + this.grow(this.count + 1); + } + this.bytes[this.count++] = (byte)(n & 0xFF); + return n2; + } + + public final int u2(int n) { + int n2 = this.count; + if (this.count + 2 >= this.bytes.length) { + this.grow(this.count + 2); + } + this.bytes[this.count++] = (byte)(n >>> 8 & 0xFF); + this.bytes[this.count++] = (byte)(n & 0xFF); + return n2; + } + + public final int u4(int n) { + int n2 = this.count; + if (this.count + 4 >= this.bytes.length) { + this.grow(this.count + 4); + } + this.bytes[this.count++] = (byte)(n >>> 24 & 0xFF); + this.bytes[this.count++] = (byte)(n >>> 16 & 0xFF); + this.bytes[this.count++] = (byte)(n >>> 8 & 0xFF); + this.bytes[this.count++] = (byte)(n & 0xFF); + return n2; + } + + public final int u8(long l) { + int n = this.count; + if (this.count + 8 >= this.bytes.length) { + this.grow(this.count + 8); + } + this.bytes[this.count++] = (byte)(l >>> 56 & 0xFFL); + this.bytes[this.count++] = (byte)(l >>> 48 & 0xFFL); + this.bytes[this.count++] = (byte)(l >>> 40 & 0xFFL); + this.bytes[this.count++] = (byte)(l >>> 32 & 0xFFL); + this.bytes[this.count++] = (byte)(l >>> 24 & 0xFFL); + this.bytes[this.count++] = (byte)(l >>> 16 & 0xFFL); + this.bytes[this.count++] = (byte)(l >>> 8 & 0xFFL); + this.bytes[this.count++] = (byte)(l & 0xFFL); + return n; + } + + public final void utf(String string) { + char c; + int n = string.length(); + int n2 = 0; + int n3 = 0; + while (n3 < n) { + c = string.charAt(n3); + n2 = c >= '\u0001' && c <= '\u007f' ? ++n2 : (c > '\u07ff' ? (n2 += 3) : (n2 += 2)); + ++n3; + } + if (n2 > (int)-1) { + throw new RuntimeException("Illegal UTF exception"); + } + if (this.count + n2 + 2 >= this.bytes.length) { + this.grow(this.count + n2 + 2); + } + this.bytes[this.count++] = (byte)(n2 >>> 8 & 0xFF); + this.bytes[this.count++] = (byte)(n2 & 0xFF); + n3 = 0; + while (n3 < n) { + c = string.charAt(n3); + if (c >= '\u0001' && c <= '\u007f') { + this.bytes[this.count++] = (byte)c; + } else if (c > '\u07ff') { + this.bytes[this.count++] = (byte)(0xE0 | c >> 12 & 0xF); + this.bytes[this.count++] = (byte)(0x80 | c >> 6 & 0x3F); + this.bytes[this.count++] = (byte)(0x80 | c & 0x3F); + } else { + this.bytes[this.count++] = (byte)(0xC0 | c >> 6 & 0x1F); + this.bytes[this.count++] = (byte)(0x80 | c & 0x3F); + } + ++n3; + } + } + + public void append(Buffer buffer) { + if (this.count + buffer.count >= this.bytes.length) { + this.grow(this.count + buffer.count); + } + System.arraycopy(buffer.bytes, 0, this.bytes, this.count, buffer.count); + this.count += buffer.count; + } + + public void append(byte[] byArray) { + if (this.count + byArray.length >= this.bytes.length) { + this.grow(this.count + byArray.length); + } + System.arraycopy(byArray, 0, this.bytes, this.count, byArray.length); + this.count += byArray.length; + } + + public final void u1(int n, int n2) { + this.bytes[n] = (byte)(n2 & 0xFF); + } + + public final void u2(int n, int n2) { + this.bytes[n] = (byte)(n2 >>> 8 & 0xFF); + this.bytes[n + 1] = (byte)(n2 & 0xFF); + } + + public final void u4(int n, int n2) { + this.bytes[n] = (byte)(n2 >>> 24 & 0xFF); + this.bytes[n + 1] = (byte)(n2 >>> 16 & 0xFF); + this.bytes[n + 2] = (byte)(n2 >>> 8 & 0xFF); + this.bytes[n + 3] = (byte)(n2 & 0xFF); + } + + public void dump() { + ByteArrayUtil.hexDump((byte[])this.bytes, (int)0, (int)this.count); + } + + private final void grow(int n) { + int n2 = Math.max(n, this.bytes.length * 2); + byte[] byArray = new byte[n2]; + System.arraycopy(this.bytes, 0, byArray, 0, this.bytes.length); + this.bytes = byArray; + } + + public Buffer() { + this(1024); + } + + public Buffer(int n) { + this.bytes = new byte[n]; + } +} + diff --git a/modules/cfr_output/com/tridium/asm/Code.java b/modules/cfr_output/com/tridium/asm/Code.java new file mode 100644 index 0000000..0d9ad46 --- /dev/null +++ b/modules/cfr_output/com/tridium/asm/Code.java @@ -0,0 +1,144 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.asm; + +import com.tridium.asm.Assembler; +import com.tridium.asm.AttributeInfo; +import com.tridium.asm.Buffer; +import com.tridium.asm.ConstantPool; +import com.tridium.asm.Jvm; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class Code +extends AttributeInfo { + public final ConstantPool cp; + public int maxStack; + public int maxLocals; + public Buffer code; + + public int add(int n) { + if (Jvm.OPCODE_ARGS[n] != 0) { + throw new IllegalStateException("Opcode requires arguments: " + n); + } + return this.code.u1(n); + } + + public int add(int n, int n2) { + int n3 = this.code.count; + if (n == 18) { + if (n2 < 255) { + this.code.u1(18); + this.code.u1(n2); + } else { + this.code.u1(19); + this.code.u2(n2); + } + return n3; + } + byte by = Jvm.OPCODE_ARGS[n]; + this.code.u1(n); + if (by == 1) { + this.code.u1(n2); + } else if (by == 2) { + this.code.u2(n2); + } else { + throw new IllegalStateException("Opcode does not take u1 or u2 args: " + n); + } + return n3; + } + + public int addIntConst(int n) { + switch (n) { + case -1: { + return this.add(2); + } + case 0: { + return this.add(3); + } + case 1: { + return this.add(4); + } + case 2: { + return this.add(5); + } + case 3: { + return this.add(6); + } + case 4: { + return this.add(7); + } + case 5: { + return this.add(8); + } + } + if (-128 <= n && n <= 127) { + return this.add(16, n); + } + if (Short.MIN_VALUE <= n && n <= Short.MAX_VALUE) { + return this.add(17, n); + } + return this.add(18, this.cp.integer(n)); + } + + public int addPad(int n) { + int n2 = this.code.u1(n); + int n3 = 3 - n2 % 4; + int n4 = 0; + while (n4 < n3) { + this.code.u1(0); + ++n4; + } + return n2; + } + + public int invoke(Method method) { + int n = this.cp.method(method); + int n2 = method.getModifiers(); + if (Modifier.isInterface(n2)) { + return this.invokeInterface(n, method.getParameterTypes().length + 1); + } + if (Modifier.isStatic(n2)) { + return this.add(184, n); + } + return this.add(182, n); + } + + public int invokeInterface(int n, int n2) { + int n3 = this.code.count; + this.code.u1(185); + this.code.u2(n); + this.code.u1(n2); + this.code.u1(0); + return n3; + } + + void compile(Buffer buffer) { + int n = 8 + this.code.count + 4; + buffer.u2(this.name); + buffer.u4(n); + buffer.u2(this.maxStack); + buffer.u2(this.maxLocals); + buffer.u4(this.code.count); + buffer.append(this.code); + buffer.u2(0); + buffer.u2(0); + } + + private final /* synthetic */ void this() { + this.maxStack = 10; + this.maxLocals = 10; + this.code = new Buffer(512); + } + + public Code(Assembler assembler) { + super(assembler, "Code"); + this.this(); + this.cp = assembler.cp; + } +} + diff --git a/modules/cfr_output/com/tridium/asm/ConstantPool.java b/modules/cfr_output/com/tridium/asm/ConstantPool.java new file mode 100644 index 0000000..a350cd9 --- /dev/null +++ b/modules/cfr_output/com/tridium/asm/ConstantPool.java @@ -0,0 +1,244 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nre.util.IntHashMap + */ +package com.tridium.asm; + +import com.tridium.asm.Buffer; +import com.tridium.asm.FieldInfo; +import com.tridium.asm.Jvm; +import java.lang.reflect.Method; +import java.util.Hashtable; +import javax.baja.nre.util.IntHashMap; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class ConstantPool { + Buffer buf; + int count; + Hashtable utfTable; + Hashtable classTable; + Hashtable stringTable; + Hashtable floatTable; + Hashtable doubleTable; + Hashtable longTable; + IntHashMap integerTable; + IntHashMap ntTable; + IntHashMap fieldTable; + IntHashMap methodTable; + IntHashMap ifaceTable; + + public int utf(String string) { + Integer n = (Integer)this.utfTable.get(string); + if (n != null) { + return n; + } + this.buf.u1(1); + this.buf.utf(string); + ++this.count; + this.utfTable.put(string, new Integer(this.count)); + return this.count; + } + + public int cls(String string) { + Integer n = (Integer)this.classTable.get(string); + if (n != null) { + return n; + } + int n2 = this.utf(string); + this.buf.u1(7); + this.buf.u2(n2); + ++this.count; + this.classTable.put(string, new Integer(this.count)); + return this.count; + } + + public int string(String string) { + Integer n = (Integer)this.stringTable.get(string); + if (n != null) { + return n; + } + int n2 = this.utf(string); + this.buf.u1(8); + this.buf.u2(n2); + ++this.count; + this.stringTable.put(string, new Integer(this.count)); + return this.count; + } + + public int integer(int n) { + Integer n2 = (Integer)this.integerTable.get(n); + if (n2 != null) { + return n2; + } + this.buf.u1(3); + this.buf.u4(n); + ++this.count; + this.integerTable.put(n, (Object)new Integer(this.count)); + return this.count; + } + + public int floatConst(float f) { + Float f2 = new Float(f); + Integer n = (Integer)this.floatTable.get(f2); + if (n != null) { + return n; + } + this.buf.u1(4); + this.buf.u4(Float.floatToIntBits(f)); + ++this.count; + this.floatTable.put(f2, new Integer(this.count)); + return this.count; + } + + public int doubleConst(double d) { + Double d2 = new Double(d); + Integer n = (Integer)this.doubleTable.get(d2); + if (n != null) { + return n; + } + this.buf.u1(6); + this.buf.u8(Double.doubleToLongBits(d)); + ++this.count; + this.doubleTable.put(d2, new Integer(this.count)); + ++this.count; + return this.count - 1; + } + + public int longConst(long l) { + Long l2 = new Long(l); + Integer n = (Integer)this.longTable.get(l2); + if (n != null) { + return n; + } + this.buf.u1(5); + this.buf.u8(l); + ++this.count; + this.longTable.put(l2, new Integer(this.count)); + ++this.count; + return this.count - 1; + } + + public int nt(int n, int n2) { + int n3 = n << 16 | n2; + Integer n4 = (Integer)this.fieldTable.get(n3); + if (n4 != null) { + return n4; + } + this.buf.u1(12); + this.buf.u2(n); + this.buf.u2(n2); + ++this.count; + this.ntTable.put(n3, (Object)new Integer(this.count)); + return this.count; + } + + public int field(int n, int n2) { + int n3 = n << 16 | n2; + Integer n4 = (Integer)this.fieldTable.get(n3); + if (n4 != null) { + return n4; + } + this.buf.u1(9); + this.buf.u2(n); + this.buf.u2(n2); + ++this.count; + this.fieldTable.put(n3, (Object)new Integer(this.count)); + return this.count; + } + + public int method(int n, int n2) { + int n3 = n << 16 | n2; + Integer n4 = (Integer)this.methodTable.get(n3); + if (n4 != null) { + return n4; + } + this.buf.u1(10); + this.buf.u2(n); + this.buf.u2(n2); + ++this.count; + this.methodTable.put(n3, (Object)new Integer(this.count)); + return this.count; + } + + public int iface(int n, int n2) { + int n3 = n << 16 | n2; + Integer n4 = (Integer)this.ifaceTable.get(n3); + if (n4 != null) { + return n4; + } + this.buf.u1(11); + this.buf.u2(n); + this.buf.u2(n2); + ++this.count; + this.ifaceTable.put(n3, (Object)new Integer(this.count)); + return this.count; + } + + public int cls(Class clazz) { + return this.cls(clazz.getName().replace('.', '/')); + } + + public int nt(int n, String string) { + return this.nt(n, this.utf(string)); + } + + public int nt(String string, String string2) { + return this.nt(this.utf(string), this.utf(string2)); + } + + public int method(int n, int n2, String string) { + return this.method(n, this.nt(n2, string)); + } + + public int method(int n, String string, String string2) { + return this.method(n, this.nt(string, string2)); + } + + public int method(Method method) { + int n = this.cls(method.getDeclaringClass()); + int n2 = this.utf(method.getName()); + int n3 = this.utf(Jvm.methodDescriptor(method.getParameterTypes(), method.getReturnType())); + return this.method(n, this.nt(n2, n3)); + } + + public int iface(int n, String string, String string2) { + return this.iface(n, this.nt(string, string2)); + } + + public int field(int n, int n2, String string) { + return this.field(n, this.nt(n2, string)); + } + + public int field(int n, String string, String string2) { + return this.field(n, this.nt(string, string2)); + } + + public int field(FieldInfo fieldInfo) { + return this.field(fieldInfo.asm.thisClass, this.nt(fieldInfo.name, fieldInfo.type)); + } + + private final /* synthetic */ void this() { + this.buf = new Buffer(); + this.count = 0; + this.utfTable = new Hashtable(); + this.classTable = new Hashtable(); + this.stringTable = new Hashtable(); + this.floatTable = new Hashtable(); + this.doubleTable = new Hashtable(); + this.longTable = new Hashtable(); + this.integerTable = new IntHashMap(); + this.ntTable = new IntHashMap(); + this.fieldTable = new IntHashMap(); + this.methodTable = new IntHashMap(); + this.ifaceTable = new IntHashMap(); + } + + public ConstantPool() { + this.this(); + } +} + diff --git a/modules/cfr_output/com/tridium/asm/FieldInfo.java b/modules/cfr_output/com/tridium/asm/FieldInfo.java new file mode 100644 index 0000000..a7c4d1f --- /dev/null +++ b/modules/cfr_output/com/tridium/asm/FieldInfo.java @@ -0,0 +1,19 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.asm; + +import com.tridium.asm.Assembler; +import com.tridium.asm.MemberInfo; + +public class FieldInfo +extends MemberInfo { + public FieldInfo(Assembler assembler, int n, int n2, int n3) { + super(assembler, n, n2, n3); + } + + public FieldInfo(Assembler assembler, String string, String string2, int n) { + super(assembler, string, string2, n); + } +} + diff --git a/modules/cfr_output/com/tridium/asm/Jvm.java b/modules/cfr_output/com/tridium/asm/Jvm.java new file mode 100644 index 0000000..730a326 --- /dev/null +++ b/modules/cfr_output/com/tridium/asm/Jvm.java @@ -0,0 +1,175 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.asm; + +import com.tridium.asm.OpCodes; + +public final class Jvm +implements OpCodes { + public static final int MAGIC = -889275714; + public static final int MINOR_VERSION = 3; + public static final int MAJOR_VERSION = 45; + public static final int ACC_PUBLIC = 1; + public static final int ACC_PRIVATE = 2; + public static final int ACC_PROTECTED = 4; + public static final int ACC_STATIC = 8; + public static final int ACC_FINAL = 16; + public static final int ACC_SUPER = 32; + public static final int ACC_SYNCHRONIZED = 32; + public static final int ACC_VOLATILE = 64; + public static final int ACC_TRANSIENT = 128; + public static final int ACC_NATIVE = 256; + public static final int ACC_INTERFACE = 512; + public static final int ACC_ABSTRACT = 1024; + public static final int CONSTANT_Utf8 = 1; + public static final int CONSTANT_Integer = 3; + public static final int CONSTANT_Float = 4; + public static final int CONSTANT_Long = 5; + public static final int CONSTANT_Double = 6; + public static final int CONSTANT_Class = 7; + public static final int CONSTANT_String = 8; + public static final int CONSTANT_Fieldref = 9; + public static final int CONSTANT_Methodref = 10; + public static final int CONSTANT_InterfaceMethodref = 11; + public static final int CONSTANT_NameAndType = 12; + public static final String ATTR_SOURCE_FILE = "SourceFile"; + public static final String ATTR_CONSTANT_VALUE = "ConstantValue"; + public static final String ATTR_CODE = "Code"; + public static final String ATTR_EXCEPTIONS = "Exceptions"; + public static final String ATTR_LINE_NUMBER_TABLE = "LineNumberTable"; + public static final String ATTR_DEPRECATED = "Deprecated"; + public static final String ATTR_INNER_CLASSES = "InnerClasses"; + public static final String ATTR_SYNTHETIC = "Synthetic"; + public static final String ATTR_LOCAL_VARIABLE_TABLE = "LocalVariableTable"; + public static final String ATTR_ENCLOSING_METHOD = "EnclosingMethod"; + public static final String ATTR_SIGNATURE = "Signature"; + public static final String ATTR_RUNTIME_VISIBLE_ANNOTATIONS = "RuntimeVisibleAnnotations"; + public static final int T_BOOLEAN = 4; + public static final int T_CHAR = 5; + public static final int T_FLOAT = 6; + public static final int T_DOUBLE = 7; + public static final int T_BYTE = 8; + public static final int T_SHORT = 9; + public static final int T_INT = 10; + public static final int T_LONG = 11; + public static final byte NONE = 0; + public static final byte U1 = 1; + public static final byte U2 = 2; + public static final byte B2 = 3; + public static final byte B4 = 4; + public static final byte SPECIAL = 5; + public static final byte[] OPCODE_ARGS; + public static final String[] OPCODE_STRINGS; + + public static final String fieldDescriptor(Class clazz) { + if (clazz.isPrimitive()) { + if (clazz.equals(Byte.TYPE)) { + return "B"; + } + if (clazz.equals(Character.TYPE)) { + return "C"; + } + if (clazz.equals(Double.TYPE)) { + return "D"; + } + if (clazz.equals(Float.TYPE)) { + return "F"; + } + if (clazz.equals(Integer.TYPE)) { + return "I"; + } + if (clazz.equals(Long.TYPE)) { + return "J"; + } + if (clazz.equals(Short.TYPE)) { + return "S"; + } + if (clazz.equals(Boolean.TYPE)) { + return "Z"; + } + if (clazz.equals(Void.TYPE)) { + return "V"; + } + throw new IllegalStateException(); + } + if (clazz.isArray()) { + return "[" + Jvm.fieldDescriptor(clazz.getComponentType()); + } + return "L" + clazz.getName().replace('.', '/') + ';'; + } + + public static final String methodDescriptor(Class[] classArray, Class clazz) { + StringBuffer stringBuffer = new StringBuffer("("); + if (classArray != null) { + int n = 0; + while (n < classArray.length) { + stringBuffer.append(Jvm.fieldDescriptor(classArray[n])); + ++n; + } + } + stringBuffer.append(")").append(Jvm.fieldDescriptor(clazz)); + return stringBuffer.toString(); + } + + static { + byte[] byArray = new byte[202]; + byArray[16] = 5; + byArray[17] = 5; + byArray[18] = 1; + byArray[19] = 2; + byArray[20] = 2; + byArray[21] = 1; + byArray[22] = 1; + byArray[23] = 1; + byArray[24] = 1; + byArray[25] = 1; + byArray[54] = 1; + byArray[55] = 1; + byArray[56] = 1; + byArray[57] = 1; + byArray[58] = 1; + byArray[132] = 5; + byArray[153] = 3; + byArray[154] = 3; + byArray[155] = 3; + byArray[156] = 3; + byArray[157] = 3; + byArray[158] = 3; + byArray[159] = 3; + byArray[160] = 3; + byArray[161] = 3; + byArray[162] = 3; + byArray[163] = 3; + byArray[164] = 3; + byArray[165] = 3; + byArray[166] = 3; + byArray[167] = 3; + byArray[168] = 3; + byArray[169] = 1; + byArray[170] = 5; + byArray[171] = 5; + byArray[178] = 2; + byArray[179] = 2; + byArray[180] = 2; + byArray[181] = 2; + byArray[182] = 2; + byArray[183] = 2; + byArray[184] = 2; + byArray[185] = 5; + byArray[187] = 2; + byArray[188] = 1; + byArray[189] = 2; + byArray[192] = 2; + byArray[193] = 2; + byArray[196] = 5; + byArray[197] = 5; + byArray[198] = 3; + byArray[199] = 3; + byArray[200] = 4; + byArray[201] = 4; + OPCODE_ARGS = byArray; + OPCODE_STRINGS = new String[]{"NOP", "ACONST_NULL", "ICONST_M1", "ICONST_0", "ICONST_1", "ICONST_2", "ICONST_3", "ICONST_4", "ICONST_5", "LCONST_0", "LCONST_1", "FCONST_0", "FCONST_1", "FCONST_2", "DCONST_0", "DCONST_1", "BIPUSH", "SIPUSH", "LDC", "LDC_W", "LDC2_W", "ILOAD", "LLOAD", "FLOAD", "DLOAD", "ALOAD", "ILOAD_0", "ILOAD_1", "ILOAD_2", "ILOAD_3", "LLOAD_0", "LLOAD_1", "LLOAD_2", "LLOAD_3", "FLOAD_0", "FLOAD_1", "FLOAD_2", "FLOAD_3", "DLOAD_0", "DLOAD_1", "DLOAD_2", "DLOAD_3", "ALOAD_0", "ALOAD_1", "ALOAD_2", "ALOAD_3", "IALOAD", "LALOAD", "FALOAD", "DALOAD", "AALOAD", "BALOAD", "CALOAD", "SALOAD", "ISTORE", "LSTORE", "FSTORE", "DSTORE", "ASTORE", "ISTORE_0", "ISTORE_1", "ISTORE_2", "ISTORE_3", "LSTORE_0", "LSTORE_1", "LSTORE_2", "LSTORE_3", "FSTORE_0", "FSTORE_1", "FSTORE_2", "FSTORE_3", "DSTORE_0", "DSTORE_1", "DSTORE_2", "DSTORE_3", "ASTORE_0", "ASTORE_1", "ASTORE_2", "ASTORE_3", "IASTORE", "LASTORE", "FASTORE", "DASTORE", "AASTORE", "BASTORE", "CASTORE", "SASTORE", "POP", "POP2", "DUP", "DUP_X1", "DUP_X2", "DUP2", "DUP2_X1", "DUP2_X2", "SWAP", "IADD", "LADD", "FADD", "DADD", "ISUB", "LSUB", "FSUB", "DSUB", "IMUL", "LMUL", "FMUL", "DMUL", "IDIV", "LDIV", "FDIV", "DDIV", "IREM", "LREM", "FREM", "DREM", "INEG", "LNEG", "FNEG", "DNEG", "ISHL", "LSHL", "ISHR", "LSHR", "IUSHR", "LUSHR", "IAND", "LAND", "IOR", "LOR", "IXOR", "LXOR", "IINC", "I2L", "I2F", "I2D", "L2I", "L2F", "L2D", "F2I", "F2L", "F2D", "D2I", "D2L", "D2F", "I2B", "I2C", "I2S", "LCMP", "FCMPL", "FCMPG", "DCMPL", "DCMPG", "IFEQ", "IFNE", "IFLT", "IFGE", "IFGT", "IFLE", "IF_ICMPEQ", "IF_ICMPNE", "IF_ICMPLT", "IF_ICMPGE", "IF_ICMPGT", "IF_ICMPLE", "IF_ACMPEQ", "IF_ACMPNU", "GOTO", "JSR", "RET", "TABLESWITCH", "LOOKUPSWITCH", "IRETURN", "LRETURN", "FRETURN", "DRETURN", "ARETURN", "RETURN", "GETSTATIC", "PUTSTATIC", "GETFIELD", "PUTFIELD", "INVOKEVIRTUAL", "INVOKESPECIAL", "INVOKESTATIC", "INVOKEINTERFACE=", "XXX_UNUSED_XXX", "NEW", "NEWARRAY", "ANEWARRAY", "ARRAYLENGTH", "ATHROW", "CHECKCAST", "INSTANCEOF", "MONITORENTER", "MONITOREXIT", "WIDE", "MULTIANEWARRAY", "IFNULL", "IFNONNULL", "GOTO_W", "JSR_W"}; + } +} + diff --git a/modules/cfr_output/com/tridium/asm/MemberInfo.java b/modules/cfr_output/com/tridium/asm/MemberInfo.java new file mode 100644 index 0000000..0d26be6 --- /dev/null +++ b/modules/cfr_output/com/tridium/asm/MemberInfo.java @@ -0,0 +1,68 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.asm; + +import com.tridium.asm.Assembler; +import com.tridium.asm.AttributeInfo; +import com.tridium.asm.Buffer; +import com.tridium.asm.ConstantPool; +import java.util.ArrayList; + +public abstract class MemberInfo { + public final Assembler asm; + public final ConstantPool cp; + public final int name; + public final int type; + public final int accessFlags; + ArrayList attributes; + + public void addAttribute(AttributeInfo attributeInfo) { + if (this.attributes == null) { + this.attributes = new ArrayList(5); + } + this.attributes.add(attributeInfo); + } + + void compile(Buffer buffer) { + int n = 0; + if (this.attributes != null) { + n = this.attributes.size(); + } + int n2 = n; + buffer.u2(this.accessFlags); + buffer.u2(this.name); + buffer.u2(this.type); + buffer.u2(n2); + int n3 = 0; + while (n3 < n2) { + ((AttributeInfo)this.attributes.get(n3)).compile(buffer); + ++n3; + } + } + + MemberInfo(Assembler assembler, int n, int n2, int n3) { + this.asm = assembler; + this.cp = assembler.cp; + this.name = n; + this.type = n2; + this.accessFlags = n3; + } + + MemberInfo(Assembler assembler, String string, String string2, int n) { + this.asm = assembler; + this.cp = assembler.cp; + this.name = this.cp.utf(string); + this.type = this.cp.utf(string2); + this.accessFlags = n; + } + + MemberInfo(Assembler assembler, int n, String string, int n2) { + this.asm = assembler; + this.cp = assembler.cp; + this.name = n; + this.type = this.cp.utf(string); + this.accessFlags = n2; + } +} + diff --git a/modules/cfr_output/com/tridium/asm/MethodInfo.java b/modules/cfr_output/com/tridium/asm/MethodInfo.java new file mode 100644 index 0000000..a4fdd86 --- /dev/null +++ b/modules/cfr_output/com/tridium/asm/MethodInfo.java @@ -0,0 +1,35 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.asm; + +import com.tridium.asm.Assembler; +import com.tridium.asm.Code; +import com.tridium.asm.MemberInfo; + +public class MethodInfo +extends MemberInfo { + public MethodInfo(Assembler assembler, int n, int n2, int n3) { + super(assembler, n, n2, n3); + } + + public MethodInfo(Assembler assembler, String string, String string2, int n) { + super(assembler, string, string2, n); + } + + public MethodInfo(Assembler assembler, int n, int n2, int n3, Code code) { + super(assembler, n, n2, n3); + this.addAttribute(code); + } + + public MethodInfo(Assembler assembler, int n, String string, int n2, Code code) { + super(assembler, n, string, n2); + this.addAttribute(code); + } + + public MethodInfo(Assembler assembler, String string, String string2, int n, Code code) { + super(assembler, string, string2, n); + this.addAttribute(code); + } +} + diff --git a/modules/cfr_output/com/tridium/asm/OpCodes.java b/modules/cfr_output/com/tridium/asm/OpCodes.java new file mode 100644 index 0000000..7947b8b --- /dev/null +++ b/modules/cfr_output/com/tridium/asm/OpCodes.java @@ -0,0 +1,210 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.asm; + +public interface OpCodes { + public static final int NOP = 0; + public static final int ACONST_NULL = 1; + public static final int ICONST_M1 = 2; + public static final int ICONST_0 = 3; + public static final int ICONST_1 = 4; + public static final int ICONST_2 = 5; + public static final int ICONST_3 = 6; + public static final int ICONST_4 = 7; + public static final int ICONST_5 = 8; + public static final int LCONST_0 = 9; + public static final int LCONST_1 = 10; + public static final int FCONST_0 = 11; + public static final int FCONST_1 = 12; + public static final int FCONST_2 = 13; + public static final int DCONST_0 = 14; + public static final int DCONST_1 = 15; + public static final int BIPUSH = 16; + public static final int SIPUSH = 17; + public static final int LDC = 18; + public static final int LDC_W = 19; + public static final int LDC2_W = 20; + public static final int ILOAD = 21; + public static final int LLOAD = 22; + public static final int FLOAD = 23; + public static final int DLOAD = 24; + public static final int ALOAD = 25; + public static final int ILOAD_0 = 26; + public static final int ILOAD_1 = 27; + public static final int ILOAD_2 = 28; + public static final int ILOAD_3 = 29; + public static final int LLOAD_0 = 30; + public static final int LLOAD_1 = 31; + public static final int LLOAD_2 = 32; + public static final int LLOAD_3 = 33; + public static final int FLOAD_0 = 34; + public static final int FLOAD_1 = 35; + public static final int FLOAD_2 = 36; + public static final int FLOAD_3 = 37; + public static final int DLOAD_0 = 38; + public static final int DLOAD_1 = 39; + public static final int DLOAD_2 = 40; + public static final int DLOAD_3 = 41; + public static final int ALOAD_0 = 42; + public static final int ALOAD_1 = 43; + public static final int ALOAD_2 = 44; + public static final int ALOAD_3 = 45; + public static final int IALOAD = 46; + public static final int LALOAD = 47; + public static final int FALOAD = 48; + public static final int DALOAD = 49; + public static final int AALOAD = 50; + public static final int BALOAD = 51; + public static final int CALOAD = 52; + public static final int SALOAD = 53; + public static final int ISTORE = 54; + public static final int LSTORE = 55; + public static final int FSTORE = 56; + public static final int DSTORE = 57; + public static final int ASTORE = 58; + public static final int ISTORE_0 = 59; + public static final int ISTORE_1 = 60; + public static final int ISTORE_2 = 61; + public static final int ISTORE_3 = 62; + public static final int LSTORE_0 = 63; + public static final int LSTORE_1 = 64; + public static final int LSTORE_2 = 65; + public static final int LSTORE_3 = 66; + public static final int FSTORE_0 = 67; + public static final int FSTORE_1 = 68; + public static final int FSTORE_2 = 69; + public static final int FSTORE_3 = 70; + public static final int DSTORE_0 = 71; + public static final int DSTORE_1 = 72; + public static final int DSTORE_2 = 73; + public static final int DSTORE_3 = 74; + public static final int ASTORE_0 = 75; + public static final int ASTORE_1 = 76; + public static final int ASTORE_2 = 77; + public static final int ASTORE_3 = 78; + public static final int IASTORE = 79; + public static final int LASTORE = 80; + public static final int FASTORE = 81; + public static final int DASTORE = 82; + public static final int AASTORE = 83; + public static final int BASTORE = 84; + public static final int CASTORE = 85; + public static final int SASTORE = 86; + public static final int POP = 87; + public static final int POP2 = 88; + public static final int DUP = 89; + public static final int DUP_X1 = 90; + public static final int DUP_X2 = 91; + public static final int DUP2 = 92; + public static final int DUP2_X1 = 93; + public static final int DUP2_X2 = 94; + public static final int SWAP = 95; + public static final int IADD = 96; + public static final int LADD = 97; + public static final int FADD = 98; + public static final int DADD = 99; + public static final int ISUB = 100; + public static final int LSUB = 101; + public static final int FSUB = 102; + public static final int DSUB = 103; + public static final int IMUL = 104; + public static final int LMUL = 105; + public static final int FMUL = 106; + public static final int DMUL = 107; + public static final int IDIV = 108; + public static final int LDIV = 109; + public static final int FDIV = 110; + public static final int DDIV = 111; + public static final int IREM = 112; + public static final int LREM = 113; + public static final int FREM = 114; + public static final int DREM = 115; + public static final int INEG = 116; + public static final int LNEG = 117; + public static final int FNEG = 118; + public static final int DNEG = 119; + public static final int ISHL = 120; + public static final int LSHL = 121; + public static final int ISHR = 122; + public static final int LSHR = 123; + public static final int IUSHR = 124; + public static final int LUSHR = 125; + public static final int IAND = 126; + public static final int LAND = 127; + public static final int IOR = 128; + public static final int LOR = 129; + public static final int IXOR = 130; + public static final int LXOR = 131; + public static final int IINC = 132; + public static final int I2L = 133; + public static final int I2F = 134; + public static final int I2D = 135; + public static final int L2I = 136; + public static final int L2F = 137; + public static final int L2D = 138; + public static final int F2I = 139; + public static final int F2L = 140; + public static final int F2D = 141; + public static final int D2I = 142; + public static final int D2L = 143; + public static final int D2F = 144; + public static final int I2B = 145; + public static final int I2C = 146; + public static final int I2S = 147; + public static final int LCMP = 148; + public static final int FCMPL = 149; + public static final int FCMPG = 150; + public static final int DCMPL = 151; + public static final int DCMPG = 152; + public static final int IFEQ = 153; + public static final int IFNE = 154; + public static final int IFLT = 155; + public static final int IFGE = 156; + public static final int IFGT = 157; + public static final int IFLE = 158; + public static final int IF_ICMPEQ = 159; + public static final int IF_ICMPNE = 160; + public static final int IF_ICMPLT = 161; + public static final int IF_ICMPGE = 162; + public static final int IF_ICMPGT = 163; + public static final int IF_ICMPLE = 164; + public static final int IF_ACMPEQ = 165; + public static final int IF_ACMPNU = 166; + public static final int GOTO = 167; + public static final int JSR = 168; + public static final int RET = 169; + public static final int TABLESWITCH = 170; + public static final int LOOKUPSWITCH = 171; + public static final int IRETURN = 172; + public static final int LRETURN = 173; + public static final int FRETURN = 174; + public static final int DRETURN = 175; + public static final int ARETURN = 176; + public static final int RETURN = 177; + public static final int GETSTATIC = 178; + public static final int PUTSTATIC = 179; + public static final int GETFIELD = 180; + public static final int PUTFIELD = 181; + public static final int INVOKEVIRTUAL = 182; + public static final int INVOKESPECIAL = 183; + public static final int INVOKESTATIC = 184; + public static final int INVOKEINTERFACE = 185; + public static final int XXX_UNUSED_XXX = 186; + public static final int NEW = 187; + public static final int NEWARRAY = 188; + public static final int ANEWARRAY = 189; + public static final int ARRAYLENGTH = 190; + public static final int ATHROW = 191; + public static final int CHECKCAST = 192; + public static final int INSTANCEOF = 193; + public static final int MONITORENTER = 194; + public static final int MONITOREXIT = 195; + public static final int WIDE = 196; + public static final int MULTIANEWARRAY = 197; + public static final int IFNULL = 198; + public static final int IFNONNULL = 199; + public static final int GOTO_W = 200; + public static final int JSR_W = 201; +} + diff --git a/modules/cfr_output/com/tridium/collection/BCellScheme.java b/modules/cfr_output/com/tridium/collection/BCellScheme.java new file mode 100644 index 0000000..e4c6cef --- /dev/null +++ b/modules/cfr_output/com/tridium/collection/BCellScheme.java @@ -0,0 +1,106 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nre.util.TextUtil + */ +package com.tridium.collection; + +import javax.baja.collection.BICollection; +import javax.baja.collection.BITable; +import javax.baja.collection.Column; +import javax.baja.collection.ColumnList; +import javax.baja.naming.BOrdScheme; +import javax.baja.naming.OrdQuery; +import javax.baja.naming.OrdTarget; +import javax.baja.naming.SyntaxException; +import javax.baja.naming.UnresolvedException; +import javax.baja.nre.util.TextUtil; +import javax.baja.sys.BObject; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BCellScheme +extends BOrdScheme { + public static final BCellScheme INSTANCE = new BCellScheme(); + public static final Type TYPE; + private static final Lexicon lex; + private static final String KEY_PARAM_EXCEPTION = "cellscheme.incorrectparameters"; + private static final String KEY_UNDEFINED_COL = "cellscheme.undefinedcolumn"; + private static final String CELL_SCHEME = "cell"; + static /* synthetic */ Class class$com$tridium$collection$BCellScheme; + + public Type getType() { + return TYPE; + } + + public OrdTarget resolve(OrdTarget ordTarget, OrdQuery ordQuery) throws SyntaxException, UnresolvedException { + String string = ordQuery.getBody(); + BObject bObject = ordTarget.get(); + if (bObject instanceof BICollection) { + String[] stringArray = TextUtil.split((String)string, (char)','); + if (stringArray.length == 2) { + BICollection bICollection = (BICollection)((Object)bObject); + BITable bITable = bICollection.toTable(); + ColumnList columnList = bITable.getColumns(); + Column column = null; + int n = 0; + try { + int n2 = Integer.parseInt(stringArray[0]); + column = columnList.get(n2); + } + catch (NumberFormatException numberFormatException) { + column = columnList.get(stringArray[0]); + } + try { + n = Integer.parseInt(stringArray[1]); + } + catch (NumberFormatException numberFormatException) { + n = bITable.size() - 1; + } + if (column == null) { + throw new UnresolvedException(lex.getText(KEY_UNDEFINED_COL, new Object[]{stringArray[0]})); + } + bObject = bITable.get(n, column); + } else { + throw new SyntaxException(lex.getText(KEY_PARAM_EXCEPTION, new Object[]{string})); + } + } + return new OrdTarget(ordTarget, bObject); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BCellScheme() { + super(CELL_SCHEME); + } + + static { + Class clazz = class$com$tridium$collection$BCellScheme; + if (clazz == null) { + clazz = class$com$tridium$collection$BCellScheme = BCellScheme.class("[Lcom.tridium.collection.BCellScheme;", false); + } + TYPE = Sys.loadType(clazz); + Class clazz2 = class$com$tridium$collection$BCellScheme; + if (clazz2 == null) { + clazz2 = class$com$tridium$collection$BCellScheme = BCellScheme.class("[Lcom.tridium.collection.BCellScheme;", false); + } + lex = Lexicon.make(clazz2); + } +} + diff --git a/modules/cfr_output/com/tridium/collection/BEmptyTable.java b/modules/cfr_output/com/tridium/collection/BEmptyTable.java new file mode 100644 index 0000000..38ca2f6 --- /dev/null +++ b/modules/cfr_output/com/tridium/collection/BEmptyTable.java @@ -0,0 +1,193 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.collection; + +import java.lang.reflect.Array; +import javax.baja.collection.BICollection; +import javax.baja.collection.BIList; +import javax.baja.collection.BITable; +import javax.baja.collection.Column; +import javax.baja.collection.ColumnList; +import javax.baja.sys.BFacets; +import javax.baja.sys.BObject; +import javax.baja.sys.Context; +import javax.baja.sys.Cursor; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.IFilter; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BEmptyTable +extends BObject +implements BITable { + private static final BObject[] EMPTY_ARRAY = new BObject[0]; + private static final ColumnList NO_COLUMNS = new EmptyColumnList(); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$collection$BEmptyTable; + + public Cursor cursor() { + return new EmptyCursor(null); + } + + public BICollection filter(IFilter iFilter) { + return this; + } + + public BIList toList() { + return this; + } + + public BObject get(int n) { + return null; + } + + public int size() { + return 0; + } + + public BObject[] list() { + return EMPTY_ARRAY; + } + + public BObject[] list(BObject[] bObjectArray) { + if (bObjectArray == null) { + return EMPTY_ARRAY; + } + if (bObjectArray.length == 0) { + return bObjectArray; + } + return (BObject[])Array.newInstance(bObjectArray.getClass().getComponentType(), 0); + } + + public BITable toTable() { + return this; + } + + public ColumnList getColumns() { + return NO_COLUMNS; + } + + public BObject get(int n, Column column) { + return null; + } + + public String getString(int n, Column column) { + return null; + } + + public float getFloat(int n, Column column) { + return 0.0f; + } + + public double getDouble(int n, Column column) { + return 0.0; + } + + public int getInt(int n, Column column) { + return 0; + } + + public long getLong(int n, Column column) { + return 0L; + } + + public boolean getBoolean(int n, Column column) { + return false; + } + + public int getFlags(int n, Column column) { + return 0; + } + + public BFacets getFacets(int n, Column column) { + return BFacets.NULL; + } + + public BFacets getTableFacets() { + return BFacets.NULL; + } + + public Type getType() { + return TYPE; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$collection$BEmptyTable; + if (clazz == null) { + clazz = class$com$tridium$collection$BEmptyTable = BEmptyTable.class("[Lcom.tridium.collection.BEmptyTable;", false); + } + TYPE = Sys.loadType(clazz); + } + + private static class EmptyCursor + implements Cursor { + Context context; + + public Context getContext() { + return this.context; + } + + public boolean next() { + return false; + } + + public boolean nextComponent() { + return false; + } + + public boolean next(Class clazz) { + return false; + } + + public BObject get() { + return null; + } + + public EmptyCursor(Context context) { + this.context = context; + } + } + + private static class EmptyColumnList + implements ColumnList { + public int size() { + return 0; + } + + public Column get(int n) { + return null; + } + + public Column get(String string) { + return null; + } + + public int indexOf(String string) { + return -1; + } + + public Column[] list() { + return new Column[0]; + } + + private EmptyColumnList() { + } + } +} + diff --git a/modules/cfr_output/com/tridium/collection/BGenericTable.java b/modules/cfr_output/com/tridium/collection/BGenericTable.java new file mode 100644 index 0000000..1c2768c --- /dev/null +++ b/modules/cfr_output/com/tridium/collection/BGenericTable.java @@ -0,0 +1,204 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.collection; + +import com.tridium.collection.BISortableTable; +import com.tridium.collection.GenericColumn; +import com.tridium.collection.GenericColumnList; +import com.tridium.collection.GenericCursor; +import com.tridium.util.ClassUtil; +import java.util.Comparator; +import javax.baja.collection.BICollection; +import javax.baja.collection.BIList; +import javax.baja.collection.BITable; +import javax.baja.collection.Column; +import javax.baja.collection.ColumnList; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BNumber; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Cursor; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.Array; +import javax.baja.util.IFilter; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BGenericTable +extends BObject +implements BISortableTable { + public static final Type TYPE; + BComponent[] comps; + private GenericColumnList columns; + static /* synthetic */ Class class$com$tridium$collection$BGenericTable; + + public Type getType() { + return TYPE; + } + + public Cursor cursor() { + return new GenericCursor(this); + } + + public BICollection filter(IFilter iFilter) { + return new BGenericTable((BComponent[])new Array(this.comps).filter(iFilter).trim(), this.columns); + } + + public BIList toList() { + return this; + } + + public int size() { + return this.comps.length; + } + + public BObject get(int n) { + return this.comps[n]; + } + + public BObject[] list() { + BObject[] bObjectArray = new BComponent[this.comps.length]; + System.arraycopy(this.comps, 0, bObjectArray, 0, this.comps.length); + return bObjectArray; + } + + public BObject[] list(BObject[] bObjectArray) { + return this.list(); + } + + public BITable toTable() { + return this; + } + + public ColumnList getColumns() { + return this.columns; + } + + public BObject get(int n, Column column) { + return this.comps[n].get(column.getName()); + } + + public String getString(int n, Column column) { + return this.comps[n].get(column.getName()).toString(); + } + + public double getDouble(int n, Column column) { + return this.number(n, column).getDouble(); + } + + public float getFloat(int n, Column column) { + return this.number(n, column).getFloat(); + } + + public int getInt(int n, Column column) { + return this.number(n, column).getInt(); + } + + public long getLong(int n, Column column) { + return this.number(n, column).getLong(); + } + + public boolean getBoolean(int n, Column column) { + return this.bool(n, column).getBoolean(); + } + + public int getFlags(int n, Column column) { + return 0; + } + + public BFacets getFacets(int n, Column column) { + return BFacets.NULL; + } + + public BFacets getTableFacets() { + return BFacets.NULL; + } + + public BITable sort(Column column, boolean bl) { + if (this.comps.length == 0) { + return this; + } + return new BGenericTable((BComponent[])new Array(this.comps).sort(new GenericTableComparator(column, bl)).trim(), this.columns); + } + + private final BNumber number(int n, Column column) { + return (BNumber)this.comps[n].get(column.getName()); + } + + private final BBoolean bool(int n, Column column) { + return (BBoolean)this.comps[n].get(column.getName()); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BGenericTable(BComponent[] bComponentArray, GenericColumnList genericColumnList) { + if (bComponentArray.length > 0 && !ClassUtil.sameClass(bComponentArray)) { + throw new IllegalArgumentException(); + } + this.comps = bComponentArray; + this.columns = genericColumnList; + } + + public BGenericTable(BComponent[] bComponentArray) { + if (bComponentArray.length > 0 && !ClassUtil.sameClass(bComponentArray)) { + throw new IllegalArgumentException(); + } + this.comps = bComponentArray; + this.columns = new GenericColumnList(bComponentArray); + } + + public BGenericTable() { + this.comps = new BComponent[0]; + this.columns = new GenericColumnList(new GenericColumn[0]); + } + + static { + Class clazz = class$com$tridium$collection$BGenericTable; + if (clazz == null) { + clazz = class$com$tridium$collection$BGenericTable = BGenericTable.class("[Lcom.tridium.collection.BGenericTable;", false); + } + TYPE = Sys.loadType(clazz); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class GenericTableComparator + implements Comparator { + private Column col; + private boolean ascending; + + public int compare(Object object, Object object2) { + BComponent bComponent = (BComponent)object; + BComponent bComponent2 = (BComponent)object2; + BValue bValue = bComponent.get(this.col.getName()); + BValue bValue2 = bComponent2.get(this.col.getName()); + if (bValue instanceof Comparable) { + return this.ascending ? ((Comparable)((Object)bValue)).compareTo(bValue2) : -((Comparable)((Object)bValue)).compareTo(bValue2); + } + return this.ascending ? bValue.toString().compareTo(bValue2.toString()) : -bValue.toString().compareTo(bValue2.toString()); + } + + private GenericTableComparator(Column column, boolean bl) { + this.col = column; + this.ascending = bl; + } + } +} + diff --git a/modules/cfr_output/com/tridium/collection/BISortableTable.java b/modules/cfr_output/com/tridium/collection/BISortableTable.java new file mode 100644 index 0000000..e7d5f2f --- /dev/null +++ b/modules/cfr_output/com/tridium/collection/BISortableTable.java @@ -0,0 +1,25 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.collection; + +import javax.baja.collection.BITable; +import javax.baja.collection.Column; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public interface BISortableTable +extends BITable { + public static final Type TYPE; + + public BITable sort(Column var1, boolean var2); + + static { + Class clazz = 1.class$com$tridium$collection$BISortableTable; + if (clazz == null) { + clazz = 1.class$com$tridium$collection$BISortableTable = 1.class("[Lcom.tridium.collection.BISortableTable;", false); + } + TYPE = Sys.loadType(clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/collection/GenericColumn.java b/modules/cfr_output/com/tridium/collection/GenericColumn.java new file mode 100644 index 0000000..b3cde89 --- /dev/null +++ b/modules/cfr_output/com/tridium/collection/GenericColumn.java @@ -0,0 +1,51 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.collection; + +import javax.baja.collection.Column; +import javax.baja.sys.BFacets; +import javax.baja.sys.Context; +import javax.baja.sys.Type; + +public class GenericColumn +implements Column { + private String name; + private String dispName; + private Type type; + private int flags; + private BFacets facets; + + public String getDisplayName(Context context) { + return this.dispName; + } + + public String getName() { + return this.name; + } + + public Type getType() { + return this.type; + } + + public int getFlags() { + return this.flags; + } + + public BFacets getFacets() { + return this.facets; + } + + public GenericColumn(String string, String string2, Type type) { + this(string, string2, type, 0, BFacets.NULL); + } + + public GenericColumn(String string, String string2, Type type, int n, BFacets bFacets) { + this.name = string; + this.dispName = string2; + this.type = type; + this.flags = n; + this.facets = bFacets; + } +} + diff --git a/modules/cfr_output/com/tridium/collection/GenericColumnList.java b/modules/cfr_output/com/tridium/collection/GenericColumnList.java new file mode 100644 index 0000000..1b22b49 --- /dev/null +++ b/modules/cfr_output/com/tridium/collection/GenericColumnList.java @@ -0,0 +1,99 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.collection; + +import com.tridium.collection.GenericColumn; +import com.tridium.util.ClassUtil; +import java.util.HashMap; +import java.util.Map; +import javax.baja.collection.Column; +import javax.baja.collection.ColumnList; +import javax.baja.sys.BComponent; +import javax.baja.sys.Property; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class GenericColumnList +implements ColumnList { + private GenericColumn[] columns; + private Map getHash; + private Map idxHash; + + public int size() { + return this.columns.length; + } + + public Column get(int n) { + return this.columns[n]; + } + + public Column get(String string) { + return (Column)this.getHash.get(string); + } + + public int indexOf(String string) { + Integer n = (Integer)this.idxHash.get(string); + return n == null ? -1 : n; + } + + public Column[] list() { + return this.columns; + } + + private final /* synthetic */ void this() { + this.getHash = new HashMap(); + this.idxHash = new HashMap(); + } + + public GenericColumnList(GenericColumn[] genericColumnArray) { + this.this(); + this.columns = genericColumnArray; + int n = 0; + while (n < genericColumnArray.length) { + String string = genericColumnArray[n].getName(); + this.getHash.put(string, genericColumnArray[n]); + this.idxHash.put(string, new Integer(n)); + ++n; + } + } + + public GenericColumnList(BComponent[] bComponentArray) { + this.this(); + if (bComponentArray.length > 0 && !ClassUtil.sameClass(bComponentArray)) { + throw new IllegalArgumentException(); + } + if (bComponentArray.length == 0) { + this.columns = new GenericColumn[0]; + } else { + BComponent bComponent = bComponentArray[0]; + Property[] propertyArray = bComponent.getPropertiesArray(); + int n = propertyArray.length; + String[] stringArray = new String[n]; + String[] stringArray2 = new String[n]; + int n2 = 0; + while (n2 < n) { + stringArray[n2] = propertyArray[n2].getName(); + stringArray2[n2] = bComponent.getDisplayName(propertyArray[n2], null); + ++n2; + } + Type[] typeArray = new Type[n]; + int n3 = 0; + while (n3 < n) { + typeArray[n3] = propertyArray[n3].getType(); + ++n3; + } + this.columns = new GenericColumn[n]; + n3 = 0; + while (n3 < n) { + this.columns[n3] = new GenericColumn(stringArray[n3], stringArray2[n3], typeArray[n3]); + this.getHash.put(stringArray[n3], this.columns[n3]); + this.idxHash.put(stringArray[n3], new Integer(n3)); + ++n3; + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/collection/GenericCursor.java b/modules/cfr_output/com/tridium/collection/GenericCursor.java new file mode 100644 index 0000000..e656a07 --- /dev/null +++ b/modules/cfr_output/com/tridium/collection/GenericCursor.java @@ -0,0 +1,116 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.collection; + +import com.tridium.collection.BGenericTable; +import javax.baja.collection.BITable; +import javax.baja.collection.Column; +import javax.baja.collection.TableCursor; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BNumber; +import javax.baja.sys.BObject; +import javax.baja.sys.Context; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +class GenericCursor +implements TableCursor { + private BGenericTable table; + private BComponent[] comps; + private int idx; + + public Context getContext() { + return null; + } + + public boolean next() { + boolean bl = false; + if (++this.idx < this.comps.length) { + bl = true; + } + return bl; + } + + public boolean nextComponent() { + return this.next(); + } + + public BObject get() { + return this.comps[this.idx]; + } + + public boolean next(Class clazz) { + ++this.idx; + while (this.idx < this.comps.length && !clazz.isAssignableFrom(this.comps[this.idx].getClass())) { + ++this.idx; + } + boolean bl = false; + if (this.idx < this.comps.length) { + bl = true; + } + return bl; + } + + public BITable getTable() { + return this.table; + } + + public BObject get(Column column) { + return this.comps[this.idx].get(column.getName()); + } + + public String getString(Column column) { + return this.comps[this.idx].get(column.getName()).toString(); + } + + public double getDouble(Column column) { + return this.number(this.idx, column).getDouble(); + } + + public float getFloat(Column column) { + return this.number(this.idx, column).getFloat(); + } + + public int getInt(Column column) { + return this.number(this.idx, column).getInt(); + } + + public long getLong(Column column) { + return this.number(this.idx, column).getLong(); + } + + public boolean getBoolean(Column column) { + return this.bool(this.idx, column).getBoolean(); + } + + public int getFlags(Column column) { + return 0; + } + + public BFacets getFacets(Column column) { + return BFacets.NULL; + } + + private final BNumber number(int n, Column column) { + return (BNumber)this.comps[n].get(column.getName()); + } + + private final BBoolean bool(int n, Column column) { + return (BBoolean)this.comps[n].get(column.getName()); + } + + private final /* synthetic */ void this() { + this.idx = -1; + } + + GenericCursor(BGenericTable bGenericTable) { + this.this(); + this.table = bGenericTable; + this.comps = bGenericTable.comps; + } +} + diff --git a/modules/cfr_output/com/tridium/data/BDataRow.java b/modules/cfr_output/com/tridium/data/BDataRow.java new file mode 100644 index 0000000..e5ce9cd --- /dev/null +++ b/modules/cfr_output/com/tridium/data/BDataRow.java @@ -0,0 +1,97 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.data; + +import javax.baja.collection.Column; +import javax.baja.data.BIDataTable; +import javax.baja.sys.BFacets; +import javax.baja.sys.BObject; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BDataRow +extends BObject { + public static final Type TYPE; + private BIDataTable table; + private int row; + static /* synthetic */ Class class$com$tridium$data$BDataRow; + + public Type getType() { + return TYPE; + } + + public BDataRow copy() { + return new BDataRow(this.table, this.row); + } + + public void setRow(int n) { + this.row = n; + } + + public BObject get(Column column) { + return this.table.get(this.row, column); + } + + public String getString(Column column) { + return this.table.getString(this.row, column); + } + + public double getDouble(Column column) { + return this.table.getDouble(this.row, column); + } + + public float getFloat(Column column) { + return this.table.getFloat(this.row, column); + } + + public int getInt(Column column) { + return this.table.getInt(this.row, column); + } + + public long getLong(Column column) { + return this.table.getLong(this.row, column); + } + + public boolean getBoolean(Column column) { + return this.table.getBoolean(this.row, column); + } + + public int getFlags(Column column) { + return this.table.getFlags(this.row, column); + } + + public BFacets getFacets(Column column) { + return this.table.getFacets(this.row, column); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BDataRow(BIDataTable bIDataTable, int n) { + this.table = bIDataTable; + this.row = n; + } + + static { + Class clazz = class$com$tridium$data$BDataRow; + if (clazz == null) { + clazz = class$com$tridium$data$BDataRow = BDataRow.class("[Lcom.tridium.data.BDataRow;", false); + } + TYPE = Sys.loadType(clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/data/BDataTable.java b/modules/cfr_output/com/tridium/data/BDataTable.java new file mode 100644 index 0000000..dca3af5 --- /dev/null +++ b/modules/cfr_output/com/tridium/data/BDataTable.java @@ -0,0 +1,539 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.data; + +import com.tridium.collection.BISortableTable; +import com.tridium.data.BDataRow; +import com.tridium.data.DataColumnList; +import com.tridium.data.DataTableCursor; +import javax.baja.collection.BICollection; +import javax.baja.collection.BIList; +import javax.baja.collection.BITable; +import javax.baja.collection.Column; +import javax.baja.collection.ColumnList; +import javax.baja.data.BIDataTable; +import javax.baja.data.BIDataValue; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BDouble; +import javax.baja.sys.BFacets; +import javax.baja.sys.BFloat; +import javax.baja.sys.BInteger; +import javax.baja.sys.BLong; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.Context; +import javax.baja.sys.Cursor; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.IFilter; +import javax.baja.util.SortUtil; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public final class BDataTable +extends BObject +implements BIDataTable, +BISortableTable { + public static final Type TYPE; + private BFacets tableFacets; + private DataColumnList columnList; + private int rowCount; + private int bufferSize; + private int colIndex; + private BDataRow rowObject; + static /* synthetic */ Class class$com$tridium$data$BDataTable; + + public final BICollection filter(IFilter iFilter) { + return this; + } + + public final BITable sort(Column column, boolean bl) { + BDataTable bDataTable = new BDataTable(); + Object[] objectArray = (BDataRow[])this.list(); + Object[] objectArray2 = new BObject[this.size()]; + int n = 0; + while (n < this.size()) { + objectArray2[n] = (BObject)((Object)((DataColumn)column).get(n)); + ++n; + } + SortUtil.sort(objectArray2, objectArray, bl); + bDataTable.setTableFacets(this.getTableFacets()); + n = 0; + while (n < this.columnList.size()) { + Column column2 = this.columnList.get(n); + bDataTable.addColumn(column2.getName(), column2.getDisplayName(null), column2.getType(), column2.getFlags(), column2.getFacets()); + ++n; + } + bDataTable.startRows(this.size()); + n = 0; + while (n < this.size()) { + bDataTable.startRow(); + int n2 = 0; + while (n2 < this.columnList.size()) { + Column column3 = this.columnList.get(n2); + BFacets bFacets = ((BDataRow)objectArray[n]).getFacets(column3); + char c = column3.getType().getDataTypeSymbol(); + switch (c) { + case 'd': { + double d = ((BDataRow)objectArray[n]).getDouble(column3); + bDataTable.set(d, bFacets); + break; + } + case 'f': { + float f = ((BDataRow)objectArray[n]).getFloat(column3); + bDataTable.set(f, bFacets); + break; + } + case 'b': { + boolean bl2 = ((BDataRow)objectArray[n]).getBoolean(column3); + bDataTable.set(bl2, bFacets); + break; + } + case 's': { + String string = ((BDataRow)objectArray[n]).getString(column3); + bDataTable.set(string, bFacets); + break; + } + case 'i': { + int n3 = ((BDataRow)objectArray[n]).getInt(column3); + bDataTable.set(n3, bFacets); + break; + } + case 'l': { + long l = ((BDataRow)objectArray[n]).getLong(column3); + bDataTable.set(l, bFacets); + break; + } + default: { + BIDataValue bIDataValue = (BIDataValue)((Object)((BDataRow)objectArray[n]).get(column3)); + bDataTable.set(bIDataValue, bFacets); + } + } + ++n2; + } + bDataTable.endRow(); + ++n; + } + bDataTable.endRows(); + return bDataTable; + } + + public final Cursor cursor() { + return new DataTableCursor(this); + } + + public final BIList toList() { + return this; + } + + public final BObject[] list() { + int n = this.size(); + BObject[] bObjectArray = new BDataRow[n]; + int n2 = 0; + while (n2 < n) { + bObjectArray[n2] = ((BDataRow)this.get(n2)).copy(); + ++n2; + } + return bObjectArray; + } + + public final BObject[] list(BObject[] bObjectArray) { + return this.list(); + } + + public final BObject get(int n) { + if (this.rowObject == null) { + this.rowObject = new BDataRow(this, n); + } else { + this.rowObject.setRow(n); + } + return this.rowObject; + } + + public final BITable toTable() { + return this; + } + + public final ColumnList getColumns() { + return this.columnList; + } + + public final BObject get(int n, Column column) { + return (BObject)((Object)((DataColumn)column).get(n)); + } + + public final String getString(int n, Column column) { + return ((DataColumn)column).getString(n); + } + + public final double getDouble(int n, Column column) { + return ((DataColumn)column).getDouble(n); + } + + public final float getFloat(int n, Column column) { + return ((DataColumn)column).getFloat(n); + } + + public final int getInt(int n, Column column) { + return ((DataColumn)column).getInt(n); + } + + public final long getLong(int n, Column column) { + return ((DataColumn)column).getLong(n); + } + + public final boolean getBoolean(int n, Column column) { + return ((DataColumn)column).getBoolean(n); + } + + public final int getFlags(int n, Column column) { + return 0; + } + + public final BFacets getFacets(int n, Column column) { + return BFacets.NULL; + } + + public final BFacets getTableFacets() { + return this.tableFacets; + } + + public final int size() { + return this.rowCount; + } + + public final void setTableFacets(BFacets bFacets) { + this.tableFacets = bFacets; + } + + public final void addColumn(String string, Type type, int n, BFacets bFacets) { + this.addColumn(string, string, type, n, bFacets); + } + + public final void addColumn(String string, String string2, Type type, int n, BFacets bFacets) { + if (this.columnList == null) { + this.columnList = new DataColumnList(); + } + this.columnList.addColumn(new DataColumn(string, string2, type, n, bFacets)); + } + + public final void startRows() { + this.startRows(32); + } + + public final void startRows(int n) { + this.bufferSize = n; + int n2 = this.columnList.size(); + int n3 = 0; + while (n3 < n2) { + ((DataColumn)this.columnList.get(n3)).init(this.bufferSize); + ++n3; + } + this.rowCount = 0; + } + + public final void startRow() { + if (this.rowCount != 0 && this.colIndex < this.columnList.size()) { + throw new IllegalStateException("Cannot start a new row until the previous row is complete."); + } + this.colIndex = 0; + if (this.rowCount == this.bufferSize) { + int n = this.bufferSize * 2; + int n2 = this.columnList.size(); + int n3 = 0; + while (n3 < n2) { + ((DataColumn)this.columnList.get(n3)).grow(n, this.rowCount); + ++n3; + } + this.bufferSize = n; + } + } + + public final void endRow() { + if (this.colIndex != this.columnList.size()) { + throw new IllegalStateException("Cannot end a row until all columns have been set."); + } + ++this.rowCount; + } + + public final void endRows() { + if ((this.rowCount != 0 || this.colIndex != 0) && this.colIndex != this.columnList.size()) { + throw new IllegalStateException("Cannot end rows until the last column is complete."); + } + } + + public final void set(double d, BFacets bFacets) { + ((DataColumn)this.columnList.get(this.colIndex++)).set(this.rowCount, d, bFacets); + } + + public final void set(float f, BFacets bFacets) { + ((DataColumn)this.columnList.get(this.colIndex++)).set(this.rowCount, f, bFacets); + } + + public final void set(boolean bl, BFacets bFacets) { + ((DataColumn)this.columnList.get(this.colIndex++)).set(this.rowCount, bl, bFacets); + } + + public final void set(String string, BFacets bFacets) { + ((DataColumn)this.columnList.get(this.colIndex++)).set(this.rowCount, string, bFacets); + } + + public final void set(int n, BFacets bFacets) { + ((DataColumn)this.columnList.get(this.colIndex++)).set(this.rowCount, n, bFacets); + } + + public final void set(long l, BFacets bFacets) { + ((DataColumn)this.columnList.get(this.colIndex++)).set(this.rowCount, l, bFacets); + } + + public final void set(BIDataValue bIDataValue, BFacets bFacets) { + ((DataColumn)this.columnList.get(this.colIndex++)).set(this.rowCount, bIDataValue, bFacets); + } + + public final Type getType() { + return TYPE; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.rowCount = 0; + this.colIndex = 0; + } + + public BDataTable() { + this.this(); + } + + static { + Class clazz = class$com$tridium$data$BDataTable; + if (clazz == null) { + clazz = class$com$tridium$data$BDataTable = BDataTable.class("[Lcom.tridium.data.BDataTable;", false); + } + TYPE = Sys.loadType(clazz); + } + + static class DataColumn + implements Column { + public String name; + public String displayName; + public Type type; + public int flags; + public BFacets facets; + public Object rowData; + + public String getName() { + return this.name; + } + + public String getDisplayName(Context context) { + return this.displayName; + } + + public Type getType() { + return this.type; + } + + public int getFlags() { + return this.flags; + } + + public BFacets getFacets() { + return this.facets; + } + + public void init(int n) { + char c = this.type.getDataTypeSymbol(); + switch (c) { + case 'd': { + this.rowData = new double[n]; + break; + } + case 'f': { + this.rowData = new float[n]; + break; + } + case 'b': { + this.rowData = new boolean[n]; + break; + } + case 's': { + this.rowData = new String[n]; + break; + } + case 'i': { + this.rowData = new int[n]; + break; + } + case 'l': { + this.rowData = new long[n]; + break; + } + default: { + this.rowData = new BIDataValue[n]; + } + } + } + + public void grow(int n, int n2) { + char c = this.type.getDataTypeSymbol(); + Object[] objectArray = null; + switch (c) { + case 'd': { + objectArray = new double[n]; + break; + } + case 'f': { + objectArray = new float[n]; + break; + } + case 'b': { + objectArray = new boolean[n]; + break; + } + case 's': { + objectArray = new String[n]; + break; + } + case 'i': { + objectArray = new int[n]; + break; + } + case 'l': { + objectArray = new long[n]; + break; + } + default: { + objectArray = new BIDataValue[n]; + } + } + System.arraycopy(this.rowData, 0, objectArray, 0, n2); + this.rowData = objectArray; + } + + public BIDataValue get(int n) { + char c = this.type.getDataTypeSymbol(); + if (c == 'd') { + return BDouble.make(this.getDouble(n)); + } + if (c == 'f') { + return BFloat.make(this.getFloat(n)); + } + if (c == 'b') { + return BBoolean.make(this.getBoolean(n)); + } + if (c == 's') { + return BString.make(this.getString(n)); + } + if (c == 'i') { + return BInteger.make(this.getInt(n)); + } + if (c == 'l') { + return BLong.make(this.getLong(n)); + } + return ((BIDataValue[])this.rowData)[n]; + } + + public double getDouble(int n) { + return ((double[])this.rowData)[n]; + } + + public float getFloat(int n) { + return ((float[])this.rowData)[n]; + } + + public boolean getBoolean(int n) { + return ((boolean[])this.rowData)[n]; + } + + public int getInt(int n) { + return ((int[])this.rowData)[n]; + } + + public long getLong(int n) { + return ((long[])this.rowData)[n]; + } + + public String getString(int n) { + return ((String[])this.rowData)[n]; + } + + public void set(int n, double d, BFacets bFacets) { + try { + ((double[])this.rowData)[n] = d; + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + public void set(int n, float f, BFacets bFacets) { + try { + ((float[])this.rowData)[n] = f; + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + public void set(int n, boolean bl, BFacets bFacets) { + ((boolean[])this.rowData)[n] = bl; + } + + public void set(int n, String string, BFacets bFacets) { + ((String[])this.rowData)[n] = string; + } + + public void set(int n, int n2, BFacets bFacets) { + ((int[])this.rowData)[n] = n2; + } + + public void set(int n, long l, BFacets bFacets) { + ((long[])this.rowData)[n] = l; + } + + public void set(int n, BIDataValue bIDataValue, BFacets bFacets) { + char c = this.type.getDataTypeSymbol(); + if (c == 's') { + this.set(n, ((BString)bIDataValue).toString(), bFacets); + } else if (c == 'b') { + this.set(n, ((BBoolean)bIDataValue).getBoolean(), bFacets); + } else if (c == 'i') { + this.set(n, ((BInteger)bIDataValue).getInt(), bFacets); + } else if (c == 'l') { + this.set(n, ((BLong)bIDataValue).getLong(), bFacets); + } else if (c == 'f') { + this.set(n, ((BFloat)bIDataValue).getFloat(), bFacets); + } else if (c == 'd') { + this.set(n, ((BDouble)bIDataValue).getDouble(), bFacets); + } else { + ((BIDataValue[])this.rowData)[n] = bIDataValue; + } + } + + public DataColumn(String string, String string2, Type type, int n, BFacets bFacets) { + this.name = string; + this.displayName = string2; + this.type = type; + this.flags = n; + this.facets = bFacets; + if (this.type == null) { + this.type = BString.TYPE; + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/data/BToDataTable.java b/modules/cfr_output/com/tridium/data/BToDataTable.java new file mode 100644 index 0000000..9d76075 --- /dev/null +++ b/modules/cfr_output/com/tridium/data/BToDataTable.java @@ -0,0 +1,486 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.data; + +import com.tridium.data.BDataRow; +import com.tridium.data.DataColumnList; +import javax.baja.collection.BICollection; +import javax.baja.collection.BIList; +import javax.baja.collection.BITable; +import javax.baja.collection.Column; +import javax.baja.collection.ColumnList; +import javax.baja.collection.TableCursor; +import javax.baja.data.BIDataTable; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BDouble; +import javax.baja.sys.BFacets; +import javax.baja.sys.BFloat; +import javax.baja.sys.BInteger; +import javax.baja.sys.BLong; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Cursor; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.IFilter; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BToDataTable +extends BObject +implements BIDataTable { + public static final Type TYPE; + private BITable innerTable; + private DataColumnList columns; + private BDataRow rowObject; + static /* synthetic */ Class class$com$tridium$data$BToDataTable; + + public static BIDataTable toDataTable(BITable bITable) { + if (bITable instanceof BIDataTable) { + return (BIDataTable)bITable; + } + return new BToDataTable(bITable); + } + + public BICollection filter(IFilter iFilter) { + return new BToDataTable(this.innerTable.filter(iFilter).toTable()); + } + + public Cursor cursor() { + return new ToDataCursor(this, (TableCursor)this.innerTable.cursor()); + } + + public BIList toList() { + return this; + } + + public int size() { + return this.innerTable.size(); + } + + public BObject get(int n) { + if (this.rowObject == null) { + this.rowObject = new BDataRow(this, n); + } else { + this.rowObject.setRow(n); + } + return this.rowObject; + } + + public BObject[] list() { + int n = this.size(); + BObject[] bObjectArray = new BDataRow[n]; + int n2 = 0; + while (n2 < n) { + bObjectArray[n2] = ((BDataRow)this.get(n2)).copy(); + ++n2; + } + return bObjectArray; + } + + public BObject[] list(BObject[] bObjectArray) { + return this.list(); + } + + public BITable toTable() { + return this; + } + + public BFacets getTableFacets() { + return this.innerTable.getTableFacets(); + } + + public ColumnList getColumns() { + return this.columns; + } + + public BObject get(int n, Column column) { + return ((TranslatedColumn)column).get(n, this.innerTable); + } + + public String getString(int n, Column column) { + return ((TranslatedColumn)column).getString(n, this.innerTable); + } + + public double getDouble(int n, Column column) { + return ((TranslatedColumn)column).getDouble(n, this.innerTable); + } + + public float getFloat(int n, Column column) { + return ((TranslatedColumn)column).getFloat(n, this.innerTable); + } + + public boolean getBoolean(int n, Column column) { + return ((TranslatedColumn)column).getBoolean(n, this.innerTable); + } + + public int getInt(int n, Column column) { + return ((TranslatedColumn)column).getInt(n, this.innerTable); + } + + public long getLong(int n, Column column) { + return ((TranslatedColumn)column).getLong(n, this.innerTable); + } + + public int getFlags(int n, Column column) { + return ((TranslatedColumn)column).getFlags(n, this.innerTable); + } + + public BFacets getFacets(int n, Column column) { + return ((TranslatedColumn)column).getFacets(n, this.innerTable); + } + + public Column translateColumn(Column column) { + Type type = column.getType(); + if (type.isDataType()) { + return new IsDataColumn(column); + } + return new ToDataColumn(column); + } + + public Type getType() { + return TYPE; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BToDataTable(BITable bITable) { + this.innerTable = bITable; + ColumnList columnList = this.innerTable.getColumns(); + int n = columnList.size(); + this.columns = new DataColumnList(); + int n2 = 0; + while (n2 < n) { + this.columns.addColumn(this.translateColumn(columnList.get(n2))); + ++n2; + } + } + + static { + Class clazz = class$com$tridium$data$BToDataTable; + if (clazz == null) { + clazz = class$com$tridium$data$BToDataTable = BToDataTable.class("[Lcom.tridium.data.BToDataTable;", false); + } + TYPE = Sys.loadType(clazz); + } + + static class ToDataCursor + implements TableCursor { + BITable table; + TableCursor inner; + + public Context getContext() { + return this.inner.getContext(); + } + + public boolean next() { + return this.inner.next(); + } + + public boolean nextComponent() { + return this.inner.nextComponent(); + } + + public boolean next(Class clazz) { + return this.inner.next(clazz); + } + + public BObject get() { + return this.inner.get(); + } + + public BITable getTable() { + return this.table; + } + + public BObject get(Column column) { + return ((TranslatedColumn)column).get(this.inner); + } + + public String getString(Column column) { + return ((TranslatedColumn)column).getString(this.inner); + } + + public double getDouble(Column column) { + return ((TranslatedColumn)column).getDouble(this.inner); + } + + public float getFloat(Column column) { + return ((TranslatedColumn)column).getFloat(this.inner); + } + + public int getInt(Column column) { + return ((TranslatedColumn)column).getInt(this.inner); + } + + public long getLong(Column column) { + return ((TranslatedColumn)column).getLong(this.inner); + } + + public boolean getBoolean(Column column) { + return ((TranslatedColumn)column).getBoolean(this.inner); + } + + public int getFlags(Column column) { + return ((TranslatedColumn)column).getFlags(this.inner); + } + + public BFacets getFacets(Column column) { + return ((TranslatedColumn)column).getFacets(this.inner); + } + + public ToDataCursor(BITable bITable, TableCursor tableCursor) { + this.table = bITable; + this.inner = tableCursor; + } + } + + static abstract class TranslatedColumn + implements Column { + protected Column innerColumn; + + public String getName() { + return this.innerColumn.getName(); + } + + public String getDisplayName(Context context) { + return this.innerColumn.getDisplayName(context); + } + + public int getFlags() { + return this.innerColumn.getFlags(); + } + + public BFacets getFacets() { + return this.innerColumn.getFacets(); + } + + public abstract BObject get(int var1, BITable var2); + + public abstract String getString(int var1, BITable var2); + + public abstract double getDouble(int var1, BITable var2); + + public abstract float getFloat(int var1, BITable var2); + + public abstract boolean getBoolean(int var1, BITable var2); + + public abstract int getInt(int var1, BITable var2); + + public abstract long getLong(int var1, BITable var2); + + public int getFlags(int n, BITable bITable) { + return bITable.getFlags(n, this.innerColumn); + } + + public BFacets getFacets(int n, BITable bITable) { + return bITable.getFacets(n, this.innerColumn); + } + + public abstract BObject get(TableCursor var1); + + public abstract String getString(TableCursor var1); + + public abstract double getDouble(TableCursor var1); + + public abstract float getFloat(TableCursor var1); + + public abstract boolean getBoolean(TableCursor var1); + + public abstract int getInt(TableCursor var1); + + public abstract long getLong(TableCursor var1); + + public int getFlags(TableCursor tableCursor) { + return tableCursor.getFlags(this.innerColumn); + } + + public BFacets getFacets(TableCursor tableCursor) { + return tableCursor.getFacets(this.innerColumn); + } + + public String toString() { + return this.getName() + ':' + this.getType().getTypeSpec(); + } + + public TranslatedColumn(Column column) { + this.innerColumn = column; + } + } + + static class IsDataColumn + extends TranslatedColumn { + public Type getType() { + return this.innerColumn.getType(); + } + + public BObject get(int n, BITable bITable) { + return bITable.get(n, this.innerColumn); + } + + public String getString(int n, BITable bITable) { + return bITable.getString(n, this.innerColumn); + } + + public double getDouble(int n, BITable bITable) { + return bITable.getDouble(n, this.innerColumn); + } + + public float getFloat(int n, BITable bITable) { + return bITable.getFloat(n, this.innerColumn); + } + + public boolean getBoolean(int n, BITable bITable) { + return bITable.getBoolean(n, this.innerColumn); + } + + public int getInt(int n, BITable bITable) { + return bITable.getInt(n, this.innerColumn); + } + + public long getLong(int n, BITable bITable) { + return bITable.getLong(n, this.innerColumn); + } + + public BObject get(TableCursor tableCursor) { + return tableCursor.get(this.innerColumn); + } + + public String getString(TableCursor tableCursor) { + return tableCursor.getString(this.innerColumn); + } + + public double getDouble(TableCursor tableCursor) { + return tableCursor.getDouble(this.innerColumn); + } + + public float getFloat(TableCursor tableCursor) { + return tableCursor.getFloat(this.innerColumn); + } + + public boolean getBoolean(TableCursor tableCursor) { + return tableCursor.getBoolean(this.innerColumn); + } + + public int getInt(TableCursor tableCursor) { + return tableCursor.getInt(this.innerColumn); + } + + public long getLong(TableCursor tableCursor) { + return tableCursor.getLong(this.innerColumn); + } + + public IsDataColumn(Column column) { + super(column); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + static class ToDataColumn + extends TranslatedColumn { + private Type columnType; + private BFacets facets; + + public Type getType() { + return this.columnType; + } + + public BFacets getFacets() { + if (this.facets == null) { + return super.getFacets(); + } + return this.facets; + } + + public BObject get(int n, BITable bITable) { + return (BObject)((Object)bITable.get(n, this.innerColumn).toDataValue()); + } + + public String getString(int n, BITable bITable) { + return bITable.get(n, this.innerColumn).toDataValue().toString(); + } + + public double getDouble(int n, BITable bITable) { + return ((BDouble)bITable.get(n, this.innerColumn).toDataValue()).getDouble(); + } + + public float getFloat(int n, BITable bITable) { + return ((BFloat)bITable.get(n, this.innerColumn).toDataValue()).getFloat(); + } + + public boolean getBoolean(int n, BITable bITable) { + return ((BBoolean)bITable.get(n, this.innerColumn).toDataValue()).getBoolean(); + } + + public int getInt(int n, BITable bITable) { + return ((BInteger)bITable.get(n, this.innerColumn).toDataValue()).getInt(); + } + + public long getLong(int n, BITable bITable) { + return ((BLong)bITable.get(n, this.innerColumn).toDataValue()).getLong(); + } + + public BObject get(TableCursor tableCursor) { + return (BObject)((Object)tableCursor.get(this.innerColumn).toDataValue()); + } + + public String getString(TableCursor tableCursor) { + return tableCursor.getString(this.innerColumn); + } + + public double getDouble(TableCursor tableCursor) { + return ((BDouble)tableCursor.get(this.innerColumn).toDataValue()).getDouble(); + } + + public float getFloat(TableCursor tableCursor) { + return ((BFloat)tableCursor.get(this.innerColumn).toDataValue()).getFloat(); + } + + public boolean getBoolean(TableCursor tableCursor) { + return ((BBoolean)tableCursor.get(this.innerColumn).toDataValue()).getBoolean(); + } + + public int getInt(TableCursor tableCursor) { + return ((BInteger)tableCursor.get(this.innerColumn).toDataValue()).getInt(); + } + + public long getLong(TableCursor tableCursor) { + return ((BLong)tableCursor.get(this.innerColumn).toDataValue()).getLong(); + } + + private final /* synthetic */ void this() { + this.facets = null; + } + + public ToDataColumn(Column column) { + super(column); + this.this(); + Type type = column.getType(); + this.columnType = !type.isAbstract() && !type.isInterface() && type.is(BValue.TYPE) ? type.getInstance().toDataValue().getType() : BString.TYPE; + if (!type.equals(this.columnType)) { + BString bString = BString.make(type.getTypeSpec().toString()); + this.facets = BFacets.make(column.getFacets(), "origType", bString); + } else { + this.facets = null; + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/data/DataCodec.java b/modules/cfr_output/com/tridium/data/DataCodec.java new file mode 100644 index 0000000..6a7f490 --- /dev/null +++ b/modules/cfr_output/com/tridium/data/DataCodec.java @@ -0,0 +1,10 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.data; + +public abstract class DataCodec { + public static final int START = 497933825; + public static final int END = 766369282; +} + diff --git a/modules/cfr_output/com/tridium/data/DataColumnList.java b/modules/cfr_output/com/tridium/data/DataColumnList.java new file mode 100644 index 0000000..b1514c7 --- /dev/null +++ b/modules/cfr_output/com/tridium/data/DataColumnList.java @@ -0,0 +1,52 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.data; + +import java.util.Hashtable; +import java.util.Vector; +import javax.baja.collection.Column; +import javax.baja.collection.ColumnList; + +public class DataColumnList +implements ColumnList { + private Vector list = new Vector(5); + private Hashtable table = new Hashtable(); + + public int size() { + return this.list.size(); + } + + public Column get(int n) { + return (Column)this.list.elementAt(n); + } + + public Column get(String string) { + return (Column)this.table.get(string); + } + + public int indexOf(String string) { + int n = this.list.size(); + int n2 = 0; + while (n2 < n) { + Column column = (Column)this.list.elementAt(n2); + if (column.getName().equals(string)) { + return n2; + } + ++n2; + } + return -1; + } + + public void addColumn(Column column) { + this.list.addElement(column); + this.table.put(column.getName(), column); + } + + public Column[] list() { + Object[] objectArray = new Column[this.list.size()]; + this.list.copyInto(objectArray); + return objectArray; + } +} + diff --git a/modules/cfr_output/com/tridium/data/DataTableCursor.java b/modules/cfr_output/com/tridium/data/DataTableCursor.java new file mode 100644 index 0000000..c2a0b07 --- /dev/null +++ b/modules/cfr_output/com/tridium/data/DataTableCursor.java @@ -0,0 +1,100 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.data; + +import com.tridium.data.BDataRow; +import javax.baja.collection.BITable; +import javax.baja.collection.Column; +import javax.baja.collection.TableCursor; +import javax.baja.data.BIDataTable; +import javax.baja.sys.BFacets; +import javax.baja.sys.BObject; +import javax.baja.sys.Context; + +public class DataTableCursor +implements TableCursor { + private BIDataTable table; + private int row; + private BDataRow rowObject; + + public Context getContext() { + return null; + } + + public BITable getTable() { + return this.table; + } + + public boolean next() { + int n = this.table.size(); + if (this.row != n) { + ++this.row; + boolean bl = false; + if (this.row != n) { + bl = true; + } + return bl; + } + return false; + } + + public boolean nextComponent() { + return false; + } + + public boolean next(Class clazz) { + return false; + } + + public BObject get() { + if (this.rowObject == null) { + this.rowObject = new BDataRow(this.table, this.row); + } else { + this.rowObject.setRow(this.row); + } + return this.rowObject; + } + + public BObject get(Column column) { + return this.table.get(this.row, column); + } + + public String getString(Column column) { + return this.table.getString(this.row, column); + } + + public double getDouble(Column column) { + return this.table.getDouble(this.row, column); + } + + public float getFloat(Column column) { + return this.table.getFloat(this.row, column); + } + + public int getInt(Column column) { + return this.table.getInt(this.row, column); + } + + public long getLong(Column column) { + return this.table.getLong(this.row, column); + } + + public boolean getBoolean(Column column) { + return this.table.getBoolean(this.row, column); + } + + public int getFlags(Column column) { + return this.table.getFlags(this.row, column); + } + + public BFacets getFacets(Column column) { + return this.table.getFacets(this.row, column); + } + + public DataTableCursor(BIDataTable bIDataTable) { + this.table = bIDataTable; + this.row = -1; + } +} + diff --git a/modules/cfr_output/com/tridium/data/DataTableDecoder.java b/modules/cfr_output/com/tridium/data/DataTableDecoder.java new file mode 100644 index 0000000..359e5a1 --- /dev/null +++ b/modules/cfr_output/com/tridium/data/DataTableDecoder.java @@ -0,0 +1,110 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.data; + +import com.tridium.data.BDataTable; +import com.tridium.data.DataCodec; +import java.io.DataInput; +import java.io.IOException; +import javax.baja.data.BIDataTable; +import javax.baja.data.BIDataValue; +import javax.baja.data.DataTypes; +import javax.baja.io.BIEncodable; +import javax.baja.sys.BFacets; +import javax.baja.sys.Type; + +public class DataTableDecoder +extends DataCodec { + public static BIDataTable decode(DataInput dataInput) throws IOException { + BIEncodable bIEncodable; + int n; + BDataTable bDataTable = new BDataTable(); + int n2 = dataInput.readInt(); + if (n2 != 497933825) { + throw new IOException("Invalid start of binary table encoding."); + } + boolean bl = dataInput.readBoolean(); + if (bl) { + bDataTable.setTableFacets((BFacets)BFacets.DEFAULT.decode(dataInput)); + } + int n3 = dataInput.readInt(); + int[] nArray = new int[n3]; + Type[] typeArray = new Type[n3]; + int n4 = 0; + while (n4 < n3) { + String string = dataInput.readUTF(); + String string2 = dataInput.readUTF(); + nArray[n4] = dataInput.readInt(); + typeArray[n4] = DataTypes.getBySymbol((char)nArray[n4]); + n = dataInput.readInt(); + bIEncodable = null; + boolean bl2 = dataInput.readBoolean(); + if (bl2) { + bIEncodable = (BFacets)BFacets.DEFAULT.decode(dataInput); + } + bDataTable.addColumn(string, string2, typeArray[n4], n, (BFacets)bIEncodable); + ++n4; + } + if (n3 == 0) { + throw new IllegalStateException("Table contains no columns."); + } + n4 = dataInput.readInt(); + if (n4 == -1) { + bDataTable.startRows(); + } else { + bDataTable.startRows(n4); + } + int n5 = dataInput.readInt(); + while (n5 != 0) { + int n6 = 0; + while (n6 < n5) { + bDataTable.startRow(); + n = 0; + while (n < n3) { + switch (nArray[n]) { + case 102: { + bDataTable.set(dataInput.readFloat(), (BFacets)null); + break; + } + case 98: { + bDataTable.set(dataInput.readBoolean(), null); + break; + } + case 115: { + bDataTable.set(dataInput.readUTF(), null); + break; + } + case 105: { + bDataTable.set(dataInput.readInt(), (BFacets)null); + break; + } + case 108: { + bDataTable.set(dataInput.readLong(), (BFacets)null); + break; + } + case 100: { + bDataTable.set(dataInput.readDouble(), null); + break; + } + default: { + bIEncodable = (BIDataValue)((Object)typeArray[n].getInstance()); + bDataTable.set((BIDataValue)((Object)bIEncodable.decode(dataInput)), null); + } + } + ++n; + } + bDataTable.endRow(); + ++n6; + } + n5 = dataInput.readInt(); + } + bDataTable.endRows(); + int n7 = dataInput.readInt(); + if (n7 != 766369282) { + throw new IOException("Invalid end of binary table encoding."); + } + return bDataTable; + } +} + diff --git a/modules/cfr_output/com/tridium/data/DataTableEncoder.java b/modules/cfr_output/com/tridium/data/DataTableEncoder.java new file mode 100644 index 0000000..4d5539f --- /dev/null +++ b/modules/cfr_output/com/tridium/data/DataTableEncoder.java @@ -0,0 +1,109 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.data; + +import com.tridium.data.DataCodec; +import java.io.DataOutput; +import java.io.IOException; +import javax.baja.collection.Column; +import javax.baja.collection.TableCursor; +import javax.baja.data.BIDataTable; +import javax.baja.data.BIDataValue; +import javax.baja.io.ByteBuffer; +import javax.baja.sys.BFacets; +import javax.baja.sys.Context; + +public class DataTableEncoder +extends DataCodec { + public static void encode(BIDataTable bIDataTable, DataOutput dataOutput, Context context) throws IOException { + Object object; + dataOutput.writeInt(497933825); + BFacets bFacets = bIDataTable.getTableFacets(); + if (bFacets == null || bFacets.isNull()) { + dataOutput.writeBoolean(false); + } else { + dataOutput.writeBoolean(true); + bFacets.encode(dataOutput); + } + Column[] columnArray = bIDataTable.getColumns().list(); + int n = columnArray.length; + dataOutput.writeInt(n); + int n2 = 0; + while (n2 < n) { + dataOutput.writeUTF(columnArray[n2].getName()); + dataOutput.writeUTF(columnArray[n2].getDisplayName(context)); + dataOutput.writeInt(columnArray[n2].getType().getDataTypeSymbol()); + dataOutput.writeInt(columnArray[n2].getFlags()); + object = columnArray[n2].getFacets(); + if (object == null || ((BFacets)object).isNull()) { + dataOutput.writeBoolean(false); + } else { + dataOutput.writeBoolean(true); + ((BFacets)object).encode(dataOutput); + } + ++n2; + } + dataOutput.writeInt(-1); + TableCursor tableCursor = (TableCursor)bIDataTable.cursor(); + object = new ByteBuffer(6400); + int n3 = 0; + while (tableCursor.next()) { + DataTableEncoder.writeRow((DataOutput)object, tableCursor, columnArray); + if (++n3 != 200) continue; + dataOutput.writeInt(n3); + ((ByteBuffer)object).writeTo(dataOutput); + ((ByteBuffer)object).reset(); + n3 = 0; + } + if (n3 != 0) { + dataOutput.writeInt(n3); + ((ByteBuffer)object).writeTo(dataOutput); + } + dataOutput.writeInt(0); + dataOutput.writeInt(766369282); + } + + private static final void writeRow(DataOutput dataOutput, TableCursor tableCursor, Column[] columnArray) throws IOException { + int n = columnArray.length; + int n2 = 0; + while (n2 < n) { + char c = columnArray[n2].getType().getDataTypeSymbol(); + switch (c) { + case 'f': { + dataOutput.writeFloat(tableCursor.getFloat(columnArray[n2])); + break; + } + case 'b': { + dataOutput.writeBoolean(tableCursor.getBoolean(columnArray[n2])); + break; + } + case 's': { + dataOutput.writeUTF(tableCursor.getString(columnArray[n2])); + break; + } + case 'i': { + dataOutput.writeInt(tableCursor.getInt(columnArray[n2])); + break; + } + case 'l': { + dataOutput.writeLong(tableCursor.getLong(columnArray[n2])); + break; + } + case 'd': { + dataOutput.writeDouble(tableCursor.getDouble(columnArray[n2])); + break; + } + default: { + ((BIDataValue)((Object)tableCursor.get(columnArray[n2]))).encode(dataOutput); + } + } + ++n2; + } + } + + public static String encodeToString(BIDataTable bIDataTable) throws IOException { + throw new UnsupportedOperationException("not implemented"); + } +} + diff --git a/modules/cfr_output/com/tridium/dataRecovery/BDataRecoveryComponentEvent.java b/modules/cfr_output/com/tridium/dataRecovery/BDataRecoveryComponentEvent.java new file mode 100644 index 0000000..264ba3e --- /dev/null +++ b/modules/cfr_output/com/tridium/dataRecovery/BDataRecoveryComponentEvent.java @@ -0,0 +1,527 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nre.util.Base64 + */ +package com.tridium.dataRecovery; + +import com.tridium.sys.schema.NSlot; +import com.tridium.util.ArrayUtil; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.Arrays; +import javax.baja.category.BCategoryMask; +import javax.baja.io.BIEncodable; +import javax.baja.io.ByteBuffer; +import javax.baja.naming.BOrd; +import javax.baja.naming.SlotPath; +import javax.baja.nre.util.Base64; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Flags; +import javax.baja.sys.Property; +import javax.baja.sys.Slot; +import javax.baja.sys.SlotCursor; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BDataRecoveryComponentEvent +extends BObject +implements BIEncodable { + public static final Type TYPE; + public static final BDataRecoveryComponentEvent DEFAULT; + protected static String[] ID_STRINGS; + private int eventId; + private int[] slotIndex; + private String slotName; + private BComplex comp; + private BOrd ord; + private int hashCode; + private BValue value; + private int flags; + private BFacets facets; + private String oldSlotName; + private Property[] properties; + private BCategoryMask oldMask; + static /* synthetic */ Class class$com$tridium$dataRecovery$BDataRecoveryComponentEvent; + + public static final BDataRecoveryComponentEvent makeChangeEvent(BComponent bComponent, Slot slot, BValue bValue) { + BDataRecoveryComponentEvent bDataRecoveryComponentEvent = new BDataRecoveryComponentEvent(); + bDataRecoveryComponentEvent.eventId = 0; + bDataRecoveryComponentEvent.comp = bComponent; + bDataRecoveryComponentEvent.ord = bComponent.getOrdInSpace(); + bDataRecoveryComponentEvent.slotName = slot.getName(); + if (slot.isFrozen()) { + try { + int n = ((NSlot)slot).index; + bDataRecoveryComponentEvent.slotIndex = new int[1]; + bDataRecoveryComponentEvent.slotIndex[0] = n; + } + catch (Throwable throwable) {} + } + bDataRecoveryComponentEvent.value = bValue; + return bDataRecoveryComponentEvent; + } + + public static final BDataRecoveryComponentEvent makeChangeEvent(BComplex bComplex, BOrd bOrd, int[] nArray, Slot slot, BValue bValue) { + BDataRecoveryComponentEvent bDataRecoveryComponentEvent = new BDataRecoveryComponentEvent(); + bDataRecoveryComponentEvent.eventId = 0; + bDataRecoveryComponentEvent.comp = bComplex; + bDataRecoveryComponentEvent.slotIndex = nArray; + bDataRecoveryComponentEvent.ord = bOrd; + bDataRecoveryComponentEvent.slotName = slot.getName(); + bDataRecoveryComponentEvent.value = bValue; + return bDataRecoveryComponentEvent; + } + + public static final BDataRecoveryComponentEvent makeAddEvent(BComponent bComponent, String string, BValue bValue, int n, BFacets bFacets) { + BDataRecoveryComponentEvent bDataRecoveryComponentEvent = new BDataRecoveryComponentEvent(); + bDataRecoveryComponentEvent.eventId = 1; + bDataRecoveryComponentEvent.comp = bComponent; + bDataRecoveryComponentEvent.ord = bComponent.getOrdInSpace(); + bDataRecoveryComponentEvent.slotName = string; + bDataRecoveryComponentEvent.value = bValue; + bDataRecoveryComponentEvent.flags = n; + bDataRecoveryComponentEvent.facets = bFacets; + return bDataRecoveryComponentEvent; + } + + public static final BDataRecoveryComponentEvent makeRemoveEvent(BComponent bComponent, String string) { + BDataRecoveryComponentEvent bDataRecoveryComponentEvent = new BDataRecoveryComponentEvent(); + bDataRecoveryComponentEvent.eventId = 2; + bDataRecoveryComponentEvent.comp = bComponent; + bDataRecoveryComponentEvent.ord = bComponent.getOrdInSpace(); + bDataRecoveryComponentEvent.slotName = string; + return bDataRecoveryComponentEvent; + } + + public static final BDataRecoveryComponentEvent makeRenameEvent(BComponent bComponent, String string, String string2) { + BDataRecoveryComponentEvent bDataRecoveryComponentEvent = new BDataRecoveryComponentEvent(); + bDataRecoveryComponentEvent.eventId = 3; + bDataRecoveryComponentEvent.comp = bComponent; + bDataRecoveryComponentEvent.ord = bComponent.getOrdInSpace(); + bDataRecoveryComponentEvent.slotName = string2; + bDataRecoveryComponentEvent.oldSlotName = string; + return bDataRecoveryComponentEvent; + } + + public static final BDataRecoveryComponentEvent makeReorderEvent(BComponent bComponent, Property[] propertyArray) { + BDataRecoveryComponentEvent bDataRecoveryComponentEvent = new BDataRecoveryComponentEvent(); + bDataRecoveryComponentEvent.eventId = 4; + bDataRecoveryComponentEvent.comp = bComponent; + bDataRecoveryComponentEvent.ord = bComponent.getOrdInSpace(); + bDataRecoveryComponentEvent.properties = propertyArray; + return bDataRecoveryComponentEvent; + } + + public static final BDataRecoveryComponentEvent makeFlagsChangeEvent(BComponent bComponent, String string, int n) { + BDataRecoveryComponentEvent bDataRecoveryComponentEvent = new BDataRecoveryComponentEvent(); + bDataRecoveryComponentEvent.eventId = 6; + bDataRecoveryComponentEvent.comp = bComponent; + bDataRecoveryComponentEvent.ord = bComponent.getOrdInSpace(); + bDataRecoveryComponentEvent.slotName = string; + bDataRecoveryComponentEvent.flags = n; + return bDataRecoveryComponentEvent; + } + + public static final BDataRecoveryComponentEvent makeFacetsChangeEvent(BComponent bComponent, String string, BFacets bFacets) { + BDataRecoveryComponentEvent bDataRecoveryComponentEvent = new BDataRecoveryComponentEvent(); + bDataRecoveryComponentEvent.eventId = 7; + bDataRecoveryComponentEvent.comp = bComponent; + bDataRecoveryComponentEvent.ord = bComponent.getOrdInSpace(); + bDataRecoveryComponentEvent.slotName = string; + bDataRecoveryComponentEvent.facets = bFacets; + return bDataRecoveryComponentEvent; + } + + public static final BDataRecoveryComponentEvent makeRecategorizeEvent(BComponent bComponent, BCategoryMask bCategoryMask, BCategoryMask bCategoryMask2) { + BDataRecoveryComponentEvent bDataRecoveryComponentEvent = new BDataRecoveryComponentEvent(); + bDataRecoveryComponentEvent.eventId = 10; + bDataRecoveryComponentEvent.comp = bComponent; + bDataRecoveryComponentEvent.ord = bComponent.getOrdInSpace(); + bDataRecoveryComponentEvent.value = bCategoryMask; + bDataRecoveryComponentEvent.oldMask = bCategoryMask2; + return bDataRecoveryComponentEvent; + } + + public int getId() { + return this.eventId; + } + + public String getSlotName() { + return this.slotName; + } + + public BComponent getComponent(BObject bObject) { + return this.getComplex(bObject).asComponent(); + } + + public BComplex getComplex(BObject bObject) { + if (this.comp != null) { + return this.comp; + } + this.comp = (BComplex)this.ord.get(bObject); + if (this.slotIndex != null) { + SlotCursor slotCursor; + int n = this.slotIndex.length; + int n2 = 0; + while (n2 < n - 1) { + slotCursor = this.comp.getSlots(); + boolean bl = false; + while (slotCursor.next()) { + Slot slot = slotCursor.slot(); + if (!slot.isFrozen() || ((NSlot)slot).index != this.slotIndex[n2]) continue; + this.comp = slotCursor.get().asComplex(); + bl = true; + break; + } + if (!bl) { + throw new IllegalStateException("Could not retrieve complex."); + } + ++n2; + } + n2 = this.slotIndex[n - 1]; + if (this.slotName == null && n2 != -1) { + slotCursor = this.comp.getSlots(); + while (slotCursor.next()) { + Slot slot = slotCursor.slot(); + if (!slot.isFrozen()) continue; + try { + if (((NSlot)slot).index != n2) continue; + this.slotName = slot.getName(); + break; + } + catch (Throwable throwable) {} + } + } + } + return this.comp; + } + + public BValue getValue() { + return this.value; + } + + public int getFlags() { + return this.flags; + } + + public BFacets getFacets() { + return this.facets; + } + + public String getOldSlotName() { + return this.oldSlotName; + } + + public Property[] getDynamicProperties() { + return this.properties; + } + + public BCategoryMask getCategoryMask() { + return (BCategoryMask)this.value; + } + + public BCategoryMask getOldCategoryMask() { + return this.oldMask; + } + + public String toString(Context context) { + int n; + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(ID_STRINGS[this.eventId]).append(" "); + if (this.comp instanceof BComponent) { + stringBuffer.append(((BComponent)this.comp).toDisplayPathString(context)); + } else if ((this.comp == null || this.slotIndex == null) && this.ord != null) { + stringBuffer.append(this.ord.toString()); + } + int n2 = 0; + if (this.slotIndex != null) { + n2 = this.slotIndex.length; + if (this.comp != null) { + BComplex bComplex; + n = this.slotName != null ? n2 - 1 : n2; + BComponent bComponent = this.comp.getParentComponent(); + stringBuffer.append(bComponent.toDisplayPathString(context)); + BComplex bComplex2 = bComplex = (BComplex)this.ord.get(bComponent); + int n3 = stringBuffer.length(); + while (bComplex2 != null && bComponent != bComplex2) { + stringBuffer.insert(n3, '/'); + stringBuffer.insert(n3 + 1, SlotPath.unescape(bComplex2.getPropertyInParent().getName())); + bComplex2 = bComplex2.getParent(); + } + int n4 = 0; + while (n4 < n) { + SlotCursor slotCursor = bComplex.getSlots(); + boolean bl = false; + while (slotCursor.next()) { + Slot slot = slotCursor.slot(); + if (!slot.isFrozen() || ((NSlot)slot).index != this.slotIndex[n4]) continue; + stringBuffer.append('/').append(SlotPath.unescape(slot.getName())); + if (n4 != n - 1) { + bComplex = slotCursor.get().asComplex(); + } + bl = true; + break; + } + if (!bl) { + throw new IllegalStateException("Invalid slot index " + this.slotIndex[n4]); + } + ++n4; + } + } + } + if (this.slotName != null) { + stringBuffer.append("/").append(SlotPath.unescape(this.slotName)); + } + if (n2 > 0) { + stringBuffer.append("["); + n = 0; + while (n < n2) { + if (n > 0) { + stringBuffer.append(','); + } + stringBuffer.append(this.slotIndex[n]); + ++n; + } + stringBuffer.append("]"); + } + if (this.value != null) { + stringBuffer.append(", ").append(this.value.toString(context)); + } + if (this.flags != -1) { + stringBuffer.append(", flags={").append(Flags.toDisplayString(this.flags, context)).append("}"); + } + if (this.facets != null) { + stringBuffer.append(", facets={").append(this.facets.toString(context)).append("}"); + } + if (this.oldSlotName != null) { + stringBuffer.append(", oldSlotName=").append(this.oldSlotName); + } + if (this.oldMask != null) { + stringBuffer.append(", oldMask=").append(this.oldMask); + } + if (this.properties != null) { + stringBuffer.append(": {"); + n = 0; + while (n < this.properties.length) { + if (n > 0) { + stringBuffer.append(','); + } + stringBuffer.append(this.properties[n].getName()); + ++n; + } + stringBuffer.append("}"); + } + return stringBuffer.toString(); + } + + public int hashCode() { + if (this.hashCode == -1) { + int n = 11; + n ^= this.eventId; + if (this.ord != null) { + n ^= this.ord.hashCode(); + } + if (this.slotName != null) { + n ^= this.slotName.hashCode(); + } + if (this.slotIndex != null) { + int n2 = 0; + while (n2 < this.slotIndex.length) { + n ^= this.slotIndex[n2]; + ++n2; + } + } + this.hashCode = n; + } + return this.hashCode; + } + + public boolean equals(Object object) { + if (object instanceof BDataRecoveryComponentEvent) { + BDataRecoveryComponentEvent bDataRecoveryComponentEvent = (BDataRecoveryComponentEvent)object; + boolean bl = false; + if (this.eventId == bDataRecoveryComponentEvent.eventId && (this.ord == bDataRecoveryComponentEvent.ord || this.ord != null && this.ord.equals(bDataRecoveryComponentEvent.ord)) && Arrays.equals(this.slotIndex, bDataRecoveryComponentEvent.slotIndex) && (this.slotName == bDataRecoveryComponentEvent.slotName || this.slotName != null && this.slotName.equals(bDataRecoveryComponentEvent.slotName))) { + bl = true; + } + return bl; + } + return false; + } + + public void encode(DataOutput dataOutput) throws IOException { + int n; + dataOutput.writeByte(this.eventId); + this.ord.encode(dataOutput); + int n2 = 0; + if (this.slotIndex != null) { + n2 = this.slotIndex.length; + } + int n3 = n2; + boolean bl = false; + if (n3 > 0) { + if (n3 == 1 && this.slotIndex[0] == -1) { + dataOutput.writeBoolean(false); + } else { + bl = true; + dataOutput.writeBoolean(true); + n = 0; + while (n < n3) { + dataOutput.writeBoolean(true); + dataOutput.writeInt(this.slotIndex[n]); + ++n; + } + dataOutput.writeBoolean(false); + } + } else { + dataOutput.writeBoolean(false); + } + int n4 = 0; + if (!bl && this.slotName != null) { + n4 = 1; + } + n = n4; + dataOutput.writeBoolean(n != 0); + if (n != 0) { + dataOutput.writeUTF(this.slotName); + } + } + + public BObject decode(DataInput dataInput) throws IOException { + byte by = dataInput.readByte(); + BOrd bOrd = (BOrd)BOrd.DEFAULT.decode(dataInput); + int[] nArray = null; + if (dataInput.readBoolean()) { + int n = 1; + int n2 = 0; + int[] nArray2 = new int[n]; + while (dataInput.readBoolean()) { + if (n2 >= n) { + n += Math.min(n, 10); + nArray2 = ArrayUtil.grow(nArray2, n); + } + nArray2[n2] = dataInput.readInt(); + ++n2; + } + if (n2 != n) { + nArray = new int[n2]; + System.arraycopy(nArray2, 0, nArray, 0, n2); + } else { + nArray = nArray2; + } + } + String string = null; + if (dataInput.readBoolean()) { + string = dataInput.readUTF(); + } + return new BDataRecoveryComponentEvent(by, string, nArray, bOrd); + } + + public String encodeToString() throws IOException { + ByteBuffer byteBuffer = new ByteBuffer(); + this.encode(byteBuffer); + return Base64.encode((byte[])byteBuffer.toByteArray()); + } + + public BObject decodeFromString(String string) throws IOException { + ByteBuffer byteBuffer = new ByteBuffer(Base64.decode((String)string)); + return this.decode(byteBuffer); + } + + int getEncodingLen() { + int n = 3 + this.numBytesToEncode(this.ord.encodeToString()); + int n2 = 0; + if (this.slotIndex != null) { + n2 = this.slotIndex.length; + } + int n3 = n2; + boolean bl = false; + if (n3 > 0 && (n3 != 1 || this.slotIndex[0] != -1)) { + bl = true; + n += 5 * n3 + 1; + } + if (!bl && this.slotName != null) { + n += this.numBytesToEncode(this.slotName); + } + return n; + } + + private final int numBytesToEncode(String string) { + int n = string.length(); + int n2 = 0; + int n3 = 0; + while (n3 < n) { + char c = string.charAt(n3); + n2 = c >= '\u0001' && c <= '\u007f' ? ++n2 : (c > '\u07ff' ? (n2 += 3) : (n2 += 2)); + ++n3; + } + if (n2 > (int)-1) { + return 0; + } + return n2 + 2; + } + + public Type getType() { + return TYPE; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.slotIndex = null; + this.slotName = null; + this.comp = null; + this.ord = null; + this.hashCode = -1; + this.value = null; + this.flags = -1; + this.facets = null; + this.oldSlotName = null; + this.properties = null; + this.oldMask = null; + } + + private BDataRecoveryComponentEvent(int n, String string, int[] nArray, BOrd bOrd) { + this.this(); + this.eventId = n; + this.slotName = string; + this.slotIndex = nArray; + this.ord = bOrd; + } + + private BDataRecoveryComponentEvent() { + this.this(); + } + + static { + Class clazz = class$com$tridium$dataRecovery$BDataRecoveryComponentEvent; + if (clazz == null) { + clazz = class$com$tridium$dataRecovery$BDataRecoveryComponentEvent = BDataRecoveryComponentEvent.class("[Lcom.tridium.dataRecovery.BDataRecoveryComponentEvent;", false); + } + TYPE = Sys.loadType(clazz); + DEFAULT = new BDataRecoveryComponentEvent(); + ID_STRINGS = new String[]{"changed", "added", "removed", "renamed", "reordered", "topicFired", "flagsChanged", "facetsChanged", "knobAdded", "knobRemoved", "recategorized"}; + } +} + diff --git a/modules/cfr_output/com/tridium/dataRecovery/BDataRecoveryComponentRecorder.java b/modules/cfr_output/com/tridium/dataRecovery/BDataRecoveryComponentRecorder.java new file mode 100644 index 0000000..0cb41a7 --- /dev/null +++ b/modules/cfr_output/com/tridium/dataRecovery/BDataRecoveryComponentRecorder.java @@ -0,0 +1,652 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nre.util.Array + * javax.baja.nre.util.SortUtil + */ +package com.tridium.dataRecovery; + +import com.tridium.dataRecovery.BDataRecoveryComponentEvent; +import com.tridium.sys.Nre; +import com.tridium.util.ValueByteBuffer; +import java.util.Hashtable; +import java.util.Iterator; +import javax.baja.agent.BIAgent; +import javax.baja.category.BCategoryMask; +import javax.baja.dataRecovery.BIDataRecoveryService; +import javax.baja.dataRecovery.DataRecoveryServiceInFaultException; +import javax.baja.dataRecovery.IDataRecoveryRecord; +import javax.baja.io.ByteBuffer; +import javax.baja.log.Log; +import javax.baja.naming.UnresolvedException; +import javax.baja.nre.util.Array; +import javax.baja.nre.util.SortUtil; +import javax.baja.registry.TypeInfo; +import javax.baja.space.BComponentSpace; +import javax.baja.spy.SpyWriter; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BObject; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.BasicContext; +import javax.baja.sys.Context; +import javax.baja.sys.DuplicateSlotException; +import javax.baja.sys.Flags; +import javax.baja.sys.Property; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.BTypeSpec; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BDataRecoveryComponentRecorder +extends BObject +implements BIAgent { + public static final Type TYPE; + public static final Context SKIP_CRITICAL_CX; + protected static final byte[] EMPTY_DATA; + public static final Log LOG; + protected static final Log[] RECORD_LOGS; + protected static final Log[] RESTORE_LOGS; + public static final int SPY_EVENT_LIMIT; + public static final boolean PROG_OBJ_STATS; + protected static final Log PROG_OBJ_LOG; + private static TypeInfo PROG_OBJ_TYPE_INFO; + private BIDataRecoveryService service; + public long totalProgObjEvents; + public long progObjChangedEvents; + public long totalProgObjDataSize; + public long progObjChangedEventDataSize; + static /* synthetic */ Class class$com$tridium$dataRecovery$BDataRecoveryComponentRecorder; + + public Type getType() { + return TYPE; + } + + public final void setDataRecoveryService(BIDataRecoveryService bIDataRecoveryService) { + this.service = bIDataRecoveryService; + } + + public final BIDataRecoveryService getDataRecoveryService() { + return this.service; + } + + public boolean isEventCritical(int n, BComplex bComplex, Slot slot, int n2, Context context) { + int n3; + if (this.service == null) { + return false; + } + if (!this.service.isEnabled()) { + return false; + } + if (context == SKIP_CRITICAL_CX) { + return false; + } + if (n == 5 || n == 8 || n == 9) { + return false; + } + BComponent bComponent = bComplex.getParentComponent(); + if (bComponent == null) { + return false; + } + BComponentSpace bComponentSpace = bComponent.getComponentSpace(); + if (bComponentSpace == null) { + return false; + } + if (slot != null && ((n2 & 2) != 0 || (n2 & 0x10000) != 0 || (n2 & 0x8000) != 0 && n == 0)) { + return false; + } + BComplex bComplex2 = bComplex.getParent(); + Property property = bComplex.getPropertyInParent(); + return bComplex2 == null || property == null || ((n3 = bComplex2.getFlags(property)) & 2) == 0 && (n3 & 0x10000) == 0; + } + + public void record(BDataRecoveryComponentEvent bDataRecoveryComponentEvent, Context context) { + Log log = LOG; + try { + int n = bDataRecoveryComponentEvent.getId(); + BComplex bComplex = bDataRecoveryComponentEvent.getComplex((BObject)((Object)this.service)); + BComponent bComponent = bComplex.getParentComponent(); + BComponentSpace bComponentSpace = bComponent.getComponentSpace(); + log = RECORD_LOGS[n]; + boolean bl = log.isTraceOn(); + boolean bl2 = false; + if (PROG_OBJ_STATS || PROG_OBJ_LOG.isTraceOn()) { + try { + if (PROG_OBJ_TYPE_INFO == null) { + PROG_OBJ_TYPE_INFO = BTypeSpec.make("program", "Program").getTypeInfo(); + } + if (bComplex.getType().is(PROG_OBJ_TYPE_INFO)) { + bl2 = PROG_OBJ_STATS; + if (PROG_OBJ_LOG.isTraceOn()) { + log = PROG_OBJ_LOG; + bl = true; + } + } + } + catch (Exception exception) {} + } + switch (n) { + case 0: { + if (bl) { + log.trace("Recording component event '" + bDataRecoveryComponentEvent + '\''); + } + ByteBuffer byteBuffer = BDataRecoveryComponentRecorder.encodeValue(bDataRecoveryComponentEvent.getValue()); + int n2 = byteBuffer.getLength(); + this.service.update(bComponentSpace, bDataRecoveryComponentEvent, byteBuffer.getBytes(), 0, n2); + if (bl2) { + ++this.totalProgObjEvents; + ++this.progObjChangedEvents; + int n3 = n2 + bDataRecoveryComponentEvent.getEncodingLen(); + this.totalProgObjDataSize += (long)n3; + this.progObjChangedEventDataSize += (long)n3; + } + break; + } + case 1: { + if (bl) { + log.trace("Recording component event '" + bDataRecoveryComponentEvent + '\''); + } + ValueByteBuffer valueByteBuffer = ValueByteBuffer.make(); + valueByteBuffer.writeInt(bDataRecoveryComponentEvent.getFlags()); + valueByteBuffer.encode(bDataRecoveryComponentEvent.getFacets()); + valueByteBuffer.encode(bDataRecoveryComponentEvent.getValue()); + int n4 = valueByteBuffer.getLength(); + this.service.append(bComponentSpace, bDataRecoveryComponentEvent, valueByteBuffer.getBytes(), 0, n4); + if (bl2) { + ++this.totalProgObjEvents; + this.totalProgObjDataSize += (long)(n4 + bDataRecoveryComponentEvent.getEncodingLen()); + } + break; + } + case 2: { + if (bl) { + log.trace("Recording component event '" + bDataRecoveryComponentEvent + '\''); + } + this.service.append(bComponentSpace, bDataRecoveryComponentEvent, EMPTY_DATA); + if (bl2) { + ++this.totalProgObjEvents; + this.totalProgObjDataSize += (long)bDataRecoveryComponentEvent.getEncodingLen(); + } + break; + } + case 3: { + if (bl) { + log.trace("Recording component event '" + bDataRecoveryComponentEvent + '\''); + } + ByteBuffer byteBuffer = BDataRecoveryComponentRecorder.encodeValue(BString.make(bDataRecoveryComponentEvent.getOldSlotName())); + int n5 = byteBuffer.getLength(); + this.service.append(bComponentSpace, bDataRecoveryComponentEvent, byteBuffer.getBytes(), 0, n5); + if (bl2) { + ++this.totalProgObjEvents; + this.totalProgObjDataSize += (long)(n5 + bDataRecoveryComponentEvent.getEncodingLen()); + } + break; + } + case 4: { + if (bl) { + log.trace("Recording component event '" + bDataRecoveryComponentEvent + '\''); + } + Property[] propertyArray = bDataRecoveryComponentEvent.getDynamicProperties(); + int n6 = propertyArray.length; + int n7 = 0; + int n8 = 0; + while (n8 < n6) { + if (!Flags.isTransient(bComplex, propertyArray[n8])) { + ++n7; + } + ++n8; + } + if (n7 == 0) { + return; + } + ByteBuffer byteBuffer = new ByteBuffer(); + byteBuffer.writeInt(n7); + n8 = 0; + while (n8 < n6) { + if (!Flags.isTransient(bComplex, propertyArray[n8])) { + byteBuffer.writeUTF(propertyArray[n8].getName()); + } + ++n8; + } + int n9 = byteBuffer.getLength(); + this.service.update(bComponentSpace, bDataRecoveryComponentEvent, byteBuffer.getBytes(), 0, n9); + if (bl2) { + ++this.totalProgObjEvents; + this.totalProgObjDataSize += (long)(n9 + bDataRecoveryComponentEvent.getEncodingLen()); + } + break; + } + case 6: { + if (bl) { + log.trace("Recording component event '" + bDataRecoveryComponentEvent + '\''); + } + ByteBuffer byteBuffer = new ByteBuffer(); + byteBuffer.writeInt(bDataRecoveryComponentEvent.getFlags()); + int n10 = byteBuffer.getLength(); + this.service.update(bComponentSpace, bDataRecoveryComponentEvent, byteBuffer.getBytes(), 0, n10); + if (bl2) { + ++this.totalProgObjEvents; + this.totalProgObjDataSize += (long)(n10 + bDataRecoveryComponentEvent.getEncodingLen()); + } + break; + } + case 7: { + if (bl) { + log.trace("Recording component event '" + bDataRecoveryComponentEvent + '\''); + } + ByteBuffer byteBuffer = BDataRecoveryComponentRecorder.encodeValue(bDataRecoveryComponentEvent.getFacets()); + int n11 = byteBuffer.getLength(); + this.service.update(bComponentSpace, bDataRecoveryComponentEvent, byteBuffer.getBytes(), 0, n11); + if (bl2) { + ++this.totalProgObjEvents; + this.totalProgObjDataSize += (long)(n11 + bDataRecoveryComponentEvent.getEncodingLen()); + } + break; + } + case 10: { + BCategoryMask bCategoryMask = bDataRecoveryComponentEvent.getCategoryMask(); + if (bl) { + log.trace("Recording component event '" + bDataRecoveryComponentEvent + '\''); + } + ByteBuffer byteBuffer = BDataRecoveryComponentRecorder.encodeValue(bCategoryMask); + int n12 = byteBuffer.getLength(); + this.service.update(bComponentSpace, bDataRecoveryComponentEvent, byteBuffer.getBytes(), 0, n12); + if (bl2) { + ++this.totalProgObjEvents; + this.totalProgObjDataSize += (long)(n12 + bDataRecoveryComponentEvent.getEncodingLen()); + } + break; + } + } + } + catch (DataRecoveryServiceInFaultException dataRecoveryServiceInFaultException) { + try { + Nre.serviceManager.addDataRecoveryComponentRecorder(this.service, null); + } + catch (Throwable throwable) {} + log.warning("DataRecoveryService in fault, could not append component event " + bDataRecoveryComponentEvent + ". Stopped data recovery component recording.", dataRecoveryServiceInFaultException); + } + catch (Throwable throwable) { + log.error("DataRecoveryService could not record component event '" + bDataRecoveryComponentEvent + '\'', throwable); + } + } + + /* + * Unable to fully structure code + */ + public boolean restore(BComponentSpace var1_1, IDataRecoveryRecord var2_2) throws Exception { + var3_3 = null; + var4_4 = BDataRecoveryComponentRecorder.LOG; + try { + var5_5 = var2_2.getKey(); + var6_9 = new ByteBuffer(var5_5); + var3_3 = (BDataRecoveryComponentEvent)BDataRecoveryComponentEvent.DEFAULT.decode(var6_9); + var7_10 = var2_2.getData(); + var8_11 = var3_3.getComplex(var1_1); + var9_12 = var3_3.getId(); + var4_4 = BDataRecoveryComponentRecorder.RESTORE_LOGS[var9_12]; + if (BDataRecoveryComponentRecorder.PROG_OBJ_LOG.isTraceOn()) { + try { + if (BDataRecoveryComponentRecorder.PROG_OBJ_TYPE_INFO == null) { + BDataRecoveryComponentRecorder.PROG_OBJ_TYPE_INFO = BTypeSpec.make("program", "Program").getTypeInfo(); + } + if (var8_11.getType().is(BDataRecoveryComponentRecorder.PROG_OBJ_TYPE_INFO)) { + var4_4 = BDataRecoveryComponentRecorder.PROG_OBJ_LOG; + } + } + catch (Exception v0) {} + } + switch (var3_3.getId()) { + case 0: { + var10_13 = BDataRecoveryComponentRecorder.decodeValue(var7_10); + if (var4_4.isTraceOn()) { + var11_15 = new StringBuffer(); + var11_15.append("Restoring component event '"); + var11_15.append(var3_3.toString(null)); + var11_15.append(" val=").append(var10_13.toString(null)).append("'"); + var4_4.trace(var11_15.toString()); + } + var8_11.set(var3_3.getSlotName(), var10_13); + break; + } + case 1: { + var11_16 = ValueByteBuffer.make(var7_10); + var12_17 = var11_16.readInt(); + var13_19 = (BFacets)var11_16.decode(); + var10_14 = (BValue)var11_16.decode(); + if (var4_4.isTraceOn()) { + var14_21 = new StringBuffer(); + var14_21.append("Restoring component event '"); + var14_21.append(var3_3.toString(null)); + var14_21.append(" val=").append(var10_14.toString(null)); + var14_21.append(" flags=").append(Flags.toDisplayString(var12_17, null)); + var14_21.append(" facets=").append(var13_19.toString(null)).append("'"); + var4_4.trace(var14_21.toString()); + } + var8_11.asComponent().add(var3_3.getSlotName(), var10_14, var12_17, var13_19, null); + break; + } + case 2: { + if (var4_4.isTraceOn()) { + var14_22 = new StringBuffer(); + var14_22.append("Restoring component event '"); + var14_22.append(var3_3.toString(null)).append("'"); + var4_4.trace(var14_22.toString()); + } + var8_11.asComponent().remove(var3_3.getSlotName()); + break; + } + case 3: { + var14_23 = ((BString)BDataRecoveryComponentRecorder.decodeValue(var7_10)).getString(); + if (var4_4.isTraceOn()) { + var15_24 = new StringBuffer(); + var15_24.append("Restoring component event '"); + var15_24.append(var3_3.toString(null)); + var15_24.append(" oldSlotName=").append(var14_23).append("'"); + var4_4.trace(var15_24.toString()); + } + var8_11.asComponent().rename(var8_11.getProperty(var14_23), var3_3.getSlotName()); + break; + } + case 4: { + var15_25 = new ByteBuffer(var7_10); + var16_27 = var15_25.readInt(); + var17_28 = new Property[var16_27]; + var18_29 = 0; + while (var18_29 < var16_27) { + var17_28[var18_29] = var8_11.getProperty(var15_25.readUTF()); + ++var18_29; + } + if (var4_4.isTraceOn()) { + var18_30 = new StringBuffer(); + var18_30.append("Restoring component event '"); + var18_30.append(var3_3.toString(null)); + var18_30.append(" props=").append(new Array(var17_28).toString()).append("'"); + var4_4.trace(var18_30.toString()); + } + var8_11.asComponent().reorder((Property[])var17_28); + break; + } + case 6: { + var15_26 = new ByteBuffer(var7_10); + var12_18 = var15_26.readInt(); + var18_31 = var8_11.getSlot(var3_3.getSlotName()); + if ((var12_18 & 32768) == 0) ** GOTO lbl120 + var19_32 = false; + try { + var20_36 = var8_11.asComponent().getLinks(var18_31); + v1 = 0; + if (var20_36 != null) { + v1 = var20_36.length; + } + var21_38 = v1; + var22_39 = 0; + while (var22_39 < var21_38) { + if (!var20_36[var22_39].isActive()) ** GOTO lbl114 + var19_32 = true; + break; +lbl114: + // 1 sources + + ++var22_39; + } + } + catch (Throwable v2) {} + if (!var19_32) { + var12_18 &= -32769; + } +lbl120: + // 4 sources + + if (var4_4.isTraceOn()) { + var19_33 = new StringBuffer(); + var19_33.append("Restoring component event '"); + var19_33.append(var3_3.toString(null)); + var19_33.append(" flags=").append(Flags.toDisplayString(var12_18, null)).append("'"); + var4_4.trace(var19_33.toString()); + } + var8_11.setFlags(var18_31, var12_18); + break; + } + case 7: { + var13_20 = (BFacets)BDataRecoveryComponentRecorder.decodeValue(var7_10); + if (var4_4.isTraceOn()) { + var19_34 = new StringBuffer(); + var19_34.append("Restoring component event '"); + var19_34.append(var3_3.toString(null)); + var19_34.append(" facets=").append(var13_20.toString(null)).append("'"); + var4_4.trace(var19_34.toString()); + } + var8_11.asComponent().setFacets(var8_11.getSlot(var3_3.getSlotName()), var13_20); + break; + } + case 10: { + var19_35 = (BCategoryMask)BDataRecoveryComponentRecorder.decodeValue(var7_10); + if (var4_4.isTraceOn()) { + var20_37 = new StringBuffer(); + var20_37.append("Restoring component event '"); + var20_37.append(var3_3.toString(null)); + var20_37.append(" mask=").append(var19_35.toString(null)).append("'"); + var4_4.trace(var20_37.toString()); + } + var8_11.asComponent().setCategoryMask(var19_35, null); + break; + } + default: { + var4_4.error("DataRecoveryService could not restore unexpected component event '" + var3_3 + '\''); + return false; + } + } + } + catch (UnresolvedException var5_6) { + if (var4_4.isTraceOn()) { + var4_4.trace("DataRecoveryService could not restore component event '" + var3_3 + '\'', var5_6); + } + } + catch (DuplicateSlotException var5_7) { + if (var4_4.isTraceOn()) { + var4_4.trace("DataRecoveryService could not restore component event '" + var3_3 + '\'', var5_7); + } + } + catch (Exception var5_8) { + var4_4.error("DataRecoveryService could not restore component event '" + var3_3 + '\'', var5_8); + throw var5_8; + } + return true; + } + + /* + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void dataRecoverySpy(BComponentSpace bComponentSpace, SpyWriter spyWriter, Iterator iterator) throws Exception { + Object object; + int n; + Object[] objectArray; + if (PROG_OBJ_STATS) { + spyWriter.startProps("Program Object Data Recovery Statistics"); + spyWriter.prop((Object)"Records Generated", new Long(this.totalProgObjEvents)); + spyWriter.prop((Object)"Data Generated", new Long(this.totalProgObjDataSize)); + double d = this.totalProgObjEvents > 0L ? (double)this.totalProgObjDataSize / (double)this.totalProgObjEvents : 0.0; + spyWriter.prop((Object)"Average Record Size", new Double(d)); + spyWriter.prop((Object)"Change Events Generated", new Long(this.progObjChangedEvents)); + spyWriter.prop((Object)"Change Data Generated", new Long(this.progObjChangedEventDataSize)); + d = this.progObjChangedEvents > 0L ? (double)this.progObjChangedEventDataSize / (double)this.progObjChangedEvents : 0.0; + spyWriter.prop((Object)"Average Change Event Size", new Double(d)); + spyWriter.endProps(); + } + Hashtable hashtable = new Hashtable(); + int n2 = 0; + int n3 = 0; + while (true) { + Object var8_8; + if (!iterator.hasNext()) { + if (n3 <= 0) return; + objectArray = new DataRecoverySpyStat[n3]; + objectArray = hashtable.values().toArray(objectArray); + SortUtil.rsort((Object[])objectArray); + n = objectArray.length; + object = n2 + " Component Events Recently Recorded in Data Recovery"; + if (n > SPY_EVENT_LIMIT) { + n = SPY_EVENT_LIMIT; + object = (String)object + " (truncated to " + n + " rows)"; + } + break; + } + try { + try { + object = (IDataRecoveryRecord)iterator.next(); + byte[] byArray = object.getKey(); + ByteBuffer byteBuffer = new ByteBuffer(byArray); + BDataRecoveryComponentEvent bDataRecoveryComponentEvent = (BDataRecoveryComponentEvent)BDataRecoveryComponentEvent.DEFAULT.decode(byteBuffer); + bDataRecoveryComponentEvent.getComplex(bComponentSpace); + byte[] byArray2 = object.getData(); + int n4 = byArray2 != null ? byArray.length + byArray2.length : byArray.length; + DataRecoverySpyStat dataRecoverySpyStat = (DataRecoverySpyStat)hashtable.get(bDataRecoveryComponentEvent); + if (dataRecoverySpyStat == null) { + dataRecoverySpyStat = new DataRecoverySpyStat(); + hashtable.put(bDataRecoveryComponentEvent, dataRecoverySpyStat); + ++n3; + } + dataRecoverySpyStat.event = bDataRecoveryComponentEvent; + ++dataRecoverySpyStat.occurrences; + dataRecoverySpyStat.totalSize += n4; + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + catch (Throwable throwable) { + var8_8 = null; + ++n2; + throw throwable; + } + { + var8_8 = null; + ++n2; + continue; + } + break; + } + spyWriter.startTable(true); + spyWriter.trTitle(object, 4); + spyWriter.w("\n"); + int n5 = 0; + while (true) { + if (n5 >= n) { + spyWriter.endTable(); + return; + } + double d = (double)((DataRecoverySpyStat)objectArray[n5]).totalSize / (double)((DataRecoverySpyStat)objectArray[n5]).occurrences; + spyWriter.tr("" + ((DataRecoverySpyStat)objectArray[n5]).occurrences, "" + ((DataRecoverySpyStat)objectArray[n5]).totalSize, "" + d, ((DataRecoverySpyStat)objectArray[n5]).event.toString(null)); + ++n5; + } + } + + static ByteBuffer encodeValue(BValue bValue) throws Exception { + ValueByteBuffer valueByteBuffer = ValueByteBuffer.make(); + valueByteBuffer.setEncodeContext(Context.encrypt); + valueByteBuffer.encode(bValue); + return valueByteBuffer; + } + + static BValue decodeValue(byte[] byArray) throws Exception { + ValueByteBuffer valueByteBuffer = ValueByteBuffer.make(byArray); + valueByteBuffer.setEncodeContext(Context.encrypt); + return (BValue)valueByteBuffer.decode(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.totalProgObjEvents = 0L; + this.progObjChangedEvents = 0L; + this.totalProgObjDataSize = 0L; + this.progObjChangedEventDataSize = 0L; + } + + public BDataRecoveryComponentRecorder() { + this.this(); + } + + static { + Class clazz = class$com$tridium$dataRecovery$BDataRecoveryComponentRecorder; + if (clazz == null) { + clazz = class$com$tridium$dataRecovery$BDataRecoveryComponentRecorder = BDataRecoveryComponentRecorder.class("[Lcom.tridium.dataRecovery.BDataRecoveryComponentRecorder;", false); + } + TYPE = Sys.loadType(clazz); + SKIP_CRITICAL_CX = new BasicContext(){ + + public final boolean equals(Object object) { + boolean bl = false; + if (this == object) { + bl = true; + } + return bl; + } + + public final String toString() { + return "Context.skipDataRecovery"; + } + }; + EMPTY_DATA = new byte[0]; + LOG = Log.getLog("sys.dataRecovery"); + RECORD_LOGS = new Log[]{Log.getLog("sys.dataRecovery.save.change"), Log.getLog("sys.dataRecovery.save.add"), Log.getLog("sys.dataRecovery.save.remove"), Log.getLog("sys.dataRecovery.save.rename"), Log.getLog("sys.dataRecovery.save.reorder"), LOG, Log.getLog("sys.dataRecovery.save.flagsChange"), Log.getLog("sys.dataRecovery.save.facetsChange"), LOG, LOG, Log.getLog("sys.dataRecovery.save.recategorize")}; + RESTORE_LOGS = new Log[]{Log.getLog("sys.dataRecovery.load.change"), Log.getLog("sys.dataRecovery.load.add"), Log.getLog("sys.dataRecovery.load.remove"), Log.getLog("sys.dataRecovery.load.rename"), Log.getLog("sys.dataRecovery.load.reorder"), LOG, Log.getLog("sys.dataRecovery.load.flagsChange"), Log.getLog("sys.dataRecovery.load.facetsChange"), LOG, LOG, Log.getLog("sys.dataRecovery.load.recategorize")}; + SPY_EVENT_LIMIT = Integer.getInteger("sys.dataRecovery.spy.limit", 200); + PROG_OBJ_STATS = Boolean.getBoolean("sys.dataRecovery.progObjStats"); + PROG_OBJ_LOG = Log.getLog("sys.dataRecovery.progObj"); + PROG_OBJ_TYPE_INFO = null; + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + static class DataRecoverySpyStat + implements Comparable { + BDataRecoveryComponentEvent event; + int occurrences; + int totalSize; + + public int compareTo(Object object) { + DataRecoverySpyStat dataRecoverySpyStat = (DataRecoverySpyStat)object; + int n = this.occurrences - dataRecoverySpyStat.occurrences; + if (n == 0) { + return 0; + } + if (n < 0) { + return -1; + } + return 1; + } + + private final /* synthetic */ void this() { + this.occurrences = 0; + this.totalSize = 0; + } + + DataRecoverySpyStat() { + this.this(); + } + } +} + diff --git a/modules/cfr_output/com/tridium/encode/HtmlEncoder.java b/modules/cfr_output/com/tridium/encode/HtmlEncoder.java new file mode 100644 index 0000000..393fbd8 --- /dev/null +++ b/modules/cfr_output/com/tridium/encode/HtmlEncoder.java @@ -0,0 +1,32 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.encode; + +import java.io.IOException; + +public class HtmlEncoder { + public static String encode(String string) throws IOException { + StringBuffer stringBuffer = new StringBuffer(); + int n = 0; + while (n < string.length()) { + char c = string.charAt(n); + if (c == '\'' || c == '\"') { + stringBuffer.append("&#"); + stringBuffer.append((int)c); + stringBuffer.append(';'); + } else if (c == '<') { + stringBuffer.append("<"); + } else if (c == '>') { + stringBuffer.append(">"); + } else if (c == '&') { + stringBuffer.append("&"); + } else { + stringBuffer.append(c); + } + ++n; + } + return stringBuffer.toString(); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/encoding/BogCodec.java b/modules/cfr_output/com/tridium/fox/encoding/BogCodec.java new file mode 100644 index 0000000..87571d8 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/encoding/BogCodec.java @@ -0,0 +1,73 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.io.ByteBuffer + * javax.baja.io.ValueDocDecoder + * javax.baja.io.ValueDocDecoder$BogDecoderPlugin + * javax.baja.io.ValueDocEncoder + * javax.baja.io.ValueDocEncoder$BogEncoderPlugin + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.xml.XException + * javax.baja.xml.XWriter + */ +package com.tridium.fox.encoding; + +import com.tridium.fox.encoding.DecoderFactory; +import com.tridium.fox.message.FoxMessage; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import javax.baja.io.ByteBuffer; +import javax.baja.io.ValueDocDecoder; +import javax.baja.io.ValueDocEncoder; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.xml.XException; +import javax.baja.xml.XWriter; + +public final class BogCodec { + public static void add(FoxMessage foxMessage, String string, BValue bValue, Context context) throws IOException { + ByteBuffer byteBuffer = BogCodec.encode(bValue, context); + foxMessage.add(string, "bog", byteBuffer.getBytes(), byteBuffer.getLength()); + } + + public static ByteBuffer encode(BValue bValue, Context context) throws IOException { + ByteBuffer byteBuffer = new ByteBuffer(1024); + ValueDocEncoder valueDocEncoder = new ValueDocEncoder(byteBuffer.getOutputStream()); + XWriter xWriter = ((ValueDocEncoder.BogEncoderPlugin)valueDocEncoder.getPlugin()).getWriter(); + xWriter.w((Object)"\n"); + valueDocEncoder.setEncodeTransients(true); + valueDocEncoder.setEncodeComments(false); + valueDocEncoder.encode(bValue); + xWriter.w((Object)"\n"); + } else { + xWriter.w((Object)"/>\n"); + } + valueDocEncoder.close(); + return byteBuffer; + } + + static class Provider + implements DecoderFactory.Provider { + Provider() { + } + + public Object decode(byte[] byArray, Object object) throws Exception { + ValueDocDecoder valueDocDecoder = new ValueDocDecoder((InputStream)new ByteArrayInputStream(byArray)); + valueDocDecoder.next(); + if (!valueDocDecoder.elem().name().equals("bog")) { + throw new XException("Expected , not " + valueDocDecoder.elem(), ((ValueDocDecoder.BogDecoderPlugin)valueDocDecoder.getPlugin()).getXmlParser()); + } + valueDocDecoder.next(); + if (valueDocDecoder.type() == 2) { + return null; + } + return valueDocDecoder.decode(); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/encoding/DecoderFactory.java b/modules/cfr_output/com/tridium/fox/encoding/DecoderFactory.java new file mode 100644 index 0000000..29ad6a6 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/encoding/DecoderFactory.java @@ -0,0 +1,48 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.encoding; + +import com.tridium.fox.encoding.BogCodec; +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.message.FoxObject; +import java.io.IOException; +import java.util.HashMap; + +public class DecoderFactory { + private static final HashMap providers = new HashMap(); + + public static Object decode(FoxMessage foxMessage, String string, Object object) throws Exception { + FoxObject foxObject = (FoxObject)foxMessage.get(string); + return DecoderFactory.decode(foxObject.encoding, foxObject.data, object); + } + + public static Object decode(FoxObject foxObject, Object object) throws Exception { + return DecoderFactory.decode(foxObject.encoding, foxObject.data, object); + } + + public static Object decode(String string, byte[] byArray, Object object) throws Exception { + Provider provider = (Provider)providers.get(string); + if (provider != null) { + return provider.decode(byArray, object); + } + throw new IOException("Unknown object encoding: " + string); + } + + public static void register(String string, Provider provider) { + providers.put(string, provider); + } + + public static void unregister(String string) { + providers.remove(string); + } + + static { + DecoderFactory.register("bog", new BogCodec.Provider()); + } + + public static interface Provider { + public Object decode(byte[] var1, Object var2) throws Exception; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/kerberos/GSSDelegCredAction.java b/modules/cfr_output/com/tridium/fox/kerberos/GSSDelegCredAction.java new file mode 100644 index 0000000..3f9dbdb --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/kerberos/GSSDelegCredAction.java @@ -0,0 +1,79 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.util.Lexicon + */ +package com.tridium.fox.kerberos; + +import com.tridium.fox.kerberos.KerberosAuthenticator; +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.FoxSession; +import java.security.PrivilegedAction; +import javax.baja.util.Lexicon; +import org.ietf.jgss.GSSContext; +import org.ietf.jgss.GSSManager; +import org.ietf.jgss.GSSName; +import org.ietf.jgss.Oid; + +public class GSSDelegCredAction +implements PrivilegedAction { + private static final String KERB_DELEG_CRED = "fox.kerberos.gss.delegating"; + private static final String KERB_NO_TOKEN = "fox.kerberos.gss.noToken"; + private static final String KERB_CTX_ESTABLISHED = "fox.kerberos.gss.contextEstablished"; + private static final String KERB_ERR_NO_DELEG = "fox.kerberos.gss.couldNotDelegate"; + String serverPrincipal; + FoxSession session; + static /* synthetic */ Class class$com$tridium$fox$kerberos$GSSDelegCredAction; + + public GSSDelegCredAction(String string, FoxSession foxSession) { + this.serverPrincipal = string; + this.session = foxSession; + } + + public Object run() { + Lexicon lexicon = Lexicon.make((Class)(class$com$tridium$fox$kerberos$GSSDelegCredAction == null ? (class$com$tridium$fox$kerberos$GSSDelegCredAction = GSSDelegCredAction.class$("com.tridium.fox.kerberos.GSSDelegCredAction")) : class$com$tridium$fox$kerberos$GSSDelegCredAction)); + KerberosAuthenticator.log.trace(lexicon.getText(KERB_DELEG_CRED)); + try { + Oid oid = new Oid("1.2.840.113554.1.2.2"); + GSSManager gSSManager = GSSManager.getInstance(); + GSSName gSSName = gSSManager.createName(this.serverPrincipal, null); + gSSName = gSSName.canonicalize(oid); + GSSContext gSSContext = gSSManager.createContext(gSSName, oid, null, 0); + gSSContext.requestCredDeleg(true); + gSSContext.requestMutualAuth(true); + byte[] byArray = new byte[]{}; + while (!gSSContext.isEstablished()) { + FoxMessage foxMessage; + if ((byArray = gSSContext.initSecContext(byArray, 0, byArray.length)) != null) { + foxMessage = new FoxMessage(); + foxMessage.add("token", byArray); + this.session.setState("client.tune sendToken "); + this.session.sendTuning("clientToken", foxMessage); + } + if (gSSContext.isEstablished()) continue; + this.session.setState("client.tune receiveToken"); + foxMessage = this.session.receiveTuning("serverToken"); + byArray = foxMessage.getBlob("token", null); + if (byArray != null) continue; + KerberosAuthenticator.log.warning(lexicon.getText(KERB_NO_TOKEN)); + return null; + } + KerberosAuthenticator.log.trace(lexicon.getText(KERB_CTX_ESTABLISHED, new Object[]{gSSContext.getSrcName(), gSSContext.getTargName()})); + } + catch (Exception exception) { + KerberosAuthenticator.log.error(lexicon.getText(KERB_ERR_NO_DELEG, new Object[]{exception.toString()})); + } + return null; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/kerberos/KerberosAuthenticator.java b/modules/cfr_output/com/tridium/fox/kerberos/KerberosAuthenticator.java new file mode 100644 index 0000000..687cff3 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/kerberos/KerberosAuthenticator.java @@ -0,0 +1,123 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.log.Log + * javax.baja.security.BICredentials + * javax.baja.security.BUsernameAndPassword + * javax.baja.security.kerberos.BKerberosCredentials + * javax.baja.util.Lexicon + */ +package com.tridium.fox.kerberos; + +import com.sun.security.jgss.GSSUtil; +import com.tridium.fox.kerberos.GSSDelegCredAction; +import com.tridium.fox.kerberos.KerberosCallbackHandler; +import com.tridium.fox.kerberos.KerberosConfig; +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.FoxSession; +import javax.baja.log.Log; +import javax.baja.security.BICredentials; +import javax.baja.security.BUsernameAndPassword; +import javax.baja.security.kerberos.BKerberosCredentials; +import javax.baja.util.Lexicon; +import javax.security.auth.Subject; +import javax.security.auth.login.LoginContext; +import javax.security.auth.login.LoginException; + +public class KerberosAuthenticator { + private static final String KERB_AUTH_STARTED = "fox.kerberos.authStarted"; + private static final String KERB_USER_KERB = "fox.kerberos.user.kerberos"; + private static final String KERB_USER_LOCAL = "fox.kerberos.user.local"; + private static final String KERB_LOGIN = "fox.kerberos.login"; + private static final String KERB_LOGIN_FAILED = "fox.kerberos.loginFailed"; + static final Lexicon lex = Lexicon.make((Class)(class$com$tridium$fox$kerberos$KerberosAuthenticator == null ? (class$com$tridium$fox$kerberos$KerberosAuthenticator = KerberosAuthenticator.class$("com.tridium.fox.kerberos.KerberosAuthenticator")) : class$com$tridium$fox$kerberos$KerberosAuthenticator)); + static final Log log = Log.getLog((String)"fox.kerberos"); + static /* synthetic */ Class class$com$tridium$fox$kerberos$KerberosAuthenticator; + + public static void authenticate(FoxSession foxSession, FoxMessage foxMessage, BICredentials bICredentials) throws Exception { + Object object; + log.trace(lex.getText(KERB_AUTH_STARTED)); + boolean bl = false; + String string = ""; + String string2 = ""; + if (bICredentials instanceof BUsernameAndPassword) { + object = (BUsernameAndPassword)bICredentials; + string = object.getUsername(); + if (string.startsWith("kerberos:")) { + bl = true; + string = string.substring(string.indexOf(":") + 1); + } + string2 = object.getPassword().getValue(); + } else if (bICredentials instanceof BKerberosCredentials) { + bl = true; + } else { + throw new IllegalStateException(); + } + object = new FoxMessage(); + String string3 = bl ? "authInputKerb" : "authInputLocal"; + ((FoxMessage)object).add("authInput", string3); + foxSession.setState("client.tune send firstMessage: userType=" + string3); + foxSession.sendTuning("authMessage1", (FoxMessage)object); + if (bl) { + log.trace(lex.getText(KERB_USER_KERB, new Object[]{string})); + String string4 = foxMessage.getString("realm"); + String string5 = foxMessage.getString("kdc"); + String string6 = foxMessage.getString("server") + "@" + string4; + System.setProperty("java.security.krb5.realm", string4); + System.setProperty("java.security.krb5.kdc", string5); + if (bICredentials instanceof BKerberosCredentials) { + BKerberosCredentials bKerberosCredentials = (BKerberosCredentials)bICredentials; + Subject subject = GSSUtil.createSubject(bKerberosCredentials.getCredential().getName(), bKerberosCredentials.getCredential()); + Subject.doAs(subject, new GSSDelegCredAction(string6, foxSession)); + bKerberosCredentials.destroyTicket(); + } else { + try { + string = string + "@" + string4; + LoginContext loginContext = KerberosAuthenticator.kerberosClientLogin(string, string2, foxSession); + Subject.doAs(loginContext.getSubject(), new GSSDelegCredAction(string6, foxSession)); + loginContext.logout(); + } + catch (LoginException loginException) { + FoxMessage foxMessage2 = new FoxMessage(); + byte[] byArray = new byte[]{}; + foxMessage2.add("token", byArray); + foxSession.setState("client.tune sendLogin"); + foxSession.sendTuning("clientToken", foxMessage2); + } + } + } else { + log.trace(lex.getText(KERB_USER_LOCAL, new Object[]{string})); + FoxMessage foxMessage3 = new FoxMessage(); + foxMessage3.add("username", string); + foxMessage3.add("password", string2); + foxSession.setState("client.tune sendLogin"); + foxSession.sendTuning("login", foxMessage3); + } + } + + private static LoginContext kerberosClientLogin(String string, String string2, FoxSession foxSession) throws LoginException { + log.trace(lex.getText(KERB_LOGIN)); + KerberosConfig kerberosConfig = new KerberosConfig(string); + LoginContext loginContext = null; + try { + loginContext = new LoginContext("com.tridium.fox.session.KerberosAuthenticator", null, new KerberosCallbackHandler(string, string2), kerberosConfig); + loginContext.login(); + } + catch (LoginException loginException) { + log.error(lex.getText(KERB_LOGIN_FAILED)); + throw loginException; + } + return loginContext; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/kerberos/KerberosCallbackHandler.java b/modules/cfr_output/com/tridium/fox/kerberos/KerberosCallbackHandler.java new file mode 100644 index 0000000..c45d051 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/kerberos/KerberosCallbackHandler.java @@ -0,0 +1,54 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.security.BICredentials + * javax.baja.security.BUsernameAndPassword + */ +package com.tridium.fox.kerberos; + +import java.io.IOException; +import javax.baja.security.BICredentials; +import javax.baja.security.BUsernameAndPassword; +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.callback.NameCallback; +import javax.security.auth.callback.PasswordCallback; +import javax.security.auth.callback.UnsupportedCallbackException; + +public class KerberosCallbackHandler +implements CallbackHandler { + String username = ""; + String password = ""; + + public KerberosCallbackHandler(BICredentials bICredentials) { + if (bICredentials instanceof BUsernameAndPassword) { + BUsernameAndPassword bUsernameAndPassword = (BUsernameAndPassword)bICredentials; + this.username = bUsernameAndPassword.getUsername(); + this.password = bUsernameAndPassword.getPassword().getValue(); + } + } + + public KerberosCallbackHandler(String string, String string2) { + this.username = string; + this.password = string2; + } + + public void handle(Callback[] callbackArray) throws IOException, UnsupportedCallbackException { + for (int i = 0; i < callbackArray.length; ++i) { + Callback callback; + if (callbackArray[i] instanceof NameCallback) { + callback = (NameCallback)callbackArray[i]; + ((NameCallback)callback).setName(this.username); + continue; + } + if (callbackArray[i] instanceof PasswordCallback) { + callback = (PasswordCallback)callbackArray[i]; + ((PasswordCallback)callback).setPassword(this.password.toCharArray()); + continue; + } + throw new UnsupportedCallbackException(callbackArray[i], "Unrecognized callback."); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/kerberos/KerberosConfig.java b/modules/cfr_output/com/tridium/fox/kerberos/KerberosConfig.java new file mode 100644 index 0000000..41cb0f3 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/kerberos/KerberosConfig.java @@ -0,0 +1,66 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.kerberos; + +import java.util.HashMap; +import javax.security.auth.login.AppConfigurationEntry; +import javax.security.auth.login.Configuration; + +public class KerberosConfig +extends Configuration { + AppConfigurationEntry entry = null; + String principal = null; + boolean useTicketCache = false; + boolean doNotPrompt = false; + boolean isInitiator = true; + boolean storeKey = false; + + public KerberosConfig(String string) { + this.principal = string; + this.init(); + } + + public KerberosConfig(boolean bl, boolean bl2) { + this.useTicketCache = bl; + this.doNotPrompt = bl2; + this.init(); + } + + public void setUseTicketCache(boolean bl) { + this.useTicketCache = bl; + this.init(); + } + + public void setDoNotPrompt(boolean bl) { + this.doNotPrompt = bl; + this.init(); + } + + public void setIsInitiator(boolean bl) { + this.isInitiator = bl; + if (!bl) { + this.storeKey = true; + } + this.init(); + } + + private void init() { + HashMap hashMap = new HashMap(); + if (this.principal != null) { + hashMap.put("principal", this.principal); + } + hashMap.put("useTicketCache", Boolean.toString(this.useTicketCache)); + hashMap.put("doNotPrompt", Boolean.toString(this.doNotPrompt)); + hashMap.put("isInitiator", Boolean.toString(this.isInitiator)); + hashMap.put("storeKey", Boolean.toString(this.storeKey)); + hashMap.put("refreshKrb5Config", "true"); + this.entry = new AppConfigurationEntry("com.sun.security.auth.module.Krb5LoginModule", AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, hashMap); + } + + public AppConfigurationEntry[] getAppConfigurationEntry(String string) { + AppConfigurationEntry[] appConfigurationEntryArray = new AppConfigurationEntry[]{this.entry}; + return appConfigurationEntryArray; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/message/FoxBlob.java b/modules/cfr_output/com/tridium/fox/message/FoxBlob.java new file mode 100644 index 0000000..defd967 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/message/FoxBlob.java @@ -0,0 +1,57 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.message; + +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.message.MessageReader; +import com.tridium.fox.message.MessageWriter; +import java.io.IOException; + +public final class FoxBlob +extends FoxTuple { + public byte[] data; + public int offset; + public int length; + + public FoxBlob(String string, byte[] byArray, int n) { + this.name = string; + this.data = byArray; + this.offset = 0; + this.length = n; + } + + public FoxBlob(String string, byte[] byArray, int n, int n2) { + this.name = string; + this.data = byArray; + this.offset = n; + this.length = n2; + } + + public FoxBlob(String string, byte[] byArray) { + this.name = string; + this.data = byArray; + this.offset = 0; + this.length = byArray.length; + } + + public FoxBlob() { + } + + public final int getType() { + return 98; + } + + protected final void writeValue(MessageWriter messageWriter) throws IOException { + messageWriter.writeInt(this.length).write(91).write(this.data, this.offset, this.length).write(93); + } + + protected void readValue(MessageReader messageReader) throws IOException { + this.length = messageReader.readInt(); + messageReader.consume(91); + this.data = new byte[this.length]; + messageReader.readFully(this.data, 0, this.length); + messageReader.consume(93); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/message/FoxBoolean.java b/modules/cfr_output/com/tridium/fox/message/FoxBoolean.java new file mode 100644 index 0000000..edb845c --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/message/FoxBoolean.java @@ -0,0 +1,46 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.message; + +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.message.MessageReader; +import com.tridium.fox.message.MessageWriter; +import java.io.IOException; + +public final class FoxBoolean +extends FoxTuple { + public boolean value; + + public FoxBoolean(String string, boolean bl) { + this.name = string; + this.value = bl; + } + + public FoxBoolean() { + } + + public final int getType() { + return 122; + } + + protected final void writeValue(MessageWriter messageWriter) throws IOException { + if (this.value) { + messageWriter.write(116); + } else { + messageWriter.write(102); + } + } + + protected void readValue(MessageReader messageReader) throws IOException { + int n = messageReader.read(); + if (n == 116) { + this.value = true; + } else if (n == 102) { + this.value = false; + } else { + throw messageReader.error("Expecting 't' or 'f', not '" + messageReader.toString(n) + "'"); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/message/FoxFloat.java b/modules/cfr_output/com/tridium/fox/message/FoxFloat.java new file mode 100644 index 0000000..1c7466b --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/message/FoxFloat.java @@ -0,0 +1,44 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.message; + +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.message.MessageReader; +import com.tridium.fox.message.MessageWriter; +import java.io.IOException; + +public final class FoxFloat +extends FoxTuple { + public double value; + + public FoxFloat(String string, double d) { + this.name = string; + this.value = d; + } + + public FoxFloat() { + } + + public final int getType() { + return 102; + } + + protected final void writeValue(MessageWriter messageWriter) throws IOException { + if (Double.isNaN(this.value)) { + messageWriter.writeSafe("nan"); + } else if (this.value == Double.POSITIVE_INFINITY) { + messageWriter.writeSafe("+inf"); + } else if (this.value == Double.NEGATIVE_INFINITY) { + messageWriter.writeSafe("-inf"); + } else { + messageWriter.writeSafe(String.valueOf(this.value)); + } + } + + protected void readValue(MessageReader messageReader) throws IOException { + String string = messageReader.readSafe(); + this.value = string.equals("nan") ? Double.NaN : (string.equals("+inf") ? Double.POSITIVE_INFINITY : (string.equals("-inf") ? Double.NEGATIVE_INFINITY : Double.parseDouble(string))); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/message/FoxInteger.java b/modules/cfr_output/com/tridium/fox/message/FoxInteger.java new file mode 100644 index 0000000..ec838d3 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/message/FoxInteger.java @@ -0,0 +1,35 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.message; + +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.message.MessageReader; +import com.tridium.fox.message.MessageWriter; +import java.io.IOException; + +public final class FoxInteger +extends FoxTuple { + public int value; + + public FoxInteger(String string, int n) { + this.name = string; + this.value = n; + } + + public FoxInteger() { + } + + public final int getType() { + return 105; + } + + protected final void writeValue(MessageWriter messageWriter) throws IOException { + messageWriter.writeInt(this.value); + } + + protected void readValue(MessageReader messageReader) throws IOException { + this.value = messageReader.readInt(); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/message/FoxMessage.java b/modules/cfr_output/com/tridium/fox/message/FoxMessage.java new file mode 100644 index 0000000..72e464c --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/message/FoxMessage.java @@ -0,0 +1,234 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.message; + +import com.tridium.fox.message.FoxBlob; +import com.tridium.fox.message.FoxBoolean; +import com.tridium.fox.message.FoxFloat; +import com.tridium.fox.message.FoxInteger; +import com.tridium.fox.message.FoxObject; +import com.tridium.fox.message.FoxString; +import com.tridium.fox.message.FoxTime; +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.message.MessageReader; +import com.tridium.fox.message.MessageWriter; +import java.io.IOException; +import java.util.Vector; + +public class FoxMessage +extends FoxTuple { + public static final FoxTuple[] noTuples = new FoxTuple[0]; + public FoxTuple[] tuples = noTuples; + public int count; + + public FoxMessage(String string) { + this.name = string; + } + + public FoxMessage() { + } + + public final int getType() { + return 109; + } + + public final void writeValue(MessageWriter messageWriter) throws IOException { + boolean bl = messageWriter.isDebug; + messageWriter.write(123).write(10); + ++messageWriter.indent; + for (int i = 0; i < this.count; ++i) { + if (bl) { + messageWriter.writeIndent(); + } + this.tuples[i].write(messageWriter); + messageWriter.write(10); + } + --messageWriter.indent; + if (bl) { + messageWriter.writeIndent(); + } + messageWriter.write(125); + } + + public void readValue(MessageReader messageReader) throws IOException { + messageReader.consume(123); + messageReader.consume(10); + int n; + while ((n = messageReader.read()) != 125) { + messageReader.pushBack(n); + this.add(FoxTuple.read(messageReader)); + } + return; + } + + public final FoxTuple get(String string) throws IOException { + for (int i = 0; i < this.count; ++i) { + if (string != this.tuples[i].name) continue; + return this.tuples[i]; + } + throw new IOException("Missing key \"" + string + "\""); + } + + public final FoxTuple[] list(String string) { + Vector vector = new Vector(); + for (int i = 0; i < this.count; ++i) { + if (string != this.tuples[i].name) continue; + vector.addElement(this.tuples[i]); + } + Object[] objectArray = new FoxTuple[vector.size()]; + vector.copyInto(objectArray); + return objectArray; + } + + public final String[] listStrings(String string) { + Vector vector = new Vector(); + for (int i = 0; i < this.count; ++i) { + if (string != this.tuples[i].name) continue; + vector.addElement(((FoxString)this.tuples[i]).value); + } + Object[] objectArray = new String[vector.size()]; + vector.copyInto(objectArray); + return objectArray; + } + + public final FoxTuple getOptional(String string) { + for (int i = 0; i < this.count; ++i) { + if (string != this.tuples[i].name) continue; + return this.tuples[i]; + } + return null; + } + + public final FoxMessage getMessage(String string) throws IOException { + return (FoxMessage)this.get(string); + } + + public final boolean getBoolean(String string) throws IOException { + return ((FoxBoolean)this.get((String)string)).value; + } + + public final int getInt(String string) throws IOException { + return ((FoxInteger)this.get((String)string)).value; + } + + public final double getFloat(String string) throws IOException { + return ((FoxFloat)this.get((String)string)).value; + } + + public final String getString(String string) throws IOException { + return ((FoxString)this.get((String)string)).value; + } + + public final long getTime(String string) throws IOException { + return ((FoxTime)this.get((String)string)).millis; + } + + public final byte[] getBlob(String string) throws IOException { + return ((FoxBlob)this.get((String)string)).data; + } + + public final boolean getBoolean(String string, boolean bl) { + FoxBoolean foxBoolean = (FoxBoolean)this.getOptional(string); + if (foxBoolean == null) { + return bl; + } + return foxBoolean.value; + } + + public final int getInt(String string, int n) { + FoxInteger foxInteger = (FoxInteger)this.getOptional(string); + if (foxInteger == null) { + return n; + } + return foxInteger.value; + } + + public final double getFloat(String string, double d) { + FoxFloat foxFloat = (FoxFloat)this.getOptional(string); + if (foxFloat == null) { + return d; + } + return foxFloat.value; + } + + public final String getString(String string, String string2) { + FoxString foxString = (FoxString)this.getOptional(string); + if (foxString == null) { + return string2; + } + return foxString.value; + } + + public final long getTime(String string, long l) { + FoxTime foxTime = (FoxTime)this.getOptional(string); + if (foxTime == null) { + return l; + } + return foxTime.millis; + } + + public final byte[] getBlob(String string, byte[] byArray) { + FoxBlob foxBlob = (FoxBlob)this.getOptional(string); + if (foxBlob == null) { + return byArray; + } + return foxBlob.data; + } + + public final void add(FoxTuple foxTuple) { + if (this.count >= this.tuples.length) { + if (this.count == 0) { + this.tuples = new FoxTuple[8]; + } else { + FoxTuple[] foxTupleArray = new FoxTuple[this.count * 2]; + System.arraycopy(this.tuples, 0, foxTupleArray, 0, this.count); + this.tuples = foxTupleArray; + } + } + this.tuples[this.count++] = foxTuple; + } + + public final void add(String string, boolean bl) { + this.add(new FoxBoolean(string, bl)); + } + + public final void add(String string, int n) { + this.add(new FoxInteger(string, n)); + } + + public final void add(String string, double d) { + this.add(new FoxFloat(string, d)); + } + + public final void add(String string, String string2) { + this.add(new FoxString(string, string2)); + } + + public final void add(String string, long l) { + this.add(new FoxTime(string, l)); + } + + public final void add(String string, byte[] byArray) { + this.add(new FoxBlob(string, byArray)); + } + + public final void add(String string, byte[] byArray, int n) { + this.add(new FoxBlob(string, byArray, n)); + } + + public final void add(String string, byte[] byArray, int n, int n2) { + this.add(new FoxBlob(string, byArray, n, n2)); + } + + public final void add(String string, String string2, byte[] byArray, int n) { + this.add(new FoxObject(string, string2, byArray, n)); + } + + public final FoxMessage add(String string, FoxMessage foxMessage) { + foxMessage.name = string; + this.add(foxMessage); + return foxMessage; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/message/FoxObject.java b/modules/cfr_output/com/tridium/fox/message/FoxObject.java new file mode 100644 index 0000000..e673c0b --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/message/FoxObject.java @@ -0,0 +1,45 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.message; + +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.message.MessageReader; +import com.tridium.fox.message.MessageWriter; +import java.io.IOException; + +public class FoxObject +extends FoxTuple { + public String encoding; + public byte[] data; + public int length; + + public FoxObject(String string, String string2, byte[] byArray, int n) { + this.name = string; + this.encoding = string2; + this.data = byArray; + this.length = n; + } + + public FoxObject() { + } + + public final int getType() { + return 111; + } + + protected final void writeValue(MessageWriter messageWriter) throws IOException { + messageWriter.writeName(this.encoding).write(32).writeInt(this.length).write(91).write(this.data, 0, this.length).write(93); + } + + protected void readValue(MessageReader messageReader) throws IOException { + this.encoding = messageReader.readName(); + messageReader.consume(32); + this.length = messageReader.readInt(); + messageReader.consume(91); + this.data = new byte[this.length]; + messageReader.readFully(this.data, 0, this.length); + messageReader.consume(93); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/message/FoxString.java b/modules/cfr_output/com/tridium/fox/message/FoxString.java new file mode 100644 index 0000000..c892955 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/message/FoxString.java @@ -0,0 +1,35 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.message; + +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.message.MessageReader; +import com.tridium.fox.message.MessageWriter; +import java.io.IOException; + +public final class FoxString +extends FoxTuple { + public String value; + + public FoxString(String string, String string2) { + this.name = string; + this.value = string2; + } + + public FoxString() { + } + + public final int getType() { + return 115; + } + + protected final void writeValue(MessageWriter messageWriter) throws IOException { + messageWriter.writeSafe(this.value); + } + + protected void readValue(MessageReader messageReader) throws IOException { + this.value = messageReader.readSafe(); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/message/FoxTime.java b/modules/cfr_output/com/tridium/fox/message/FoxTime.java new file mode 100644 index 0000000..032bb44 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/message/FoxTime.java @@ -0,0 +1,42 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.message; + +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.message.MessageReader; +import com.tridium.fox.message.MessageWriter; +import java.io.IOException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; + +public final class FoxTime +extends FoxTuple { + private DateFormat format = new SimpleDateFormat("HH:mm:ss dd-MMM-yy"); + public long millis; + + public FoxTime(String string, long l) { + this.name = string; + this.millis = l; + } + + public FoxTime() { + } + + public final int getType() { + return 116; + } + + protected final void writeValue(MessageWriter messageWriter) throws IOException { + messageWriter.writeHexLong(this.millis); + if (messageWriter.isDebug) { + messageWriter.writeSafe(" // ").writeSafe(this.format.format(new Date(this.millis))); + } + } + + protected void readValue(MessageReader messageReader) throws IOException { + this.millis = messageReader.readHexLong(); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/message/FoxTuple.java b/modules/cfr_output/com/tridium/fox/message/FoxTuple.java new file mode 100644 index 0000000..54627c9 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/message/FoxTuple.java @@ -0,0 +1,96 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.message; + +import com.tridium.fox.message.FoxBlob; +import com.tridium.fox.message.FoxBoolean; +import com.tridium.fox.message.FoxFloat; +import com.tridium.fox.message.FoxInteger; +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.message.FoxObject; +import com.tridium.fox.message.FoxString; +import com.tridium.fox.message.FoxTime; +import com.tridium.fox.message.MessageReader; +import com.tridium.fox.message.MessageWriter; +import java.io.IOException; +import java.io.OutputStream; + +public abstract class FoxTuple { + public String name; + + public abstract int getType(); + + public final void write(MessageWriter messageWriter) throws IOException { + messageWriter.writeName(this.name).write(61).write(this.getType()).write(58); + this.writeValue(messageWriter); + } + + protected abstract void writeValue(MessageWriter var1) throws IOException; + + public static FoxTuple read(MessageReader messageReader) throws IOException { + String string = messageReader.readName(); + messageReader.consume(61); + int n = messageReader.read(); + FoxTuple foxTuple = null; + switch (n) { + case 98: { + foxTuple = new FoxBlob(); + break; + } + case 102: { + foxTuple = new FoxFloat(); + break; + } + case 105: { + foxTuple = new FoxInteger(); + break; + } + case 109: { + foxTuple = new FoxMessage(); + break; + } + case 111: { + foxTuple = new FoxObject(); + break; + } + case 115: { + foxTuple = new FoxString(); + break; + } + case 116: { + foxTuple = new FoxTime(); + break; + } + case 122: { + foxTuple = new FoxBoolean(); + } + } + messageReader.consume(58); + foxTuple.name = string.intern(); + foxTuple.readValue(messageReader); + messageReader.consume(10); + return foxTuple; + } + + protected void readValue(MessageReader messageReader) throws IOException { + throw messageReader.error("not implemented"); + } + + public void dump(OutputStream outputStream) { + try { + MessageWriter messageWriter = new MessageWriter(outputStream, true); + this.write(messageWriter); + messageWriter.flush(); + } + catch (IOException iOException) { + iOException.printStackTrace(); + throw new RuntimeException(iOException.toString()); + } + } + + public void dump() { + this.dump(System.out); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/message/MessageReader.java b/modules/cfr_output/com/tridium/fox/message/MessageReader.java new file mode 100644 index 0000000..0c37878 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/message/MessageReader.java @@ -0,0 +1,320 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.message; + +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; + +public class MessageReader { + private static final int CM_NAME = 1; + private static final int CM_DIGIT = 2; + private static final int CM_HEX = 4; + private static byte[] charMap; + private static final int HISTORY_SIZE = 160; + private InputStream in; + private int pushBack = -1; + private byte[] history = new byte[160]; + private int historyIndex = -1; + + public MessageReader(InputStream inputStream) { + this.in = inputStream; + } + + public final int read() throws IOException { + if (this.pushBack != -1) { + int n = this.pushBack; + this.pushBack = -1; + return n; + } + int n = this.in.read(); + if (n < 0) { + throw new EOFException("EOF"); + } + this.historyIndex = (this.historyIndex + 1) % 160; + this.history[this.historyIndex] = (byte)n; + return n; + } + + public final void readFully(byte[] byArray, int n, int n2) throws IOException { + int n3; + for (int i = 0; i < n2; i += n3) { + n3 = this.in.read(byArray, n + i, n2 - i); + if (n3 >= 0) continue; + throw this.error("EOF"); + } + this.historyIndex = (this.historyIndex + 1) % 160; + this.history[this.historyIndex] = 98; + this.historyIndex = (this.historyIndex + 1) % 160; + this.history[this.historyIndex] = 108; + this.historyIndex = (this.historyIndex + 1) % 160; + this.history[this.historyIndex] = 111; + this.historyIndex = (this.historyIndex + 1) % 160; + this.history[this.historyIndex] = 98; + } + + public final void pushBack(int n) { + if (this.pushBack != -1) { + throw new IllegalStateException("Double push back"); + } + this.pushBack = n; + } + + public final String readName() throws IOException { + StringBuffer stringBuffer = new StringBuffer(); + while (true) { + int n; + if ((charMap[n = this.read()] & 1) == 0) { + if (stringBuffer.length() == 0) { + throw this.error("Expected name"); + } + this.pushBack(n); + return stringBuffer.toString(); + } + stringBuffer.append((char)n); + } + } + + public final String readTo(char c) throws IOException { + StringBuffer stringBuffer = new StringBuffer(); + while (true) { + int n; + if ((n = this.read()) == c) { + this.pushBack(n); + return stringBuffer.toString(); + } + stringBuffer.append((char)n); + } + } + + public final int readInt() throws IOException { + int n = 0; + boolean bl = false; + int n2 = this.read(); + if ((charMap[n2] & 2) != 0) { + n = n2 - 48; + } else if (n2 == 45) { + bl = true; + } else { + throw this.error("Expecting int"); + } + while (true) { + if ((charMap[n2 = this.read()] & 2) == 0) break; + n = n * 10 + (n2 - 48); + } + this.pushBack(n2); + if (bl) { + n = -n; + } + return n; + } + + public final long readLong() throws IOException { + long l = 0L; + boolean bl = false; + int n = this.read(); + if ((charMap[n] & 2) != 0) { + l = n - 48; + } else if (n == 45) { + bl = true; + } else { + throw this.error("Expecting int"); + } + while (true) { + if ((charMap[n = this.read()] & 2) == 0) break; + l = l * 10L + (long)(n - 48); + } + this.pushBack(n); + if (bl) { + l = -l; + } + return l; + } + + public final int readHex() throws IOException { + int n; + int n2 = 0; + while (true) { + if ((charMap[n = this.read()] & 4) == 0) break; + if ((charMap[n] & 2) != 0) { + n2 = (n2 << 4) + (n - 48); + continue; + } + n2 = (n2 << 4) + 10 + (n - 97); + } + this.pushBack(n); + return n2; + } + + public final long readHexLong() throws IOException { + int n; + long l = 0L; + while (true) { + if ((charMap[n = this.read()] & 4) == 0) break; + if ((charMap[n] & 2) != 0) { + l = (l << 4) + (long)(n - 48); + continue; + } + l = (l << 4) + 10L + (long)(n - 97); + } + this.pushBack(n); + return l; + } + + public final String readSafe() throws IOException { + int n; + StringBuffer stringBuffer = new StringBuffer(); + while (true) { + if ((n = this.read()) < 32) break; + if (n == 35) { + int n2; + if (stringBuffer.length() == 0) { + n2 = this.read(); + if (n2 == 110) { + this.consume(117); + this.consume(108); + this.consume(108); + this.consume(59); + return null; + } + this.pushBack(n2); + } + n2 = this.readHex(); + this.consume(59); + stringBuffer.append((char)n2); + continue; + } + stringBuffer.append((char)n); + } + this.pushBack(n); + return stringBuffer.toString(); + } + + public final void consume(String string) throws IOException { + int n = string.length(); + for (int i = 0; i < n; ++i) { + this.consume(string.charAt(i)); + } + } + + public final void consume(int n) throws IOException { + int n2 = this.read(); + if (n2 == -1) { + throw new EOFException(); + } + if (n2 != n) { + throw this.error("Expected '" + this.toString(n) + "', got '" + this.toString(n2) + "'"); + } + } + + public final void close() throws IOException { + this.in.close(); + } + + public IOException error(String string) { + System.out.println("ERROR: MessageReader: " + string); + Thread.dumpStack(); + byte[] byArray = this.getHistory(); + System.out.println("--- History ---"); + MessageReader.hexDump(byArray); + byte[] byArray2 = this.getFuture(); + if (byArray2.length > 0) { + System.out.println("--- Future ---"); + MessageReader.hexDump(byArray2); + } + return new IOException(string); + } + + public static void hexDump(byte[] byArray) { + for (int i = 0; i < byArray.length; i += 16) { + StringBuffer stringBuffer = new StringBuffer(64); + StringBuffer stringBuffer2 = new StringBuffer(64); + for (int j = 0; j < 16 && i + j < byArray.length; ++j) { + int n = byArray[i + j] & 0xFF; + if (j % 4 == 0) { + stringBuffer.append(' '); + } + if (n < 16) { + stringBuffer.append('0'); + } + stringBuffer.append(Integer.toHexString(n)); + if (n < 32 || n > 127) { + stringBuffer2.append('.'); + continue; + } + stringBuffer2.append((char)n); + } + System.out.print(stringBuffer); + System.out.print(" "); + System.out.print(stringBuffer2); + System.out.println(); + } + } + + public byte[] getHistory() { + int n; + byte[] byArray = new byte[160]; + int n2 = this.historyIndex + 1; + int n3 = 160 - n2; + for (n = 0; n < n3; ++n) { + byArray[n] = this.history[n + n2]; + } + for (n = 0; n < n2; ++n) { + byArray[n + n3] = this.history[n]; + } + return byArray; + } + + public byte[] getFuture() { + try { + int n = this.in.available(); + int n2 = Math.min(n, 160); + if (n2 > 0) { + byte[] byArray = new byte[n2]; + for (int i = 0; i < byArray.length; ++i) { + byArray[i] = (byte)this.read(); + } + return byArray; + } + } + catch (IOException iOException) { + // empty catch block + } + return new byte[0]; + } + + public String toString(int n) { + if (n == 10) { + return "\\n"; + } + if (n < 32 || n > 126) { + return "0x" + Integer.toHexString(n); + } + return String.valueOf((char)n); + } + + static { + int n; + charMap = new byte[256]; + for (n = 97; n <= 122; ++n) { + MessageReader.charMap[n] = 1; + } + for (n = 65; n <= 90; ++n) { + MessageReader.charMap[n] = 1; + } + for (n = 48; n <= 57; ++n) { + MessageReader.charMap[n] = 7; + } + n = 97; + while (n <= 102) { + int n2 = n++; + charMap[n2] = (byte)(charMap[n2] | 4); + } + MessageReader.charMap[46] = 1; + MessageReader.charMap[45] = 1; + MessageReader.charMap[95] = 1; + MessageReader.charMap[36] = 1; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/message/MessageWriter.java b/modules/cfr_output/com/tridium/fox/message/MessageWriter.java new file mode 100644 index 0000000..e3ea564 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/message/MessageWriter.java @@ -0,0 +1,124 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.message; + +import java.io.IOException; +import java.io.OutputStream; + +public class MessageWriter { + public int indent = 0; + public boolean isDebug; + private OutputStream out; + + public MessageWriter(OutputStream outputStream, boolean bl) { + this.out = outputStream; + this.isDebug = bl; + } + + public MessageWriter(OutputStream outputStream) { + this.out = outputStream; + } + + public final MessageWriter write(int n) throws IOException { + this.out.write(n); + return this; + } + + public final MessageWriter write(byte[] byArray, int n, int n2) throws IOException { + if (this.isDebug) { + this.writeDebug(byArray, n, n2); + } else { + this.out.write(byArray, n, n2); + } + return this; + } + + public final MessageWriter write(byte[] byArray) throws IOException { + if (this.isDebug) { + this.writeDebug(byArray, 0, byArray.length); + } else { + this.out.write(byArray, 0, byArray.length); + } + return this; + } + + private void writeDebug(byte[] byArray, int n, int n2) throws IOException { + int n3 = Math.min(n2, 30); + for (int i = 0; i < n3; ++i) { + int n4 = byArray[i]; + if (n4 == 10) { + this.write(92).write(110); + continue; + } + if (n4 < 32 || n4 > 127) { + n4 = 63; + } + this.write(n4); + } + if (n3 < n2) { + this.write(46).write(46).write(46); + } + } + + public final void writeIndent() throws IOException { + for (int i = 0; i < this.indent; ++i) { + this.out.write(32); + } + } + + public final MessageWriter writeName(String string) throws IOException { + try { + int n = string.length(); + for (int i = 0; i < n; ++i) { + this.out.write(string.charAt(i)); + } + } + catch (NullPointerException nullPointerException) { + this.write(110).write(117).write(108).write(108); + } + return this; + } + + public final MessageWriter writeInt(int n) throws IOException { + return this.writeName(Integer.toString(n)); + } + + public final MessageWriter writeLong(long l) throws IOException { + return this.writeName(Long.toString(l)); + } + + public final MessageWriter writeHex(int n) throws IOException { + return this.writeName(Integer.toHexString(n)); + } + + public final MessageWriter writeHexLong(long l) throws IOException { + return this.writeName(Long.toHexString(l)); + } + + public final MessageWriter writeSafe(String string) throws IOException { + if (string == null) { + this.writeName("#null;"); + return this; + } + int n = string.length(); + for (int i = 0; i < n; ++i) { + char c = string.charAt(i); + if (c < ' ' || c > '\u007f' || c == '#') { + this.write(35).writeHex(c).write(59); + continue; + } + this.write(c); + } + return this; + } + + public final void flush() throws IOException { + this.out.flush(); + } + + public final void close() throws IOException { + this.out.close(); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/Fox.java b/modules/cfr_output/com/tridium/fox/session/Fox.java new file mode 100644 index 0000000..61afb05 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/Fox.java @@ -0,0 +1,299 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.Nre + * javax.baja.security.BICredentials + * javax.baja.sys.Clock + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.FoxConnection; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.session.ServerException; +import com.tridium.fox.session.Tuner; +import com.tridium.sys.Nre; +import java.io.IOException; +import java.net.InetAddress; +import java.net.Socket; +import java.util.Vector; +import javax.baja.security.BICredentials; + +public class Fox { + public static final int BASIC_AUTHENTICATION = 0; + public static final int DIGEST_AUTHENTICATION = 1; + public static final int TRANSACTIONAL_AUTHENTICATION = 2; + public static String MULTICAST_ADDRESS = "224.0.1.84"; + public static String IPV6_MULTICAST_ADDRESS = "FF02::137"; + public static final int MULTICAST_PORT = 1911; + public static final String UNKNOWN_STRING = "unknown"; + public static long sessionCloseTimeout = 10000L; + public static boolean ipv4Enabled = true; + public static boolean ipv6Enabled = false; + public static boolean multicastEnabled = true; + public static int requestTimeout = 60000; + public static int keepAliveInterval = 5000; + public static int soTimeout = 60000; + public static boolean tcpNoDelay = true; + public static boolean failsafeTimeouts = true; + public static int maxServerSessions = 100; + public static int maxQueueSize = 1000; + public static int circuitChunkSize = 4096; + public static int circuitMaxReceiveBuffer = 102400; + public static int multicastTimeToLive = 4; + public static boolean traceWriteFrame = false; + public static boolean traceReadFrame = false; + public static boolean traceSessionStates = false; + public static boolean traceMulticast = false; + public static boolean tunnelingEnabled = true; + public static boolean onlyTunnelKnownStations = false; + public static String appName = "unknown"; + public static String appVersion = "unknown"; + public static String vmName = System.getProperty("java.vm.name", "unknown"); + public static String vmVersion = System.getProperty("java.vm.version", "unknown"); + public static String osName = System.getProperty("os.name", "unknown"); + public static String osVersion = System.getProperty("os.version", "unknown"); + public static String hostAddress = ""; + public static String hostName; + public static ExceptionTranslator exceptionTranslator; + public static Clock clock; + public static final ThreadGroup threadGroup; + private static Vector sessions; + private static int serverSessionCount; + public static volatile int deadlocks; + static /* synthetic */ Class class$com$tridium$fox$session$Fox; + + private static boolean getBoolean(String string, boolean bl) { + String string2 = System.getProperty(string); + if (string2 == null) { + return bl; + } + return string2.equals("true"); + } + + private static int getInt(String string, int n) { + String string2 = System.getProperty(string); + if (string2 == null) { + return n; + } + return Integer.parseInt(string2); + } + + private static Object getInstance(String string, Object object) { + try { + String string2 = System.getProperty(string); + if (string2 == null) { + return object; + } + return (class$com$tridium$fox$session$Fox == null ? (class$com$tridium$fox$session$Fox = Fox.class$("com.tridium.fox.session.Fox")) : class$com$tridium$fox$session$Fox).getClassLoader().loadClass(string2).newInstance(); + } + catch (Throwable throwable) { + throwable.printStackTrace(); + return object; + } + } + + public static FoxSession open(FoxConnection foxConnection, Socket socket, String string, String string2) throws Exception { + return Fox.open(foxConnection, socket, string, string2, FoxSession.nullListeners); + } + + public static FoxSession open(FoxConnection foxConnection, Socket socket, String string, String string2, FoxSession.IFoxSessionListener[] iFoxSessionListenerArray) throws Exception { + return Tuner.openClient(foxConnection, socket, string, string2, iFoxSessionListenerArray); + } + + public static FoxSession open(FoxConnection foxConnection, Socket socket, BICredentials bICredentials, FoxSession.IFoxSessionListener[] iFoxSessionListenerArray) throws Exception { + return Tuner.openClient(foxConnection, socket, bICredentials, iFoxSessionListenerArray); + } + + public static FoxSession getSession(int n) { + for (int i = 0; i < sessions.size(); ++i) { + FoxSession foxSession = (FoxSession)sessions.elementAt(i); + if (foxSession.getId() != n) continue; + return foxSession; + } + return null; + } + + public static int getServerSessionCount() { + return serverSessionCount; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public static FoxSession[] getSessions() { + Vector vector = sessions; + synchronized (vector) { + Object[] objectArray = new FoxSession[sessions.size()]; + sessions.copyInto(objectArray); + return objectArray; + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + static void register(FoxSession foxSession) { + Vector vector = sessions; + synchronized (vector) { + sessions.addElement(foxSession); + if (foxSession.isServer()) { + ++serverSessionCount; + } + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + static void unregister(FoxSession foxSession) { + Vector vector = sessions; + synchronized (vector) { + for (int i = 0; i < sessions.size(); ++i) { + if (sessions.elementAt(i) != foxSession) continue; + if (foxSession.isServer()) { + --serverSessionCount; + } + sessions.removeElementAt(i); + break; + } + } + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + try { + hostAddress = InetAddress.getLocalHost().getHostAddress(); + } + catch (Exception exception) { + // empty catch block + } + hostName = ""; + try { + hostName = InetAddress.getLocalHost().getHostName(); + } + catch (Exception exception) { + // empty catch block + } + exceptionTranslator = new ExceptionTranslator(); + try { + clock = new DefaultClock(); + } + catch (Throwable throwable) { + throwable.printStackTrace(); + } + threadGroup = new ThreadGroup(Nre.findMainThreadGroup((ThreadGroup)Thread.currentThread().getThreadGroup()), "fox"); + try { + soTimeout = Fox.getInt("niagara.fox.soTimeout", soTimeout); + tcpNoDelay = Fox.getBoolean("niagara.fox.tcpNoDelay", tcpNoDelay); + keepAliveInterval = Fox.getInt("niagara.fox.keepAliveInterval", keepAliveInterval); + requestTimeout = Fox.getInt("niagara.fox.requestTimeout", requestTimeout); + maxServerSessions = Fox.getInt("niagara.fox.maxServerSessions", maxServerSessions); + maxQueueSize = Fox.getInt("niagara.fox.maxQueueSize", maxQueueSize); + circuitChunkSize = Fox.getInt("niagara.fox.circuitChunkSize", circuitChunkSize); + circuitMaxReceiveBuffer = Fox.getInt("niagara.fox.circuitMaxReceiveBuffer", circuitMaxReceiveBuffer); + failsafeTimeouts = Fox.getBoolean("niagara.fox.failsafeTimeouts", failsafeTimeouts); + multicastTimeToLive = Fox.getInt("niagara.fox.multicastTimeToLive", multicastTimeToLive); + exceptionTranslator = (ExceptionTranslator)Fox.getInstance("niagara.fox.exceptionTranslator", exceptionTranslator); + traceWriteFrame = Fox.getBoolean("niagara.fox.traceWriteFrame", traceWriteFrame); + traceReadFrame = Fox.getBoolean("niagara.fox.traceReadFrame", traceReadFrame); + traceSessionStates = Fox.getBoolean("niagara.fox.traceSessionStates", traceSessionStates); + traceMulticast = Fox.getBoolean("niagara.fox.traceMulticast", traceMulticast); + tunnelingEnabled = Fox.getBoolean("niagara.fox.tunnelingEnabled", tunnelingEnabled); + onlyTunnelKnownStations = Fox.getBoolean("niagara.fox.onlyTunnelKnownStations", onlyTunnelKnownStations); + ipv6Enabled = Fox.getBoolean("niagara.ipv6Enabled", ipv6Enabled); + multicastEnabled = Fox.getBoolean("niagara.fox.multicastEnabled", multicastEnabled); + sessionCloseTimeout = Long.getLong("niagara.fox.sessionCloseTimeout", sessionCloseTimeout); + } + catch (Throwable throwable) { + throwable.printStackTrace(); + } + FailsafeTimeoutThread failsafeTimeoutThread = new FailsafeTimeoutThread(); + failsafeTimeoutThread.setDaemon(true); + failsafeTimeoutThread.start(); + sessions = new Vector(); + deadlocks = 0; + } + + static class FailsafeTimeoutThread + extends Thread { + FailsafeTimeoutThread() { + super(threadGroup, "Fox:FailsafeTimeout"); + } + + /* + * Unable to fully structure code + */ + public void run() { + while (true) { + try { + block3: while (true) { + Thread.sleep(10000L); + if (!Fox.failsafeTimeouts) continue; + var1_1 = Fox.getSessions(); + var2_3 = 0; + while (true) { + if (var2_3 < var1_1.length) ** break; + continue block3; + var3_4 = var1_1[var2_3]; + var4_5 = Fox.clock.ticks() - var3_4.getLastReadTicks(); + var6_6 = Fox.clock.ticks() - var3_4.getLastWriteTicks(); + if (var4_5 > (long)Fox.soTimeout) { + var8_7 = new IOException("Failsafe timeout on read " + var4_5 + " > " + Fox.soTimeout); + System.out.println("ERROR: " + var8_7.getMessage()); + var3_4.close(var8_7); + } else if (var6_6 > (long)Fox.soTimeout) { + var8_7 = new IOException("Failsafe timeout on write " + var6_6 + " > " + Fox.soTimeout); + System.out.println("ERROR: " + var8_7.getMessage()); + var3_4.close(var8_7); + } + ++var2_3; + } + break; + } + } + catch (Exception var1_2) { + var1_2.printStackTrace(); + continue; + } + break; + } + } + } + + private static class DefaultClock + extends Clock { + private DefaultClock() { + } + + public long ticks() { + return javax.baja.sys.Clock.ticks(); + } + } + + public static abstract class Clock { + public abstract long ticks(); + } + + public static class ExceptionTranslator { + public FoxMessage exceptionToMessage(Throwable throwable) { + FoxMessage foxMessage = new FoxMessage(); + foxMessage.add("exception", throwable.toString()); + return foxMessage; + } + + public Exception messageToException(FoxMessage foxMessage) throws IOException { + return new ServerException(foxMessage.getString("exception")); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/FoxAsyncCallbacks.java b/modules/cfr_output/com/tridium/fox/session/FoxAsyncCallbacks.java new file mode 100644 index 0000000..20e0afa --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/FoxAsyncCallbacks.java @@ -0,0 +1,12 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.FoxSession; + +public interface FoxAsyncCallbacks { + public void asyncMessageSent(FoxSession var1, FoxMessage var2); +} + diff --git a/modules/cfr_output/com/tridium/fox/session/FoxAuthenticationException.java b/modules/cfr_output/com/tridium/fox/session/FoxAuthenticationException.java new file mode 100644 index 0000000..ccc6ade --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/FoxAuthenticationException.java @@ -0,0 +1,38 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.FoxSession; + +public class FoxAuthenticationException +extends Exception { + public String method = null; + public String fatal = null; + public FoxSession session; + public FoxMessage data = new FoxMessage(); + + public FoxAuthenticationException(String string, String string2, String string3, FoxSession foxSession) { + super(string); + this.method = string2; + this.fatal = string3; + this.session = foxSession; + } + + public FoxAuthenticationException(String string, String string2, FoxSession foxSession) { + super(string); + this.method = string2; + this.session = foxSession; + } + + public FoxAuthenticationException(String string, FoxSession foxSession) { + super(string); + this.session = foxSession; + } + + public FoxAuthenticationException(FoxSession foxSession) { + this.session = foxSession; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/FoxAuthenticationUtil.java b/modules/cfr_output/com/tridium/fox/session/FoxAuthenticationUtil.java new file mode 100644 index 0000000..61ed796 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/FoxAuthenticationUtil.java @@ -0,0 +1,31 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +public class FoxAuthenticationUtil { + public static final String FOX_VERSION = "1.0.1"; + public static final String FOX_MTD_BASIC_AUTH = "basic"; + public static final String FOX_MTD_DIGEST_AUTH = "digest"; + public static final String FOX_MTD_DIGEST_AUTH_LEGACY = "digest-md5"; + public static final String FOX_MTD_KERBEROS_AUTH = "kerberos"; + public static final String CMD_LOGIN = "login"; + public static final String CMD_RESET = "accountReset"; + public static final String CMD_AUTH_FIRST_MESSAGE = "authMessage1"; + public static final String CMD_AUTH_SECOND_MESSAGE = "authMessage2"; + public static final String KEY_AUTH_INPUT = "authInput"; + public static final String KEY_AUTH_INPUT_HTTP = "authInputHttp"; + public static final String KEY_AUTH_INPUT_SCRAM = "authInputScram"; + public static final String KEY_AUTH_INPUT_RETRIEVE = "authInputRetrieve"; + public static final String KEY_HANDSHAKE_ONE = "authHandshake1"; + public static final String KEY_HANDSHAKE_TWO = "authHandshake2"; + public static final String KEY_AUTH_INPUT_LOCAL = "authInputLocal"; + public static final String KEY_AUTH_INPUT_KERB = "authInputKerb"; + public static final String KEY_CREDENTIALS = "credentials"; + public static final String KEY_NONCE = "nonce"; + public static final String KEY_DIGEST = "digest"; + public static final String KEY_PASSWORD = "password"; + public static final String KEY_USERNAME = "username"; + public static final String KEY_EMAIL = "email"; +} + diff --git a/modules/cfr_output/com/tridium/fox/session/FoxBusyException.java b/modules/cfr_output/com/tridium/fox/session/FoxBusyException.java new file mode 100644 index 0000000..f88664a --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/FoxBusyException.java @@ -0,0 +1,9 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +public class FoxBusyException +extends Exception { +} + diff --git a/modules/cfr_output/com/tridium/fox/session/FoxCircuit.java b/modules/cfr_output/com/tridium/fox/session/FoxCircuit.java new file mode 100644 index 0000000..25c2bbf --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/FoxCircuit.java @@ -0,0 +1,353 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.message.MessageReader; +import com.tridium.fox.message.MessageWriter; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxAsyncCallbacks; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxSession; +import java.io.IOException; +import java.io.InputStream; +import java.io.InterruptedIOException; +import java.io.OutputStream; + +public class FoxCircuit { + private static final boolean TRACE = false; + public final int id; + public final String channel; + public final String command; + boolean open = true; + FoxSession session; + CircuitOutputStream out; + CircuitInputStream in; + Object outgoingLock = new Object(); + byte[] outgoing = new byte[Fox.circuitChunkSize]; + int nOutgoing; + Object incomingLock = new Object(); + BufferEntry incomingHead = null; + BufferEntry incomingTail = null; + int nIncoming; + + FoxCircuit(int n, FoxSession foxSession, String string, String string2) { + this.id = n; + this.session = foxSession; + this.channel = string; + this.command = string2; + this.out = new CircuitOutputStream(); + this.in = new CircuitInputStream(); + } + + public boolean isOpen() { + return this.open; + } + + public FoxSession session() { + return this.session; + } + + public InputStream getInputStream() { + return this.in; + } + + public OutputStream getOutputStream() { + return this.out; + } + + public FoxMessage readMessage() throws Exception { + MessageReader messageReader = new MessageReader(this.in); + FoxMessage foxMessage = new FoxMessage(); + foxMessage.readValue(messageReader); + return foxMessage; + } + + public void writeMessage(FoxMessage foxMessage) throws Exception { + MessageWriter messageWriter = new MessageWriter(this.out); + foxMessage.writeValue(messageWriter); + messageWriter.flush(); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public FoxMessage write(byte[] byArray, int n, int n2, FoxAsyncCallbacks foxAsyncCallbacks) throws Exception { + if (foxAsyncCallbacks == null) { + this.out.write(byArray, n, n2); + return null; + } + Object object = this.outgoingLock; + synchronized (object) { + int n3; + this.flush(); + byte[] byArray2 = new byte[n2]; + System.arraycopy(byArray, n, byArray2, 0, n2); + FoxRequest foxRequest = null; + int n4 = n2; + for (int i = 0; i != n4; i += n3) { + int n5 = n4 - i; + foxRequest = this.sendStream(byArray2, i, n3, (n3 = Math.min(Fox.circuitChunkSize, n5)) == n5 ? foxAsyncCallbacks : null); + } + return foxRequest; + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void close() { + if (!this.open) { + return; + } + try { + this.flush(); + } + catch (IOException iOException) { + // empty catch block + } + this.session.closeCircuit(this); + this.open = false; + Object object = this.incomingLock; + synchronized (object) { + this.incomingLock.notifyAll(); + } + object = this.outgoingLock; + synchronized (object) { + this.outgoingLock.notifyAll(); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + void writeOut(byte[] byArray, int n, int n2) throws IOException { + this.assertOpen(); + Object object = this.outgoingLock; + synchronized (object) { + while (this.open && n2 > 0) { + int n3 = Math.min(this.outgoing.length - this.nOutgoing, n2); + System.arraycopy(byArray, n, this.outgoing, this.nOutgoing, n3); + this.nOutgoing += n3; + n += n3; + n2 -= n3; + if (this.nOutgoing < this.outgoing.length) continue; + this.flush(); + } + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void flush() throws IOException { + Object object = this.outgoingLock; + synchronized (object) { + if (this.open && this.nOutgoing > 0) { + try { + this.sendStream(this.outgoing, this.nOutgoing); + this.outgoing = new byte[Fox.circuitChunkSize]; + this.nOutgoing = 0; + } + catch (IOException iOException) { + throw iOException; + } + catch (Exception exception) { + exception.printStackTrace(); + throw new IOException(exception.toString()); + } + } + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + void pushIn(byte[] byArray) throws InterruptedException { + if (byArray.length == 0) { + return; + } + Object object = this.incomingLock; + synchronized (object) { + while (this.open && this.incomingHead != null && this.nIncoming + byArray.length > Fox.circuitMaxReceiveBuffer) { + this.incomingLock.wait(); + } + BufferEntry bufferEntry = new BufferEntry(byArray); + if (this.incomingHead == null) { + this.incomingHead = bufferEntry; + } + if (this.incomingTail != null) { + this.incomingTail.next = bufferEntry; + } + this.incomingTail = bufferEntry; + this.nIncoming += byArray.length; + this.incomingLock.notifyAll(); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + int pullIn(byte[] byArray, int n, int n2) throws IOException { + Object object = this.incomingLock; + synchronized (object) { + BufferEntry bufferEntry; + while (this.nIncoming <= 0) { + if (!this.open) { + return -1; + } + try { + this.incomingLock.wait(); + } + catch (InterruptedException interruptedException) { + throw new InterruptedIOException(); + } + } + int n3 = 0; + while (n2 > 0 && (bufferEntry = this.incomingHead) != null) { + int n4 = Math.min(bufferEntry.avail, n2); + System.arraycopy(bufferEntry.data, bufferEntry.data.length - bufferEntry.avail, byArray, n, n4); + n3 += n4; + n += n4; + n2 -= n4; + bufferEntry.avail -= n4; + if (bufferEntry.avail > 0) continue; + this.incomingHead = bufferEntry.next; + if (this.incomingTail == bufferEntry) { + this.incomingTail = null; + } + bufferEntry.next = null; + } + this.nIncoming -= n3; + this.incomingLock.notifyAll(); + return n3; + } + } + + private void assertOpen() throws IOException { + if (!this.open) { + throw new IOException("circuit closed"); + } + } + + void sendOpen() throws Exception { + FoxRequest foxRequest = new FoxRequest("circuit", "open"); + foxRequest.add("id", this.id); + foxRequest.add("channel", this.channel); + foxRequest.add("command", this.command); + this.session.sendAsync(foxRequest); + } + + void sendStream(byte[] byArray, int n) throws Exception { + FoxRequest foxRequest = new FoxRequest("circuit", "stream"); + foxRequest.add("id", this.id); + foxRequest.add("data", byArray, n); + this.session.sendAsync(foxRequest); + } + + FoxRequest sendStream(byte[] byArray, int n, int n2, FoxAsyncCallbacks foxAsyncCallbacks) throws Exception { + FoxRequest foxRequest = new FoxRequest("circuit", "stream"); + foxRequest.add("id", this.id); + foxRequest.add("data", byArray, n, n2); + this.session.sendAsync(foxRequest, foxAsyncCallbacks); + return foxRequest; + } + + void sendClose() throws Exception { + if (this.open && !this.session.isClosed()) { + FoxRequest foxRequest = new FoxRequest("circuit", "close"); + foxRequest.add("id", this.id); + this.session.sendAsync(foxRequest); + } + } + + public String toString() { + return "Circuit [" + this.session.getId() + "] " + this.channel + "." + this.command + " out=" + this.nOutgoing + " in=" + this.nIncoming + " open=" + this.open; + } + + public void dumpIncomingList() { + System.out.println("Incoming List:"); + System.out.println(" head=" + this.incomingHead); + System.out.println(" tail=" + this.incomingTail); + System.out.println(" chain="); + BufferEntry bufferEntry = this.incomingHead; + while (bufferEntry != null) { + System.out.println(" " + bufferEntry); + bufferEntry = bufferEntry.next; + } + } + + private static void trace(String string) { + System.out.println(string); + } + + static class BufferEntry { + byte[] data; + int avail; + BufferEntry next; + + BufferEntry(byte[] byArray) { + this.data = byArray; + this.avail = byArray.length; + } + + public String toString() { + return Integer.toString(System.identityHashCode(this), 36) + " avail=" + this.avail + " length=" + this.data.length; + } + } + + class CircuitInputStream + extends InputStream { + byte[] temp = new byte[1]; + + CircuitInputStream() { + } + + public int read() throws IOException { + return this.read(this.temp, 0, 1) <= 0 ? -1 : this.temp[0] & 0xFF; + } + + public int read(byte[] byArray) throws IOException { + return this.read(byArray, 0, byArray.length); + } + + public int read(byte[] byArray, int n, int n2) throws IOException { + return FoxCircuit.this.pullIn(byArray, n, n2); + } + + public void close() throws IOException { + FoxCircuit.this.close(); + } + } + + class CircuitOutputStream + extends OutputStream { + byte[] temp = new byte[1]; + + CircuitOutputStream() { + } + + public void write(int n) throws IOException { + this.temp[0] = (byte)n; + this.write(this.temp, 0, 1); + } + + public void write(byte[] byArray) throws IOException { + this.write(byArray, 0, byArray.length); + } + + public void write(byte[] byArray, int n, int n2) throws IOException { + FoxCircuit.this.writeOut(byArray, n, n2); + } + + public void flush() throws IOException { + FoxCircuit.this.flush(); + } + + public void close() { + FoxCircuit.this.close(); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/FoxConnection.java b/modules/cfr_output/com/tridium/fox/session/FoxConnection.java new file mode 100644 index 0000000..ba4ba25 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/FoxConnection.java @@ -0,0 +1,36 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.FoxCircuit; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.FoxSession; +import java.net.Socket; + +public interface FoxConnection { + public void initHello(FoxMessage var1) throws Exception; + + public void sessionOpened(FoxSession var1); + + public FoxResponse process(FoxRequest var1) throws Throwable; + + public void circuitOpened(FoxCircuit var1) throws Throwable; + + public void sessionClosed(FoxSession var1, Throwable var2); + + public void error(String var1, Throwable var2); + + public Thread makeThread(ThreadGroup var1, Runnable var2, String var3); + + public boolean isTunnelClientConnection(); + + public boolean isTunnelServerConnection(); + + public String[] getTunnelAuthorities(); + + public Socket createTunnelSocket(String var1, boolean var2) throws Exception; +} + diff --git a/modules/cfr_output/com/tridium/fox/session/FoxFrame.java b/modules/cfr_output/com/tridium/fox/session/FoxFrame.java new file mode 100644 index 0000000..7666cd1 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/FoxFrame.java @@ -0,0 +1,96 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.message.MessageReader; +import com.tridium.fox.message.MessageWriter; +import com.tridium.fox.session.FoxAsyncCallbacks; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import java.io.IOException; +import java.io.OutputStream; + +public class FoxFrame { + public static final int SYNC = 115; + public static final int ASYNC = 97; + public static final int REPLY = 114; + public static final int ERROR = 101; + public static final int NULL = 110; + public static final int KEEPALIVE = 107; + public final int frameType; + public final int sequenceNumber; + public final int replyNumber; + public final String channel; + public final String command; + public final FoxMessage message; + FoxAsyncCallbacks callbacks; + FoxFrame next; + + public FoxFrame(int n, int n2, int n3, String string, String string2, FoxMessage foxMessage) { + this.frameType = n; + this.sequenceNumber = n2; + this.replyNumber = n3; + this.channel = string; + this.command = string2; + this.message = foxMessage; + } + + public final void write(MessageWriter messageWriter) throws IOException { + this.writeHeader(messageWriter); + this.message.writeValue(messageWriter); + this.writeFooter(messageWriter); + } + + private final void writeHeader(MessageWriter messageWriter) throws IOException { + messageWriter.write(102).write(111).write(120).write(32).write(this.frameType).write(32).writeInt(this.sequenceNumber).write(32).writeInt(this.replyNumber).write(32).writeName(this.channel).write(32).writeName(this.command).write(10); + } + + private final void writeFooter(MessageWriter messageWriter) throws IOException { + messageWriter.write(59).write(59).write(10); + } + + public static FoxFrame read(MessageReader messageReader) throws IOException { + messageReader.consume("fox "); + int n = messageReader.read(); + messageReader.consume(32); + int n2 = messageReader.readInt(); + messageReader.consume(32); + int n3 = messageReader.readInt(); + messageReader.consume(32); + String string = messageReader.readName().intern(); + messageReader.consume(32); + String string2 = messageReader.readName().intern(); + messageReader.consume(10); + FoxMessage foxMessage = n == 97 || n == 115 ? new FoxRequest(string, string2) : (n == 114 ? new FoxResponse() : new FoxMessage()); + foxMessage.readValue(messageReader); + messageReader.consume(59); + messageReader.consume(59); + messageReader.consume(10); + return new FoxFrame(n, n2, n3, string, string2, foxMessage); + } + + public String toString() { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(this.frameType).append(' ').append(this.sequenceNumber).append(' ').append(this.replyNumber).append(' ').append(this.channel).append(' ').append(this.command); + return stringBuffer.toString(); + } + + public void dump(OutputStream outputStream) { + try { + MessageWriter messageWriter = new MessageWriter(outputStream, true); + this.write(messageWriter); + messageWriter.flush(); + } + catch (IOException iOException) { + iOException.printStackTrace(); + throw new RuntimeException(iOException.toString()); + } + } + + public void dump() { + this.dump(System.out); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/FoxRequest.java b/modules/cfr_output/com/tridium/fox/session/FoxRequest.java new file mode 100644 index 0000000..dc6893c --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/FoxRequest.java @@ -0,0 +1,19 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxMessage; + +public class FoxRequest +extends FoxMessage { + public final String channel; + public final String command; + + public FoxRequest(String string, String string2) { + super(string + "." + string2); + this.channel = string; + this.command = string2; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/FoxResponse.java b/modules/cfr_output/com/tridium/fox/session/FoxResponse.java new file mode 100644 index 0000000..2fa9f84 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/FoxResponse.java @@ -0,0 +1,17 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.FoxRequest; + +public class FoxResponse +extends FoxMessage { + public FoxResponse(FoxRequest foxRequest) { + } + + public FoxResponse() { + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/FoxServer.java b/modules/cfr_output/com/tridium/fox/session/FoxServer.java new file mode 100644 index 0000000..a4bc9b1 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/FoxServer.java @@ -0,0 +1,252 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.log.Log + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxConnection; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.session.MulticastServer; +import com.tridium.fox.session.Tuner; +import java.io.IOException; +import java.net.BindException; +import java.net.ServerSocket; +import java.net.Socket; +import javax.baja.log.Log; + +public abstract class FoxServer { + private static final String FOX = "fox"; + private static final String FOXS = "foxs"; + private static Log log = Log.getLog((String)"fox"); + protected int foxPort = -1; + protected int foxsPort = -1; + private boolean alive = true; + private Thread foxThread; + private ServerSocket foxServerSocket; + private boolean foxRunning = false; + private Thread foxsThread; + private ServerSocket foxsServerSocket; + private boolean foxsRunning = false; + private MulticastServer multicastServer; + + public FoxServer() { + this.foxPort = 1911; + this.foxsPort = 4911; + } + + public FoxServer(int n, int n2) { + this.foxPort = n; + this.foxsPort = n2; + } + + public MulticastServer getMulticastServer() { + return this.multicastServer; + } + + public void run() throws Exception { + if (this.foxThread != null || this.foxsThread != null) { + throw new IllegalStateException("Server already running"); + } + this.alive = true; + if (this.foxPort >= 0) { + this.foxThread = new Thread(new MainLoop(FOX), "Fox:Server"); + this.foxThread.start(); + } + if (this.foxsPort >= 0) { + this.foxsThread = new Thread(new MainLoop(FOXS), "Foxs:Server"); + this.foxsThread.start(); + } + try { + if (Fox.multicastEnabled) { + this.multicastServer = new MulticastServer(this); + this.multicastServer.start(); + } else { + log.message("Multicast disabled (no station discovery supported)"); + } + } + catch (Exception exception) { + System.out.println("ERROR: Cannot open Fox multicast socket: " + exception); + } + } + + private void runFox() { + this.foxRunning = true; + this.run(FOX); + this.foxRunning = false; + } + + private void runFoxs() { + this.foxsRunning = true; + this.run(FOXS); + this.foxsRunning = false; + } + + public boolean isServing() { + return this.foxServerSocket != null || this.foxsServerSocket != null; + } + + public boolean isRunning() { + return this.foxRunning || this.foxsRunning; + } + + public boolean isFoxRunning() { + return this.foxRunning; + } + + public boolean isFoxsRunning() { + return this.foxsRunning; + } + + public ServerSocket getFoxServerSocket() throws IOException { + return new ServerSocket(this.foxPort); + } + + public ServerSocket getFoxsServerSocket() throws IOException { + throw new UnsupportedOperationException("FOXS not supported."); + } + + private void run(String string) { + ServerSocket serverSocket = null; + int n = 1911; + block13: while (this.alive) { + try { + if (string.equalsIgnoreCase(FOX)) { + n = this.foxPort; + serverSocket = this.foxServerSocket = this.getFoxServerSocket(); + } else { + n = this.foxsPort; + serverSocket = this.foxsServerSocket = this.getFoxsServerSocket(); + } + } + catch (BindException bindException) { + log.error(string.toUpperCase() + " server failed to bind to port [" + n + "] " + bindException); + serverSocket = null; + try { + Thread.sleep(5000L); + } + catch (InterruptedException interruptedException) {} + } + catch (IllegalArgumentException illegalArgumentException) { + if (log.isTraceOn()) { + log.error(string.toUpperCase() + " server failed to start on port [" + n + "]\n ", (Throwable)illegalArgumentException); + } else { + log.error(string.toUpperCase() + " server failed to start on port [" + n + "]\n " + illegalArgumentException.getLocalizedMessage()); + } + return; + } + catch (IOException iOException) { + if (log.isTraceOn()) { + log.error(string.toUpperCase() + " server failed to start on port. [" + n + "]\n ", (Throwable)iOException); + } else { + log.error(string.toUpperCase() + " server failed to start on port. [" + n + "]\n " + iOException.getLocalizedMessage()); + } + return; + } + if (serverSocket == null) continue; + try { + log.message(string.toUpperCase() + " server started on port [" + n + "]"); + Socket socket = null; + while (this.alive) { + try { + socket = serverSocket.accept(); + if (!this.alive) continue block13; + Tuner.openServer(this, socket, string); + } + catch (IOException iOException) { + if (this.alive && (iOException.getClass().getName().equals("javax.net.ssl.SSLHandshakeException") || iOException.getClass().getName().equals("iaik.security.ssl.SSLException"))) { + if (log.isTraceOn()) { + log.warning("Server accept " + iOException.getClass().getName() + ": " + iOException.getLocalizedMessage(), (Throwable)iOException); + continue; + } + log.warning("Server accept " + iOException.getClass().getName() + ": " + iOException.getLocalizedMessage()); + continue; + } + if (!this.alive) continue; + log.message("Server accept exception: " + iOException.getLocalizedMessage()); + } + catch (Throwable throwable) {} + } + } + catch (Throwable throwable) { + if (!this.alive) continue; + log.error(string + ": Error in main loop.", throwable); + } + } + log.message(string.toUpperCase() + " server stopped on port [" + n + "]"); + if (serverSocket != null) { + try { + serverSocket.close(); + } + catch (Exception exception) { + // empty catch block + } + } + } + + public void stop() { + if (this.foxThread != null) { + this.alive = false; + this.foxThread.interrupt(); + this.foxThread = null; + if (this.foxServerSocket != null) { + try { + this.foxServerSocket.close(); + } + catch (Exception exception) { + // empty catch block + } + this.foxServerSocket = null; + } + } + if (this.foxsThread != null) { + this.alive = false; + this.foxsThread.interrupt(); + this.foxsThread = null; + if (this.foxsServerSocket != null) { + try { + this.foxsServerSocket.close(); + } + catch (Exception exception) { + // empty catch block + } + this.foxsServerSocket = null; + } + } + if (this.multicastServer != null) { + this.multicastServer.kill(); + this.multicastServer = null; + } + } + + public abstract FoxConnection makeConnection(FoxSession var1, FoxMessage var2) throws Exception; + + public abstract FoxMessage getAnnouncement(); + + public abstract int getAuthenticationPolicy(); + + public abstract boolean authenticateBasic(FoxSession var1, String var2, String var3) throws Exception; + + public abstract boolean authenticateDigest(FoxSession var1, String var2, byte[] var3, byte[] var4) throws Exception; + + private class MainLoop + implements Runnable { + private String scheme; + + public MainLoop(String string) { + this.scheme = string; + } + + public void run() { + if (this.scheme.equals(FoxServer.FOX)) { + FoxServer.this.runFox(); + } else { + FoxServer.this.runFoxs(); + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/FoxSession.java b/modules/cfr_output/com/tridium/fox/session/FoxSession.java new file mode 100644 index 0000000..eb3a01c --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/FoxSession.java @@ -0,0 +1,1091 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.nre.util.DeadlockUtil + * com.tridium.nre.util.Version + * com.tridium.sys.license.Brand + * com.tridium.sys.station.Station + * javax.baja.log.Log + * javax.baja.nre.util.Array + * javax.baja.security.AuditEvent + * javax.baja.security.Auditor + * javax.baja.sys.BObject + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.user.BUser + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.message.FoxString; +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.message.MessageReader; +import com.tridium.fox.message.MessageWriter; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxAsyncCallbacks; +import com.tridium.fox.session.FoxBusyException; +import com.tridium.fox.session.FoxCircuit; +import com.tridium.fox.session.FoxConnection; +import com.tridium.fox.session.FoxFrame; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.FoxsRedirectException; +import com.tridium.fox.session.InvalidChannelException; +import com.tridium.fox.session.InvalidCommandException; +import com.tridium.fox.session.SessionBedroom; +import com.tridium.fox.session.SessionCircuits; +import com.tridium.fox.session.SessionDispatcher; +import com.tridium.fox.session.SessionReceiver; +import com.tridium.fox.session.SessionSender; +import com.tridium.fox.session.TunnelReceiver; +import com.tridium.nre.util.DeadlockUtil; +import com.tridium.nre.util.Version; +import com.tridium.sys.license.Brand; +import com.tridium.sys.station.Station; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintWriter; +import java.net.Socket; +import java.util.Date; +import javax.baja.log.Log; +import javax.baja.nre.util.Array; +import javax.baja.security.AuditEvent; +import javax.baja.security.Auditor; +import javax.baja.sys.BObject; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.user.BUser; + +public class FoxSession { + private static Object idLock = new Object(); + private static int nextId = 0; + static final String TUNNEL_AUTHORITY = "tunnelAuthority"; + static final String FW_TUNNEL_AUTHORITY = "fwTunnelAuth"; + static final String FW_STATION_TUNNEL_AUTHORITY = "fwSTunnelAuth"; + static final int FW_FOX_SESSION_ID = 801; + static final int FW_STATION_FOX_SESSION_ID = 802; + public static final Integer NON_FW_FOX_SESSION = new Integer(-1); + public static final Integer FW_FOX_SESSION = new Integer(801); + public static final Integer FW_STATION_FOX_SESSION = new Integer(802); + public static final String STARTING = "starting"; + public static final String RUNNING = "running"; + public static final String CLOSING = "closing"; + public static final String CLOSED = "closed"; + private static FoxMessage emptyMessage = new FoxMessage(); + private static Class SSLSocketClass = null; + public Object extra; + public Object sessionStateLock = new Object(); + private int id; + private long connectTime; + private Socket socket; + private MessageReader in; + private MessageWriter out; + private boolean isServer; + private String string; + private Object sendLock = new Object(); + private int localNextSequence; + private int remoteNextSequence; + private FoxMessage remoteHello; + private int remoteId; + private int readCount; + private int writtenCount; + private volatile long lastReadTicks; + private volatile long lastWriteTicks; + private volatile boolean isClosed; + private Throwable closeCause; + private String state = ""; + private SessionSender sender; + private SessionReceiver receiver; + private SessionDispatcher dispatcher; + private SessionBedroom bedroom; + private SessionCircuits circuits; + FoxConnection conn; + FoxMessage remoteWelcome; + private Socket tunnelSocket; + private MessageReader tunnelIn; + private MessageWriter tunnelOut; + private TunnelReceiver tunnelReceiver; + public static final IFoxSessionListener[] nullListeners; + private static volatile IFoxSessionListenerFactory[] listenerFactories; + private volatile IFoxSessionListener[] listeners = nullListeners; + public boolean promptForPasswordReset = true; + BUser user; + Context sessionContext; + public static Log deadlockLog; + private static Object deadlockReboot; + static /* synthetic */ Class class$com$tridium$fox$session$FoxSession; + static /* synthetic */ Class class$com$tridium$fox$session$FoxSession$IFoxSessionListenerFactory; + static /* synthetic */ Class class$com$tridium$fox$session$FoxSession$IFoxSessionListener; + + public FoxSession(Socket socket, FoxConnection foxConnection) throws IOException { + this(socket, foxConnection, nullListeners); + this.initListeners(); + } + + public FoxSession(Socket socket, FoxConnection foxConnection, IFoxSessionListener[] iFoxSessionListenerArray) throws IOException { + this.id = FoxSession.nextId(); + this.conn = foxConnection; + this.socket = socket; + this.isServer = foxConnection == null || foxConnection.isTunnelServerConnection(); + this.connectTime = System.currentTimeMillis(); + this.in = new MessageReader(new BufferedInputStream(socket.getInputStream())); + this.out = new MessageWriter(new BufferedOutputStream(socket.getOutputStream())); + this.localNextSequence = this.isServer ? 0 : 1; + this.remoteNextSequence = this.isServer ? 1 : 0; + this.sender = new SessionSender(this); + this.receiver = new SessionReceiver(this); + this.dispatcher = new SessionDispatcher(this); + this.bedroom = new SessionBedroom(); + this.circuits = new SessionCircuits(this); + this.lastReadTicks = Fox.clock.ticks(); + this.lastWriteTicks = Fox.clock.ticks(); + socket.setSoTimeout(Fox.soTimeout); + socket.setTcpNoDelay(Fox.tcpNoDelay); + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(this.id).append(": ").append(this.isServer ? "Server " : "Client "); + if (!this.isServer) { + stringBuffer.append(socket.getLocalPort()).append("->"); + } + stringBuffer.append(this.getRemoteHost()).append(':').append(this.getRemotePort()); + this.string = stringBuffer.toString(); + this.listeners = iFoxSessionListenerArray; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + private static int nextId() { + Object object = idLock; + synchronized (object) { + return nextId++; + } + } + + public int getId() { + return this.id; + } + + public String getRemoteHost() { + return this.socket.getInetAddress().getHostAddress(); + } + + public int getRemotePort() { + return this.socket.getPort(); + } + + public FoxMessage getRemoteHello() { + return this.remoteHello; + } + + public FoxMessage getRemoteWelcome() { + return this.remoteWelcome; + } + + public int getRemoteId() { + return this.remoteId; + } + + public FoxConnection conn() { + return this.conn; + } + + public boolean isServer() { + return this.isServer; + } + + public boolean isClosed() { + return this.isClosed; + } + + public long getConnectTime() { + return this.connectTime; + } + + public int getFramesReadCount() { + return this.readCount; + } + + public int getFramesWrittenCount() { + return this.writtenCount; + } + + public long getLastReadTicks() { + return this.lastReadTicks; + } + + public long getLastWriteTicks() { + return this.lastWriteTicks; + } + + public final String getState() { + return this.state; + } + + public final String toString() { + return this.string; + } + + public final BUser getUser() { + return this.user; + } + + public final void setUser(BUser bUser) { + this.user = bUser; + } + + public final Context getSessionContext() { + return this.sessionContext; + } + + public final void setSessionContext(Context context) { + this.sessionContext = context; + } + + public final void start() { + this.initListeners(); + this.setState(STARTING); + this.conn.sessionOpened(this); + this.receiver.start(); + if (this.conn() == null || !this.conn().isTunnelServerConnection()) { + this.sender.start(); + this.dispatcher.start(); + } + this.setState(RUNNING); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public final void close(Throwable throwable) { + Object object; + if (this.isClosed) { + return; + } + this.setState(CLOSING, throwable); + this.isClosed = true; + this.sender.kill(); + this.receiver.kill(); + this.dispatcher.kill(); + this.bedroom.wakeAll(); + this.circuits.kill(); + if (this.tunnelReceiver != null) { + this.tunnelReceiver.kill(); + this.tunnelReceiver = null; + } + long l = Fox.clock.ticks(); + boolean bl = false; + while (this.sender.isRunning()) { + if (Fox.clock.ticks() - l >= Fox.sessionCloseTimeout) { + bl = true; + break; + } + object = this.sessionStateLock; + synchronized (object) { + try { + this.sessionStateLock.wait(200L); + } + catch (InterruptedException interruptedException) { + // empty catch block + } + } + } + if (this.tunnelSocket != null) { + try { + this.tunnelSocket.close(); + } + catch (Exception exception) { + // empty catch block + } + this.tunnelSocket = null; + } + if (!bl) { + try { + this.socket.close(); + } + catch (Exception exception) {} + } else { + object = new Version(System.getProperty("java.version")); + if (object.compareTo((Object)"1.6") >= 0) { + try { + DeadlockUtil deadlockUtil = DeadlockUtil.getInstance(); + deadlockLog.trace("looking for a deadlock for session " + this.id); + if (deadlockUtil.countDeadlocksByThreadName(new String[]{"Fox:Sender:" + this.id, "Fox:Receiver:" + this.id}) > 0) { + deadlockLog.warning("found a matching deadlock for session " + this.id); + deadlockLog.warning("fox deadlocked thread count at " + ++Fox.deadlocks); + int n = Integer.parseInt(System.getProperty("niagara.fox.maxDeadlockedThreads", "-1")); + if (n > 0 && Fox.deadlocks >= n) { + deadlockLog.message("requesting station stop"); + new Thread(){ + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void run() { + Object object = deadlockReboot; + synchronized (object) { + try { + Auditor auditor = Sys.getAuditor(); + if (auditor != null) { + auditor.audit(new AuditEvent("Shutdown", "FoxDeadlockCount", String.valueOf(Fox.deadlocks), "", "", "")); + } + } + catch (Throwable throwable) { + throwable.printStackTrace(); + } + try { + Station.saveSync(); + Station.shutdown((boolean)false); + System.exit(-1); + } + catch (Exception exception) { + deadlockLog.error("unable to save and stop station", (Throwable)exception); + } + } + } + }.start(); + } + } + } + catch (Exception exception) { + deadlockLog.error("Unable to process deadlock check", (Throwable)exception); + } + } + } + Fox.unregister(this); + object = this.sessionStateLock; + synchronized (object) { + if (this.conn != null) { + this.conn.sessionClosed(this, throwable); + } + } + this.setState(CLOSED, throwable); + this.listeners = nullListeners; + this.user = null; + this.sessionContext = null; + } + + public Object getSessionStateLock() { + return this.sessionStateLock; + } + + void sendHello(String string) throws Exception { + FoxMessage foxMessage = this.initHello(null, string, this.id, false); + this.sendTuning("hello", foxMessage); + } + + void sendRedirect(int n) throws Exception { + FoxMessage foxMessage = new FoxMessage(); + foxMessage.add("port", n); + this.sendTuning("redirect", foxMessage); + } + + FoxMessage initHello(FoxMessage foxMessage, String string, int n, boolean bl) throws Exception { + boolean bl2 = foxMessage != null; + FoxMessage foxMessage2 = new FoxMessage(); + if (bl2 && bl) { + try { + foxMessage2.add("brandId", Brand.getBrandId()); + } + catch (Exception exception) {} + } else if (!bl2) { + foxMessage2.add("fox.version", "1.0.1"); + foxMessage2.add("id", n); + if (string != null) { + foxMessage2.add("user", string); + } + foxMessage2.add("hostName", Fox.hostName); + foxMessage2.add("hostAddress", Fox.hostAddress); + foxMessage2.add("app.name", Fox.appName); + foxMessage2.add("app.version", Fox.appVersion); + foxMessage2.add("vm.name", Fox.vmName); + foxMessage2.add("vm.version", Fox.vmVersion); + foxMessage2.add("os.name", Fox.osName); + foxMessage2.add("os.version", Fox.osVersion); + this.conn.initHello(foxMessage2); + } + if (bl2) { + for (int i = 0; i < foxMessage.count; ++i) { + String string2 = foxMessage.tuples[i].name; + if (foxMessage2.getOptional(string2) != null || string2.equals("brandId")) continue; + foxMessage2.add(foxMessage.tuples[i]); + } + } + return foxMessage2; + } + + boolean receiveHello() throws Exception { + FoxFrame foxFrame = this.readFrame(); + if (foxFrame == null) { + if (this.tunnelSocket != null) { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(this.id).append(": ").append("Tunnel "); + stringBuffer.append(this.tunnelSocket.getLocalPort()).append("->"); + stringBuffer.append(this.tunnelSocket.getInetAddress().getHostAddress()); + stringBuffer.append(':').append(this.tunnelSocket.getPort()); + this.string = stringBuffer.toString(); + } + return false; + } + if (foxFrame.channel != "fox") { + throw new InvalidChannelException("Expecting 'fox', not '" + foxFrame.channel + "'"); + } + if (foxFrame.command != "hello") { + if (foxFrame.command == "redirect") { + throw new FoxsRedirectException(foxFrame.message.getInt("port")); + } + if (foxFrame.command == "busy") { + throw new FoxBusyException(); + } + throw new InvalidCommandException("Expecting 'hello', not '" + foxFrame.command + "'"); + } + if (foxFrame.replyNumber != -1) { + throw new IOException("Invalid reply number " + foxFrame.replyNumber); + } + this.remoteHello = foxFrame.message; + FoxMessage foxMessage = this.remoteHello; + String string = foxMessage.getString("fox.version"); + if (!string.startsWith("1.0")) { + throw new IOException("Unsupported fox.version '" + string + "'"); + } + this.remoteId = foxMessage.getInt("id"); + return true; + } + + public final void sendTuning(String string, FoxMessage foxMessage) throws Exception { + this.writeFrame(new FoxFrame(97, this.localNextSequence++, -1, "fox", string, foxMessage)); + } + + void sendBusy() throws Exception { + this.writeFrame(new FoxFrame(101, this.localNextSequence++, -1, "fox", "busy", new FoxMessage())); + } + + public final FoxMessage receiveTuning(String string) throws Exception { + FoxFrame foxFrame = this.readFrame(); + if (foxFrame.channel != "fox") { + throw new InvalidChannelException("Expecting 'fox', not '" + foxFrame.channel + "'"); + } + if (string != null && foxFrame.command != string) { + throw new InvalidCommandException("Expecting '" + string + "', not '" + foxFrame.command + "'"); + } + return foxFrame.message; + } + + public final FoxCircuit openCircuit(String string, String string2) throws Exception { + FoxCircuit foxCircuit = this.circuits.alloc(string, string2); + try { + foxCircuit.sendOpen(); + return foxCircuit; + } + catch (Exception exception) { + this.closeCircuit(foxCircuit); + throw exception; + } + } + + void closeCircuit(FoxCircuit foxCircuit) { + try { + foxCircuit.sendClose(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + this.circuits.free(foxCircuit); + } + + public final FoxResponse sendSync(FoxRequest foxRequest) throws Exception { + if (this.isClosed) { + throw new IOException("Session closed"); + } + SessionBedroom.Bed bed = this.bedroom.getBed(Thread.currentThread()); + this.send(115, bed.replyNumber, foxRequest.channel, foxRequest.command, foxRequest, null); + this.bedroom.sleep(bed); + FoxFrame foxFrame = bed.reply; + if (foxFrame == null) { + IOException iOException = new IOException("Request timed out: " + foxRequest.channel + "." + foxRequest.command); + this.close(iOException); + throw iOException; + } + if (foxFrame.frameType == 114) { + return (FoxResponse)foxFrame.message; + } + if (foxFrame.frameType == 110) { + return null; + } + if (bed.reply.frameType == 101) { + throw Fox.exceptionTranslator.messageToException(foxFrame.message); + } + IOException iOException = new IOException("Invalid reply frame type: " + (char)foxFrame.frameType); + this.close(iOException); + throw iOException; + } + + public final void sendAsync(FoxRequest foxRequest) throws Exception { + this.sendAsync(foxRequest, null); + } + + public final void sendAsync(FoxRequest foxRequest, FoxAsyncCallbacks foxAsyncCallbacks) throws Exception { + if (this.isClosed) { + throw new IOException("Session closed"); + } + this.send(97, -1, foxRequest.channel, foxRequest.command, foxRequest, foxAsyncCallbacks); + } + + final void sendReply(FoxFrame foxFrame, FoxMessage foxMessage) throws InterruptedException { + if (foxFrame.replyNumber == -1) { + return; + } + if (foxMessage == null) { + this.send(110, foxFrame.replyNumber, foxFrame.channel, foxFrame.command, emptyMessage, null); + } else { + this.send(114, foxFrame.replyNumber, foxFrame.channel, foxFrame.command, foxMessage, null); + } + } + + final void sendError(FoxFrame foxFrame, Throwable throwable) throws InterruptedException { + if (foxFrame == null || foxFrame.replyNumber == -1) { + return; + } + FoxMessage foxMessage = Fox.exceptionTranslator.exceptionToMessage(throwable); + this.send(101, foxFrame.replyNumber, foxFrame.channel, foxFrame.command, foxMessage, null); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + private void send(int n, int n2, String string, String string2, FoxMessage foxMessage, FoxAsyncCallbacks foxAsyncCallbacks) throws InterruptedException { + Object object = this.sendLock; + synchronized (object) { + int n3 = this.localNextSequence; + this.localNextSequence = (this.localNextSequence + 1) % Integer.MAX_VALUE; + FoxFrame foxFrame = new FoxFrame(n, n3, n2, string, string2, foxMessage); + foxFrame.callbacks = foxAsyncCallbacks; + this.sender.enqueue(foxFrame); + } + } + + void requestReceived(FoxFrame foxFrame) throws InterruptedException { + try { + if (foxFrame.channel == "circuit") { + this.circuits.circuitRequestReceived(foxFrame); + } else { + this.dispatcher.enqueue(foxFrame); + } + } + catch (Throwable throwable) { + this.conn.error("Error in request", throwable); + throwable.printStackTrace(); + foxFrame.dump(); + this.sendError(foxFrame, throwable); + } + } + + void replyReceived(FoxFrame foxFrame) { + block2: { + try { + this.bedroom.wake(foxFrame); + } + catch (Throwable throwable) { + if (this.isClosed) break block2; + this.conn.error("Error in reply " + foxFrame.replyNumber, throwable); + throwable.printStackTrace(); + foxFrame.dump(); + } + } + } + + FoxResponse processFoxChannelRequest(FoxRequest foxRequest) { + String string = foxRequest.command; + if (string == "ping") { + return this.ping(foxRequest); + } + throw new InvalidCommandException("fox." + string); + } + + public void ping() throws Exception { + this.sendSync(new FoxRequest("fox", "ping")); + } + + private FoxResponse ping(FoxRequest foxRequest) { + return new FoxResponse(foxRequest); + } + + public final void setState(String string) { + this.setState(string, null); + } + + public final void setState(String string, Throwable throwable) { + this.state = string; + if (Fox.traceSessionStates) { + System.out.println("-- Fox [" + this.id + "] STATE " + string); + } + if (this.listeners != nullListeners) { + IFoxSessionListener[] iFoxSessionListenerArray = this.listeners; + for (int i = 0; i < iFoxSessionListenerArray.length; ++i) { + iFoxSessionListenerArray[i].stateChanged(this, string, throwable); + } + } + } + + public void spy(PrintWriter printWriter) throws Exception { + printWriter.print("
OccurrencesTotal BytesAvg BytesComponent Event
"); + printWriter.print("\n"); + this.dumpProps(printWriter); + printWriter.print("
"); + printWriter.print(this.string); + printWriter.print("
\n"); + } + + public void dumpProps(PrintWriter printWriter) throws Exception { + ByteArrayOutputStream byteArrayOutputStream; + this.dump(printWriter, (Object)"id", this.id); + this.dump(printWriter, (Object)"state", this.state); + this.dump(printWriter, (Object)"connectTime", new Date(this.connectTime)); + this.dump(printWriter, (Object)"remoteId", this.remoteId); + this.dump(printWriter, (Object)"readCount", this.readCount); + this.dump(printWriter, (Object)"lastRead", Fox.clock.ticks() - this.lastReadTicks + "ms"); + this.dump(printWriter, (Object)"writtenCount", this.writtenCount); + this.dump(printWriter, (Object)"lastWrite", Fox.clock.ticks() - this.lastWriteTicks + "ms"); + this.dump(printWriter, (Object)"isClosed", this.isClosed); + this.dump(printWriter, (Object)"closeCause", this.closeCause); + this.dump(printWriter, (Object)"socket", this.socket); + this.dump(printWriter, (Object)"sender", this.sender); + this.dump(printWriter, (Object)"receiver", this.receiver); + this.dump(printWriter, (Object)"dispatcher", this.dispatcher); + this.dump(printWriter, (Object)"bedroom", this.bedroom); + this.dump(printWriter, (Object)"circuits", "
" + this.circuits + "
"); + if (this.remoteHello != null) { + byteArrayOutputStream = new ByteArrayOutputStream(); + byteArrayOutputStream.write("
".getBytes());
+            this.remoteHello.dump(byteArrayOutputStream);
+            byteArrayOutputStream.write("
".getBytes()); + this.dump(printWriter, (Object)"remoteHello", new String(byteArrayOutputStream.toByteArray())); + } + if (this.remoteWelcome != null) { + byteArrayOutputStream = new ByteArrayOutputStream(); + byteArrayOutputStream.write("
".getBytes());
+            this.remoteWelcome.dump(byteArrayOutputStream);
+            byteArrayOutputStream.write("
".getBytes()); + this.dump(printWriter, (Object)"remoteWelcome", new String(byteArrayOutputStream.toByteArray())); + } + this.dump(printWriter, (Object)"tunnelSocket", this.tunnelSocket); + this.dump(printWriter, (Object)"tunnelReceiver", this.tunnelReceiver); + this.dump(printWriter, (Object)"fwConnType", this.fwConnType(null)); + } + + private void dump(PrintWriter printWriter, Object object, boolean bl) { + this.dump(printWriter, object, String.valueOf(bl)); + } + + private void dump(PrintWriter printWriter, Object object, int n) { + this.dump(printWriter, object, String.valueOf(n)); + } + + private void dump(PrintWriter printWriter, Object object, Object object2) { + printWriter.print(""); + printWriter.print(object); + printWriter.print(""); + printWriter.print(object2); + printWriter.print("\n"); + } + + public void dump() { + System.out.println("id: " + this.id); + System.out.println("state: " + this.state); + System.out.println("connectTime: " + new Date(this.connectTime)); + System.out.println("remoteId: " + this.remoteId); + System.out.println("readCount: " + this.readCount); + System.out.println("lastRead: " + (Fox.clock.ticks() - this.lastReadTicks) + "ms"); + System.out.println("writtenCount: " + this.writtenCount); + System.out.println("lastWrite: " + (Fox.clock.ticks() - this.lastWriteTicks) + "ms"); + System.out.println("isClosed: " + this.isClosed); + System.out.println("closeCause: " + this.closeCause); + System.out.println("socket: " + this.socket); + System.out.println("sender: " + this.sender); + System.out.println("receiver: " + this.receiver); + System.out.println("dispatcher: " + this.dispatcher); + System.out.println("bedroom: " + this.bedroom); + System.out.println("circuits: " + this.circuits); + System.out.println("tunnelSocket " + this.tunnelSocket); + System.out.println("tunnelRcvr " + this.tunnelReceiver); + System.out.println("fwConnType " + this.fwConnType(null)); + } + + FoxFrame readFrame() throws IOException { + FoxFrame foxFrame; + do { + foxFrame = FoxFrame.read(this.in); + ++this.readCount; + this.lastReadTicks = Fox.clock.ticks(); + if (this.conn == null || !this.conn.isTunnelServerConnection()) continue; + try { + if (this.rerouteTunnelFrame(foxFrame)) { + return null; + } + } + catch (Exception exception) { + throw new IOException(exception.toString()); + } + } while (foxFrame.frameType == 107); + if (foxFrame.sequenceNumber != this.remoteNextSequence) { + throw new IOException("Invalid sequence number " + foxFrame.sequenceNumber + " expecting " + this.remoteNextSequence); + } + this.remoteNextSequence = (this.remoteNextSequence + 1) % Integer.MAX_VALUE; + if (Fox.traceReadFrame) { + System.out.print("-- Fox [" + this.id + "] READ "); + foxFrame.dump(); + } + if (this.listeners != nullListeners) { + IFoxSessionListener[] iFoxSessionListenerArray = this.listeners; + FoxFrame foxFrame2 = foxFrame; + if (foxFrame.channel == "fox" && foxFrame.command == "login") { + foxFrame2 = new FoxFrame(foxFrame.frameType, foxFrame.sequenceNumber, foxFrame.replyNumber, foxFrame.channel, foxFrame.command, emptyMessage); + } + for (int i = 0; i < iFoxSessionListenerArray.length; ++i) { + iFoxSessionListenerArray[i].readFrame(this, foxFrame2); + } + } + return foxFrame; + } + + void writeFrame(FoxFrame foxFrame) throws IOException { + this.encodeTunnelAuthority(foxFrame); + if (Fox.traceWriteFrame) { + System.out.print("-- Fox [" + this.id + "] WRITE "); + foxFrame.dump(); + } + if (this.listeners != nullListeners) { + IFoxSessionListener[] iFoxSessionListenerArray = this.listeners; + FoxFrame foxFrame2 = foxFrame; + if (foxFrame.channel == "fox" && foxFrame.command == "login") { + foxFrame2 = new FoxFrame(foxFrame.frameType, foxFrame.sequenceNumber, foxFrame.replyNumber, foxFrame.channel, foxFrame.command, emptyMessage); + } + for (int i = 0; i < iFoxSessionListenerArray.length; ++i) { + iFoxSessionListenerArray[i].writeFrame(this, foxFrame2); + } + } + ++this.writtenCount; + this.lastWriteTicks = Fox.clock.ticks(); + foxFrame.write(this.out); + this.out.flush(); + if (foxFrame.callbacks != null) { + foxFrame.callbacks.asyncMessageSent(this, foxFrame.message); + } + } + + boolean rerouteTunnelFrame(FoxFrame foxFrame) throws Exception { + FoxMessage foxMessage = foxFrame.message; + String string = TUNNEL_AUTHORITY; + String[] stringArray = foxMessage.listStrings(string); + Integer n = NON_FW_FOX_SESSION; + if (stringArray == null || stringArray.length < 1) { + string = FW_TUNNEL_AUTHORITY; + stringArray = foxMessage.listStrings(string); + n = FW_FOX_SESSION; + if (stringArray == null || stringArray.length < 1) { + string = FW_STATION_TUNNEL_AUTHORITY; + stringArray = foxMessage.listStrings(string); + n = FW_STATION_FOX_SESSION; + } + } + if (stringArray != null && stringArray.length > 0) { + int n2; + this.fwConnType(n); + if (n == -1 && !Fox.tunnelingEnabled) { + throw new IOException("Received a fox tunneling request while fox tunneling is disabled. Fox tunneling must be enabled to process the fox request."); + } + String string2 = stringArray[stringArray.length - 1]; + FoxTuple[] foxTupleArray = new FoxTuple[foxMessage.tuples.length]; + boolean bl = false; + int n3 = 0; + for (n2 = foxMessage.count - 1; n2 >= 0; --n2) { + if (!bl && string.equals(foxMessage.tuples[n2].name) && foxMessage.tuples[n2] instanceof FoxString && string2.equals(((FoxString)foxMessage.tuples[n2]).value)) { + bl = true; + continue; + } + foxTupleArray[foxMessage.count - 2 - n3] = foxMessage.tuples[n2]; + ++n3; + } + foxMessage.count = n3; + foxMessage.tuples = foxTupleArray; + if (this.tunnelSocket == null) { + n2 = 0; + try { + if (SSLSocketClass.isAssignableFrom(this.socket.getClass())) { + n2 = 1; + } + } + catch (Exception exception) { + // empty catch block + } + this.tunnelSocket = this.conn.createTunnelSocket(string2, n2 != 0); + this.tunnelIn = new MessageReader(new BufferedInputStream(this.tunnelSocket.getInputStream())); + this.tunnelOut = new MessageWriter(new BufferedOutputStream(this.tunnelSocket.getOutputStream())); + this.tunnelSocket.setSoTimeout(Fox.soTimeout); + this.tunnelSocket.setTcpNoDelay(Fox.tcpNoDelay); + this.tunnelReceiver = new TunnelReceiver(this); + this.tunnelReceiver.start(); + } + this.writeTunnelFrame(foxFrame); + return true; + } + return false; + } + + void encodeTunnelAuthority(FoxFrame foxFrame) { + String[] stringArray; + if (this.conn != null && this.conn.isTunnelClientConnection() && (stringArray = this.conn.getTunnelAuthorities()) != null && stringArray.length > 0) { + String string = TUNNEL_AUTHORITY; + switch (this.fwConnType(null)) { + case 801: { + string = FW_TUNNEL_AUTHORITY; + break; + } + case 802: { + string = FW_STATION_TUNNEL_AUTHORITY; + break; + } + } + FoxMessage foxMessage = foxFrame.message; + for (int i = stringArray.length - 1; i >= 0; --i) { + String string2 = stringArray[i]; + if (string2 == null) continue; + foxMessage.add(string, string2); + } + } + } + + FoxFrame readTunnelFrame() throws IOException { + Object object; + Object object2; + Integer n = this.fwConnType(null); + if (n == -1 && !Fox.tunnelingEnabled) { + throw new IOException("Attempted to read a fox tunnel frame while fox tunneling is disabled. Fox tunneling must be enabled to read the fox frame."); + } + FoxFrame foxFrame = null; + try { + foxFrame = FoxFrame.read(this.tunnelIn); + } + catch (IOException iOException) { + if (iOException.getClass().getName().equals("javax.net.ssl.SSLHandshakeException")) { + throw new IOException("SSLHandshakeException: " + iOException.getLocalizedMessage() + " \nCould not establish tunnel connection." + " \nPlease check the certificate management configuration on this proxy host (station '" + Sys.getStation().getStationName() + "'). \nYou might need to approve the target host (" + this.tunnelSocket.getInetAddress() + ") as an allowed host for encrypted communication."); + } + throw iOException; + } + if (n.intValue() == FW_STATION_FOX_SESSION.intValue() && foxFrame.channel == "fox" && foxFrame.command == "hello") { + try { + object2 = this.initHello(foxFrame.message, foxFrame.message.getString("user", null), foxFrame.message.getInt("id"), true); + object = foxFrame.callbacks; + FoxFrame foxFrame2 = foxFrame.next; + foxFrame = new FoxFrame(foxFrame.frameType, foxFrame.sequenceNumber, foxFrame.replyNumber, foxFrame.channel, foxFrame.command, (FoxMessage)object2); + foxFrame.callbacks = object; + foxFrame.next = foxFrame2; + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + if (Fox.traceReadFrame) { + System.out.print("-- Fox [" + this.id + "] TUNNEL READ "); + foxFrame.dump(); + } + if (this.listeners != nullListeners) { + object2 = this.listeners; + object = foxFrame; + if (foxFrame.channel == "fox" && foxFrame.command == "login") { + object = new FoxFrame(foxFrame.frameType, foxFrame.sequenceNumber, foxFrame.replyNumber, foxFrame.channel, foxFrame.command, emptyMessage); + } + for (int i = 0; i < ((IFoxSessionListener[])object2).length; ++i) { + object2[i].readTunnelFrame(this, (FoxFrame)object); + } + } + return foxFrame; + } + + void writeTunnelFrame(FoxFrame foxFrame) throws IOException { + Object object; + Object object2; + Integer n = this.fwConnType(null); + if (n == -1 && !Fox.tunnelingEnabled) { + throw new IOException("Attempted to write a fox tunnel frame while fox tunneling is disabled. Fox tunneling must be enabled to write the fox frame."); + } + if (n.intValue() == FW_STATION_FOX_SESSION.intValue() && foxFrame.channel == "fox" && foxFrame.command == "hello") { + try { + object2 = this.initHello(foxFrame.message, foxFrame.message.getString("user", null), foxFrame.message.getInt("id"), false); + object = foxFrame.callbacks; + FoxFrame foxFrame2 = foxFrame.next; + foxFrame = new FoxFrame(foxFrame.frameType, foxFrame.sequenceNumber, foxFrame.replyNumber, foxFrame.channel, foxFrame.command, (FoxMessage)object2); + foxFrame.callbacks = object; + foxFrame.next = foxFrame2; + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + if (Fox.traceWriteFrame) { + System.out.print("-- Fox [" + this.id + "] TUNNEL WRITE "); + foxFrame.dump(); + } + if (this.listeners != nullListeners) { + object2 = this.listeners; + object = foxFrame; + if (foxFrame.channel == "fox" && foxFrame.command == "login") { + object = new FoxFrame(foxFrame.frameType, foxFrame.sequenceNumber, foxFrame.replyNumber, foxFrame.channel, foxFrame.command, emptyMessage); + } + for (int i = 0; i < ((IFoxSessionListener[])object2).length; ++i) { + object2[i].writeTunnelFrame(this, (FoxFrame)object); + } + } + try { + foxFrame.write(this.tunnelOut); + this.tunnelOut.flush(); + } + catch (IOException iOException) { + if (iOException.getClass().getName().equals("javax.net.ssl.SSLHandshakeException")) { + throw new IOException("SSLHandshakeException: " + iOException.getLocalizedMessage() + " \nCould not establish tunnel connection." + " \nPlease check the certificate management configuration on this proxy host (station '" + Sys.getStation().getStationName() + "'). \nYou might need to approve the target host (" + this.tunnelSocket.getInetAddress() + ") as an allowed host for encrypted communication."); + } + throw iOException; + } + } + + private Integer fwConnType(Integer n) { + if (this.conn != null) { + try { + Object object; + if (this.conn instanceof BObject && (object = ((BObject)this.conn).fw(803, (Object)n, null, null, null)) instanceof Integer) { + return (Integer)object; + } + } + catch (Throwable throwable) { + throwable.printStackTrace(); + } + } + return NON_FW_FOX_SESSION; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public static final void registerListenerFactory(IFoxSessionListenerFactory iFoxSessionListenerFactory) { + Object object; + if (class$com$tridium$fox$session$FoxSession == null) { + class$com$tridium$fox$session$FoxSession = FoxSession.class$("com.tridium.fox.session.FoxSession"); + object = class$com$tridium$fox$session$FoxSession; + } else { + object = class$com$tridium$fox$session$FoxSession; + } + FoxSession[] foxSessionArray = object; + synchronized (object) { + Array array = new Array(class$com$tridium$fox$session$FoxSession$IFoxSessionListenerFactory == null ? (class$com$tridium$fox$session$FoxSession$IFoxSessionListenerFactory = FoxSession.class$("com.tridium.fox.session.FoxSession$IFoxSessionListenerFactory")) : class$com$tridium$fox$session$FoxSession$IFoxSessionListenerFactory); + array.addAll((Object[])listenerFactories); + if (!array.contains((Object)iFoxSessionListenerFactory)) { + array.add((Object)iFoxSessionListenerFactory); + listenerFactories = (IFoxSessionListenerFactory[])array.trim(); + } + // ** MonitorExit[var1_1] (shouldn't be in output) + foxSessionArray = Fox.getSessions(); + for (int i = 0; i < foxSessionArray.length; ++i) { + foxSessionArray[i].initListeners(); + } + return; + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public static final void unregisterListenerFactory(IFoxSessionListenerFactory iFoxSessionListenerFactory) { + Object object; + if (class$com$tridium$fox$session$FoxSession == null) { + class$com$tridium$fox$session$FoxSession = FoxSession.class$("com.tridium.fox.session.FoxSession"); + object = class$com$tridium$fox$session$FoxSession; + } else { + object = class$com$tridium$fox$session$FoxSession; + } + FoxSession[] foxSessionArray = object; + synchronized (object) { + Array array = new Array(class$com$tridium$fox$session$FoxSession$IFoxSessionListenerFactory == null ? (class$com$tridium$fox$session$FoxSession$IFoxSessionListenerFactory = FoxSession.class$("com.tridium.fox.session.FoxSession$IFoxSessionListenerFactory")) : class$com$tridium$fox$session$FoxSession$IFoxSessionListenerFactory); + array.addAll((Object[])listenerFactories); + if (array.remove((Object)iFoxSessionListenerFactory)) { + listenerFactories = (IFoxSessionListenerFactory[])array.trim(); + } + // ** MonitorExit[var1_1] (shouldn't be in output) + foxSessionArray = Fox.getSessions(); + for (int i = 0; i < foxSessionArray.length; ++i) { + foxSessionArray[i].initListeners(); + } + return; + } + } + + private void initListeners() { + this.listeners = FoxSession.createListeners(this.conn); + } + + public static final IFoxSessionListener[] createListeners(FoxConnection foxConnection) { + IFoxSessionListener[] iFoxSessionListenerArray = nullListeners; + IFoxSessionListenerFactory[] iFoxSessionListenerFactoryArray = listenerFactories; + if (iFoxSessionListenerFactoryArray.length > 0) { + Array array = null; + for (int i = 0; i < iFoxSessionListenerFactoryArray.length; ++i) { + IFoxSessionListener iFoxSessionListener = iFoxSessionListenerFactoryArray[i].make(foxConnection); + if (iFoxSessionListener == null) continue; + if (array == null) { + array = new Array(class$com$tridium$fox$session$FoxSession$IFoxSessionListener == null ? FoxSession.class$("com.tridium.fox.session.FoxSession$IFoxSessionListener") : class$com$tridium$fox$session$FoxSession$IFoxSessionListener); + } + array.add((Object)iFoxSessionListener); + } + if (array != null) { + iFoxSessionListenerArray = (IFoxSessionListener[])array.trim(); + } + } + return iFoxSessionListenerArray; + } + + public Socket getSocket() { + return this.socket; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + try { + SSLSocketClass = Class.forName("javax.net.ssl.SSLSocket"); + } + catch (Exception exception) { + // empty catch block + } + nullListeners = new IFoxSessionListener[0]; + listenerFactories = new IFoxSessionListenerFactory[0]; + deadlockLog = Log.getLog((String)"fox.deadlockMonitor"); + deadlockReboot = new Object(); + } + + public static interface IFoxSessionListener { + public void connectionAborted(String var1, Throwable var2); + + public void stateChanged(FoxSession var1, String var2, Throwable var3); + + public void readFrame(FoxSession var1, FoxFrame var2); + + public void readTunnelFrame(FoxSession var1, FoxFrame var2); + + public void writeFrame(FoxSession var1, FoxFrame var2); + + public void writeTunnelFrame(FoxSession var1, FoxFrame var2); + } + + public static interface IFoxSessionListenerFactory { + public IFoxSessionListener make(FoxConnection var1); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/FoxsRedirectException.java b/modules/cfr_output/com/tridium/fox/session/FoxsRedirectException.java new file mode 100644 index 0000000..a9e6e90 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/FoxsRedirectException.java @@ -0,0 +1,18 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +public class FoxsRedirectException +extends Exception { + private int port = 4911; + + public FoxsRedirectException(int n) { + this.port = n; + } + + public int getPort() { + return this.port; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/FrameQueue.java b/modules/cfr_output/com/tridium/fox/session/FrameQueue.java new file mode 100644 index 0000000..8147c68 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/FrameQueue.java @@ -0,0 +1,99 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxFrame; + +public final class FrameQueue { + private FoxFrame head; + private FoxFrame tail; + private int size; + private int peak; + private String blocked; + private boolean isAlive = true; + + public final int size() { + return this.size; + } + + public final int peak() { + return this.peak; + } + + public final int max() { + return Fox.maxQueueSize; + } + + public final synchronized void kill() { + this.isAlive = false; + this.notifyAll(); + } + + public synchronized FoxFrame dequeue(int n) throws InterruptedException { + FoxFrame foxFrame; + while (this.isAlive && this.size == 0) { + if (n == -1) { + this.wait(); + continue; + } + this.wait(n); + break; + } + if ((foxFrame = this.head) == null) { + return null; + } + this.head = foxFrame.next; + if (this.head == null) { + this.tail = null; + } + foxFrame.next = null; + --this.size; + this.notifyAll(); + return foxFrame; + } + + public synchronized void enqueue(FoxFrame foxFrame) throws InterruptedException { + while (this.isAlive && this.size >= this.max()) { + try { + this.blocked = Thread.currentThread().getName(); + } + catch (Exception exception) { + // empty catch block + } + this.wait(); + } + this.blocked = null; + if (foxFrame.next != null) { + throw new IllegalStateException(); + } + if (this.tail == null) { + this.head = this.tail = foxFrame; + } else { + this.tail.next = foxFrame; + this.tail = foxFrame; + } + ++this.size; + if (this.size > this.peak) { + this.peak = this.size; + } + this.notifyAll(); + } + + public synchronized void clear() { + this.size = 0; + this.head = null; + this.tail = null; + this.notifyAll(); + } + + public String toString() { + String string = "FrameQueue size=" + this.size + " peak=" + this.peak + " max=" + this.max(); + if (this.blocked != null) { + string = string + " blocked=" + this.blocked; + } + return string; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/IntMap.java b/modules/cfr_output/com/tridium/fox/session/IntMap.java new file mode 100644 index 0000000..84721d5 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/IntMap.java @@ -0,0 +1,128 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +public class IntMap { + private Entry[] table = new Entry[31]; + private int count; + private int threshold = (int)(31.0f * this.loadFactor); + private float loadFactor = 75.0f; + + public int size() { + return this.count; + } + + public Object get(int n) { + Entry[] entryArray = this.table; + int n2 = (n & Integer.MAX_VALUE) % entryArray.length; + Entry entry = entryArray[n2]; + while (entry != null) { + if (entry.hash == n) { + return entry.value; + } + entry = entry.next; + } + return null; + } + + private void rehash() { + int n = this.table.length; + Entry[] entryArray = this.table; + int n2 = n * 2 + 1; + Entry[] entryArray2 = new Entry[n2]; + this.threshold = (int)((float)n2 * this.loadFactor); + this.table = entryArray2; + int n3 = n; + while (n3-- > 0) { + Entry entry = entryArray[n3]; + while (entry != null) { + Entry entry2 = entry; + entry = entry.next; + int n4 = (entry2.hash & Integer.MAX_VALUE) % n2; + entry2.next = entryArray2[n4]; + entryArray2[n4] = entry2; + } + } + } + + public Object put(int n, Object object) { + if (object == null) { + throw new NullPointerException(); + } + Entry[] entryArray = this.table; + int n2 = (n & Integer.MAX_VALUE) % entryArray.length; + Entry entry = entryArray[n2]; + while (entry != null) { + if (entry.hash == n) { + Object object2 = entry.value; + entry.value = object; + return object2; + } + entry = entry.next; + } + if (this.count >= this.threshold) { + this.rehash(); + return this.put(n, object); + } + entry = new Entry(); + entry.hash = n; + entry.value = object; + entry.next = entryArray[n2]; + entryArray[n2] = entry; + ++this.count; + return null; + } + + public Object remove(int n) { + Entry[] entryArray = this.table; + int n2 = (n & Integer.MAX_VALUE) % entryArray.length; + Entry entry = entryArray[n2]; + Entry entry2 = null; + while (entry != null) { + if (entry.hash == n) { + if (entry2 != null) { + entry2.next = entry.next; + } else { + entryArray[n2] = entry.next; + } + --this.count; + return entry.value; + } + entry2 = entry; + entry = entry.next; + } + return null; + } + + public void clear() { + Entry[] entryArray = this.table; + int n = entryArray.length; + while (--n >= 0) { + entryArray[n] = null; + } + this.count = 0; + } + + public Object[] toArray(Object[] objectArray) { + int n = 0; + for (int i = 0; i < this.table.length; ++i) { + Entry entry = this.table[i]; + while (entry != null && n < this.count) { + objectArray[n++] = entry.value; + entry = entry.next; + } + } + return objectArray; + } + + static class Entry { + int hash; + Object value; + Entry next; + + Entry() { + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/InvalidChannelException.java b/modules/cfr_output/com/tridium/fox/session/InvalidChannelException.java new file mode 100644 index 0000000..0245497 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/InvalidChannelException.java @@ -0,0 +1,12 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +public class InvalidChannelException +extends RuntimeException { + public InvalidChannelException(String string) { + super(string); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/InvalidCommandException.java b/modules/cfr_output/com/tridium/fox/session/InvalidCommandException.java new file mode 100644 index 0000000..cb231e8 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/InvalidCommandException.java @@ -0,0 +1,12 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +public class InvalidCommandException +extends RuntimeException { + public InvalidCommandException(String string) { + super(string); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/MulticastServer.java b/modules/cfr_output/com/tridium/fox/session/MulticastServer.java new file mode 100644 index 0000000..233b72b --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/MulticastServer.java @@ -0,0 +1,145 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.LocalizableRuntimeException + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxFrame; +import com.tridium.fox.session.FoxServer; +import com.tridium.fox.session.MulticastUtil; +import java.io.IOException; +import java.net.InetAddress; +import java.net.MulticastSocket; +import java.util.Vector; +import javax.baja.sys.LocalizableRuntimeException; + +public class MulticastServer +extends Thread { + private FoxServer server; + private boolean isAlive = true; + private MulticastSocket socket; + private Object rollcallLock = new Object(); + private Vector announcements; + + public MulticastServer(FoxServer foxServer) throws IOException { + super(Fox.threadGroup, "Fox:MulticastServer"); + if (!Fox.multicastEnabled) { + throw new LocalizableRuntimeException("fox", "error.multicastDisabled"); + } + this.server = foxServer; + this.socket = new MulticastSocket(1911); + Throwable throwable = null; + Throwable throwable2 = null; + boolean bl = false; + boolean bl2 = false; + if (Fox.ipv4Enabled) { + try { + this.socket.joinGroup(InetAddress.getByName(Fox.MULTICAST_ADDRESS)); + bl = true; + } + catch (IOException iOException) { + System.err.println("WARNING: Could not join IPv4 multicast group: " + iOException); + throwable = iOException; + bl = false; + } + } + if (Fox.ipv6Enabled) { + try { + this.socket.joinGroup(InetAddress.getByName(Fox.IPV6_MULTICAST_ADDRESS)); + bl2 = true; + } + catch (IOException iOException) { + System.err.println("WARNING: Could not join IPv6 multicast group: " + iOException); + throwable2 = iOException; + bl2 = false; + } + } + if (!bl2 && !bl) { + String string = Fox.ipv4Enabled && throwable != null ? throwable.getMessage() : null; + String string2 = Fox.ipv6Enabled && throwable2 != null ? throwable2.getMessage() : null; + String string3 = "OK"; + if (string != null) { + string3 = string; + } + if (string2 != null) { + string3 = string == null ? string2 : string3 + ", " + string2; + } + throw new IOException(string3); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public FoxMessage[] rollcall(FoxMessage foxMessage, long l, RollcallCallback rollcallCallback) throws Exception { + Object object = this.rollcallLock; + synchronized (object) { + Vector vector = this.announcements = new Vector(); + MulticastUtil.send("rollcall", foxMessage, 3); + long l2 = l / 100L; + for (int i = 0; i < 100; ++i) { + Thread.sleep(l2); + if (rollcallCallback == null) continue; + rollcallCallback.completed(i); + } + this.announcements = null; + Object[] objectArray = new FoxMessage[vector.size()]; + vector.copyInto(objectArray); + return objectArray; + } + } + + public void sendAnnouncement() throws Exception { + FoxMessage foxMessage; + if (this.server != null && (foxMessage = this.server.getAnnouncement()) != null) { + MulticastUtil.send("announcement", foxMessage, 3); + } + } + + private void receiveAnnouncement(FoxMessage foxMessage) { + Vector vector = this.announcements; + if (vector != null) { + vector.addElement(foxMessage); + } + } + + public void kill() { + this.isAlive = false; + this.interrupt(); + if (this.socket != null) { + this.socket.close(); + this.socket = null; + } + } + + public void run() { + while (this.isAlive) { + try { + FoxFrame foxFrame = MulticastUtil.receive(this.socket); + if (Fox.traceMulticast) { + System.out.println("-- Fox.multicast.recevied"); + foxFrame.dump(); + } + if (foxFrame.command == "rollcall") { + this.sendAnnouncement(); + continue; + } + if (foxFrame.command != "announcement") continue; + this.receiveAnnouncement(foxFrame.message); + } + catch (Throwable throwable) { + if (!this.isAlive) continue; + throwable.printStackTrace(); + } + } + } + + public static interface RollcallCallback { + public void completed(int var1); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/MulticastUtil.java b/modules/cfr_output/com/tridium/fox/session/MulticastUtil.java new file mode 100644 index 0000000..068ab0b --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/MulticastUtil.java @@ -0,0 +1,113 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxBoolean; +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.message.MessageReader; +import com.tridium.fox.message.MessageWriter; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxFrame; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.Inet6Address; +import java.net.InetAddress; +import java.net.MulticastSocket; + +public class MulticastUtil { + public static FoxFrame makeFrame(String string, FoxMessage foxMessage) { + return new FoxFrame(109, -1, -1, "fox", string, foxMessage); + } + + public static void send(String string, FoxMessage foxMessage, int n) throws Exception { + MulticastUtil.send(MulticastUtil.makeFrame(string, foxMessage), n); + } + + public static void send(FoxFrame foxFrame, int n) throws Exception { + int n2; + if (!Fox.ipv4Enabled && !Fox.ipv6Enabled || !Fox.multicastEnabled) { + return; + } + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(256); + MessageWriter messageWriter = new MessageWriter(byteArrayOutputStream); + foxFrame.write(messageWriter); + byte[] byArray = byteArrayOutputStream.toByteArray(); + DatagramPacket datagramPacket = Fox.ipv4Enabled ? new DatagramPacket(byArray, byArray.length, InetAddress.getByName(Fox.MULTICAST_ADDRESS), 1911) : null; + DatagramPacket datagramPacket2 = Fox.ipv6Enabled ? new DatagramPacket(byArray, byArray.length, InetAddress.getByName(Fox.IPV6_MULTICAST_ADDRESS), 1911) : null; + MulticastSocket multicastSocket = new MulticastSocket(); + multicastSocket.setTimeToLive(Fox.multicastTimeToLive); + IOException iOException = null; + IOException iOException2 = null; + boolean bl = false; + boolean bl2 = false; + try { + if (datagramPacket != null) { + for (n2 = 0; n2 < n; ++n2) { + Thread.sleep(100L); + multicastSocket.send(datagramPacket); + } + bl = true; + } + } + catch (IOException iOException3) { + System.err.println("WARNING: Could not send IPv4 multicast packet: " + iOException3); + bl = false; + iOException = iOException3; + } + try { + if (datagramPacket2 != null) { + for (n2 = 0; n2 < n; ++n2) { + Thread.sleep(100L); + multicastSocket.send(datagramPacket2); + } + bl2 = true; + } + } + catch (IOException iOException4) { + System.err.println("WARNING: Could not send IPv6 multicast packet: " + iOException4); + bl2 = false; + iOException2 = iOException4; + } + if (!bl2 && !bl) { + String string = Fox.ipv4Enabled && iOException != null ? iOException.getMessage() : null; + String string2 = Fox.ipv6Enabled && iOException2 != null ? iOException2.getMessage() : null; + String string3 = "OK"; + if (string != null) { + string3 = string; + } + if (string2 != null) { + string3 = string == null ? string2 : string3 + ", " + string2; + } + throw new IOException("ERROR: Could not send Fox multicast packet(s): (" + string3 + ")"); + } + } + + public static FoxFrame receive(DatagramSocket datagramSocket) throws Exception { + byte[] byArray = new byte[1024]; + DatagramPacket datagramPacket = new DatagramPacket(byArray, byArray.length); + datagramSocket.receive(datagramPacket); + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(datagramPacket.getData(), 0, datagramPacket.getLength()); + MessageReader messageReader = new MessageReader(byteArrayInputStream); + FoxFrame foxFrame = FoxFrame.read(messageReader); + if (datagramPacket.getAddress() instanceof Inet6Address) { + foxFrame.message.add("IPv6FoxFrameMulticastReceived", true); + } + return foxFrame; + } + + public static boolean isIpv6Message(FoxMessage foxMessage) { + FoxTuple[] foxTupleArray = foxMessage.list("IPv6FoxFrameMulticastReceived"); + boolean bl = false; + if (foxTupleArray != null && foxTupleArray.length != 0) { + FoxBoolean foxBoolean = (FoxBoolean)foxTupleArray[foxTupleArray.length - 1]; + bl = foxBoolean.value; + } + return bl; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/ServerException.java b/modules/cfr_output/com/tridium/fox/session/ServerException.java new file mode 100644 index 0000000..f0156ea --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/ServerException.java @@ -0,0 +1,12 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +public class ServerException +extends RuntimeException { + public ServerException(String string) { + super(string); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/SessionBedroom.java b/modules/cfr_output/com/tridium/fox/session/SessionBedroom.java new file mode 100644 index 0000000..8232c1b --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/SessionBedroom.java @@ -0,0 +1,113 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxFrame; +import java.io.InterruptedIOException; + +public class SessionBedroom { + private Bed[] bedTable = new Bed[4]; + + synchronized Bed getBed(Thread thread) { + Bed[] bedArray; + int n; + for (n = 0; n < this.bedTable.length && this.bedTable[n] != null; ++n) { + } + if (n == this.bedTable.length) { + bedArray = new Bed[this.bedTable.length * 2]; + System.arraycopy(this.bedTable, 0, bedArray, 0, this.bedTable.length); + this.bedTable = bedArray; + } + bedArray = new Bed(); + bedArray.replyNumber = n; + bedArray.thread = thread; + this.bedTable[n] = bedArray; + return bedArray; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + void sleep(Bed bed) throws InterruptedIOException { + try { + Bed bed2 = bed; + synchronized (bed2) { + long l = Fox.clock.ticks(); + while (!bed.haveReply && Fox.clock.ticks() - l < (long)Fox.requestTimeout) { + long l2 = (long)Fox.requestTimeout - (Fox.clock.ticks() - l); + if (l2 < 50L) { + l2 = 50L; + } + bed.wait(l2); + } + } + } + catch (InterruptedException interruptedException) { + throw new InterruptedIOException(); + } + finally { + SessionBedroom sessionBedroom = this; + synchronized (sessionBedroom) { + bed.thread = null; + this.bedTable[bed.replyNumber] = null; + } + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + void wake(FoxFrame foxFrame) throws Exception { + Bed bed = null; + Object object = this; + synchronized (object) { + bed = this.bedTable[foxFrame.replyNumber]; + } + if (bed == null) { + return; + } + object = bed; + synchronized (object) { + bed.haveReply = true; + bed.reply = foxFrame; + bed.notify(); + return; + } + } + + synchronized void wakeAll() { + for (int i = 0; i < this.bedTable.length; ++i) { + Bed bed = this.bedTable[i]; + if (bed == null) continue; + bed.thread.interrupt(); + bed.thread = null; + } + } + + public synchronized String toString() { + StringBuffer stringBuffer = new StringBuffer(); + for (int i = 0; i < this.bedTable.length; ++i) { + Bed bed = this.bedTable[i]; + if (bed == null) continue; + stringBuffer.append(bed.replyNumber).append(": ").append(bed.thread).append('\n'); + } + if (stringBuffer.length() == 0) { + return "empty"; + } + stringBuffer.setLength(stringBuffer.length() - 1); + return stringBuffer.toString(); + } + + static class Bed { + int replyNumber; + FoxFrame reply; + boolean haveReply = false; + Thread thread; + + Bed() { + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/SessionCircuits.java b/modules/cfr_output/com/tridium/fox/session/SessionCircuits.java new file mode 100644 index 0000000..41a2119 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/SessionCircuits.java @@ -0,0 +1,262 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxCircuit; +import com.tridium.fox.session.FoxFrame; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.session.IntMap; +import com.tridium.fox.session.InvalidCommandException; + +public class SessionCircuits { + static final int THREAD_POOL_SIZE = 2; + private FoxSession session; + private IntMap circuits = new IntMap(); + private int nextId; + private ServiceThread[] threadPool = new ServiceThread[2]; + private int nonPoolServiceCount; + + SessionCircuits(FoxSession foxSession) { + this.session = foxSession; + this.nextId = foxSession.isServer() ? 0 : 1; + } + + synchronized FoxCircuit alloc(String string, String string2) { + int n = this.nextId; + this.nextId += 2; + FoxCircuit foxCircuit = new FoxCircuit(n, this.session, string, string2); + this.circuits.put(n, foxCircuit); + return foxCircuit; + } + + synchronized void free(FoxCircuit foxCircuit) { + this.circuits.remove(foxCircuit.id); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + void kill() { + FoxCircuit[] foxCircuitArray = (FoxCircuit[])this.circuits.toArray(new FoxCircuit[this.circuits.size()]); + for (int i = 0; i < foxCircuitArray.length; ++i) { + try { + foxCircuitArray[i].close(); + continue; + } + catch (Throwable throwable) { + throwable.printStackTrace(); + } + } + ServiceThread[] serviceThreadArray = this.threadPool; + synchronized (this.threadPool) { + for (int i = 0; i < this.threadPool.length; ++i) { + if (this.threadPool[i] == null) continue; + try { + this.threadPool[i].kill(); + } + catch (Throwable throwable) { + throwable.printStackTrace(); + } + this.threadPool[i] = null; + } + // ** MonitorExit[var2_3] (shouldn't be in output) + return; + } + } + + void circuitRequestReceived(FoxFrame foxFrame) throws Exception { + String string = foxFrame.command; + if (string == "open") { + this.processOpen(foxFrame.message); + return; + } + if (string == "stream") { + this.processStream(foxFrame.message); + return; + } + if (string == "close") { + this.processClose(foxFrame.message); + return; + } + throw new InvalidCommandException(string); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + void processOpen(FoxMessage foxMessage) throws Exception { + int n = foxMessage.getInt("id"); + String string = foxMessage.getString("channel").intern(); + String string2 = foxMessage.getString("command").intern(); + FoxCircuit foxCircuit = new FoxCircuit(n, this.session, string, string2); + SessionCircuits sessionCircuits = this; + synchronized (sessionCircuits) { + if (this.circuits.get(n) != null) { + throw new IllegalStateException("Circuit already allocated: " + n); + } + this.circuits.put(n, foxCircuit); + } + this.runCircuit(foxCircuit); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + void processStream(FoxMessage foxMessage) throws Exception { + int n = foxMessage.getInt("id"); + byte[] byArray = foxMessage.getBlob("data"); + FoxCircuit foxCircuit = null; + SessionCircuits sessionCircuits = this; + synchronized (sessionCircuits) { + foxCircuit = (FoxCircuit)this.circuits.get(n); + } + if (foxCircuit != null) { + foxCircuit.pushIn(byArray); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + void processClose(FoxMessage foxMessage) throws Exception { + int n = foxMessage.getInt("id"); + FoxCircuit foxCircuit = null; + SessionCircuits sessionCircuits = this; + synchronized (sessionCircuits) { + foxCircuit = (FoxCircuit)this.circuits.get(n); + } + if (foxCircuit != null) { + foxCircuit.close(); + } + } + + public synchronized String toString() { + int n; + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("ThreadPool\n"); + for (n = 0; n < this.threadPool.length; ++n) { + stringBuffer.append(" pool[").append(n).append("] = "); + if (this.threadPool[n] == null) { + stringBuffer.append("null"); + } else { + stringBuffer.append(this.threadPool[n].serviceCount); + } + stringBuffer.append('\n'); + } + stringBuffer.append(" nonPoolServiceCount = " + this.nonPoolServiceCount).append('\n'); + stringBuffer.append("Circuits\n"); + if (this.circuits.size() == 0) { + stringBuffer.append(" none\n"); + } else { + for (n = 0; n < this.circuits.size(); ++n) { + FoxCircuit foxCircuit = (FoxCircuit)this.circuits.get(n); + if (foxCircuit == null) continue; + stringBuffer.append(" ").append(foxCircuit).append('\n'); + } + } + return stringBuffer.toString(); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + void runCircuit(FoxCircuit foxCircuit) { + ServiceThread[] serviceThreadArray = this.threadPool; + synchronized (this.threadPool) { + for (int i = 0; i < this.threadPool.length; ++i) { + if (this.threadPool[i] == null) { + this.threadPool[i] = new ServiceThread(this.session, "Fox:Circuit:" + this.session.getId() + " (Pooled:" + i + ")", true); + this.threadPool[i].start(); + } + if (!this.threadPool[i].isAvailable()) continue; + this.threadPool[i].runCircuit(foxCircuit); + // ** MonitorExit[var2_2] (shouldn't be in output) + return; + } + ++this.nonPoolServiceCount; + ServiceThread serviceThread = new ServiceThread(this.session, "Fox:Circuit:" + this.session.getId() + " (Non-pooled)", false); + serviceThread.start(); + serviceThread.runCircuit(foxCircuit); + // ** MonitorExit[var2_2] (shouldn't be in output) + return; + } + } + + static class ServiceThread + implements Runnable { + Thread thread; + boolean isAlive = true; + boolean pooled; + FoxCircuit circuit; + int serviceCount; + + ServiceThread(FoxSession foxSession, String string, boolean bl) { + this.thread = foxSession.conn.makeThread(Fox.threadGroup, this, string); + this.pooled = bl; + } + + public void start() { + this.thread.start(); + } + + public synchronized void kill() { + this.isAlive = false; + this.notify(); + } + + public synchronized boolean isAvailable() { + return this.circuit == null; + } + + public synchronized void runCircuit(FoxCircuit foxCircuit) { + if (this.circuit != null) { + throw new IllegalStateException(); + } + this.circuit = foxCircuit; + this.notify(); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void run() { + while (this.isAlive) { + ServiceThread serviceThread = this; + synchronized (serviceThread) { + while (this.circuit == null) { + if (!this.isAlive) { + return; + } + try { + this.wait(); + } + catch (InterruptedException interruptedException) { + interruptedException.printStackTrace(); + } + } + } + ++this.serviceCount; + try { + this.circuit.session().conn().circuitOpened(this.circuit); + } + catch (Throwable throwable) { + throwable.printStackTrace(); + } + finally { + this.circuit.close(); + } + serviceThread = this; + synchronized (serviceThread) { + this.circuit = null; + if (!this.pooled) { + return; + } + } + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/SessionDispatcher.java b/modules/cfr_output/com/tridium/fox/session/SessionDispatcher.java new file mode 100644 index 0000000..1f3d3ff --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/SessionDispatcher.java @@ -0,0 +1,81 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxFrame; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.session.FrameQueue; + +public class SessionDispatcher +implements Runnable { + private FoxSession session; + private String name; + private boolean isAlive; + private Thread thread; + private FrameQueue queue; + + public SessionDispatcher(FoxSession foxSession) { + this.name = "Fox:Dispatcher:" + foxSession.getId(); + this.session = foxSession; + this.queue = new FrameQueue(); + this.isAlive = true; + } + + public void enqueue(FoxFrame foxFrame) throws InterruptedException { + if (this.session.isClosed()) { + throw new InterruptedException("FoxSession is closed"); + } + this.queue.enqueue(foxFrame); + } + + public void start() { + this.thread = this.session.conn.makeThread(Fox.threadGroup, this, this.name); + this.thread.start(); + } + + public void kill() { + this.isAlive = false; + if (this.thread != null) { + this.thread.interrupt(); + this.thread = null; + } + this.queue.kill(); + } + + public void run() { + while (this.isAlive && !this.session.isClosed()) { + try { + FoxFrame foxFrame = this.queue.dequeue(-1); + this.dispatch(foxFrame); + } + catch (InterruptedException interruptedException) { + } + catch (Throwable throwable) { + throwable.printStackTrace(); + } + } + } + + private void dispatch(FoxFrame foxFrame) throws InterruptedException { + block2: { + try { + FoxResponse foxResponse = foxFrame.channel == "fox" ? this.session.processFoxChannelRequest((FoxRequest)foxFrame.message) : this.session.conn().process((FoxRequest)foxFrame.message); + this.session.sendReply(foxFrame, foxResponse); + } + catch (Throwable throwable) { + if (!this.isAlive) break block2; + throwable.printStackTrace(); + this.session.sendError(foxFrame, throwable); + } + } + } + + public String toString() { + return this.name + " {" + this.queue + "}"; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/SessionReceiver.java b/modules/cfr_output/com/tridium/fox/session/SessionReceiver.java new file mode 100644 index 0000000..32aac96 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/SessionReceiver.java @@ -0,0 +1,61 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxFrame; +import com.tridium.fox.session.FoxSession; + +public class SessionReceiver +implements Runnable { + FoxSession session; + String name; + volatile boolean isAlive; + Thread thread; + + public SessionReceiver(FoxSession foxSession) { + this.session = foxSession; + this.name = "Fox:Receiver:" + foxSession.getId(); + this.isAlive = true; + } + + public void start() { + this.thread = this.session.conn.makeThread(Fox.threadGroup, this, this.name); + this.thread.start(); + } + + public void kill() { + this.isAlive = false; + if (this.thread != null) { + this.thread.interrupt(); + this.thread = null; + } + } + + public void run() { + while (this.isAlive && !this.session.isClosed()) { + try { + FoxFrame foxFrame = this.session.readFrame(); + if (this.session.isClosed()) break; + if (foxFrame == null) continue; + if (foxFrame.frameType == 115 || foxFrame.frameType == 97) { + this.session.requestReceived(foxFrame); + continue; + } + this.session.replyReceived(foxFrame); + } + catch (Throwable throwable) { + if (this.isAlive) { + this.session.close(throwable); + } + return; + } + } + } + + public String toString() { + return this.name; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/SessionSender.java b/modules/cfr_output/com/tridium/fox/session/SessionSender.java new file mode 100644 index 0000000..f7ecccd --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/SessionSender.java @@ -0,0 +1,101 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxFrame; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.session.FrameQueue; +import java.io.IOException; + +public class SessionSender +implements Runnable { + private static FoxFrame keepAlive = new FoxFrame(107, -1, -1, "fox", "keepalive", new FoxMessage()); + private FoxSession session; + private String name; + private volatile boolean isAlive; + private Thread thread; + private FrameQueue queue; + private volatile boolean running = false; + + public SessionSender(FoxSession foxSession) { + this.name = "Fox:Sender:" + foxSession.getId(); + this.session = foxSession; + this.queue = new FrameQueue(); + this.isAlive = true; + } + + public void enqueue(FoxFrame foxFrame) throws InterruptedException { + this.queue.enqueue(foxFrame); + } + + public void start() { + this.thread = this.session.conn.makeThread(Fox.threadGroup, this, this.name); + this.thread.start(); + } + + public void kill() { + this.isAlive = false; + if (this.thread != null) { + this.thread.interrupt(); + this.thread = null; + } + this.queue.kill(); + } + + public boolean isRunning() { + return this.running; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void run() { + Object object; + try { + this.running = true; + while (this.isAlive && !this.session.isClosed()) { + try { + object = this.queue.dequeue(Fox.keepAliveInterval); + if (this.session.isClosed()) { + break; + } + if (object == null) { + object = keepAlive; + } + this.session.writeFrame((FoxFrame)object); + } + catch (InterruptedException interruptedException) { + } + catch (IOException iOException) { + this.session.close(iOException); + } + catch (Throwable throwable) { + throwable.printStackTrace(); + } + } + } + finally { + this.running = false; + Object object2 = object = this.session.getSessionStateLock(); + synchronized (object2) { + object.notifyAll(); + } + if (this.session.getState().equals("closed")) { + try { + if (this.session.getSocket() != null) { + this.session.getSocket().close(); + } + } + catch (Exception exception) {} + } + } + } + + public String toString() { + return this.name + " {" + this.queue + "}"; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/Tuner.java b/modules/cfr_output/com/tridium/fox/session/Tuner.java new file mode 100644 index 0000000..1777f92 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/Tuner.java @@ -0,0 +1,271 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.nre.auth.ScramSha256Client + * com.tridium.user.BRetrievePasswordCredential + * com.tridium.util.ValueByteBuffer + * javax.baja.log.Log + * javax.baja.security.BHttpFoxCredentials + * javax.baja.security.BICredentials + * javax.baja.security.BUsernameAndPassword + * javax.baja.sys.BObject + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.user.BUserService + */ +package com.tridium.fox.session; + +import com.tridium.fox.kerberos.KerberosAuthenticator; +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxAuthenticationException; +import com.tridium.fox.session.FoxConnection; +import com.tridium.fox.session.FoxFrame; +import com.tridium.fox.session.FoxServer; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.session.FoxsRedirectException; +import com.tridium.fox.sys.BFoxDefaultAuthAgent; +import com.tridium.fox.sys.BFoxService; +import com.tridium.fox.sys.BIFoxAuthAgent; +import com.tridium.nre.auth.ScramSha256Client; +import com.tridium.user.BRetrievePasswordCredential; +import com.tridium.util.ValueByteBuffer; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.net.Socket; +import java.security.MessageDigest; +import javax.baja.log.Log; +import javax.baja.security.BHttpFoxCredentials; +import javax.baja.security.BICredentials; +import javax.baja.security.BUsernameAndPassword; +import javax.baja.sys.BObject; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.user.BUserService; + +public class Tuner +extends Thread { + private FoxServer server; + private FoxSession session; + private String scheme; + + static FoxSession openClient(FoxConnection foxConnection, Socket socket, String string, String string2, FoxSession.IFoxSessionListener[] iFoxSessionListenerArray) throws Exception { + BUsernameAndPassword bUsernameAndPassword = new BUsernameAndPassword(string, string2); + return Tuner.openClient(foxConnection, socket, (BICredentials)bUsernameAndPassword, iFoxSessionListenerArray); + } + + /* + * Enabled force condition propagation + * Lifted jumps to return sites + */ + static FoxSession openClient(FoxConnection foxConnection, Socket socket, BICredentials bICredentials, FoxSession.IFoxSessionListener[] iFoxSessionListenerArray) throws Exception { + byte[] byArray = ValueByteBuffer.marshal((BObject)((BObject)bICredentials)); + FoxSession foxSession = new FoxSession(socket, foxConnection, iFoxSessionListenerArray); + foxSession.setState("client.tune open credentials.len=" + byArray.length); + Fox.register(foxSession); + try { + foxSession.setState("client.tune sendHello"); + foxSession.sendHello(null); + foxSession.setState("client.tune receiveHello"); + foxSession.receiveHello(); + foxSession.setState("client.tune receiveChallenge"); + FoxMessage foxMessage = foxSession.receiveTuning("challenge"); + String string = foxMessage.getString("method"); + foxSession.setState("client.tune receivedChallenge method=" + string); + if (string.equals("basic")) { + FoxMessage foxMessage2 = new FoxMessage(); + if (bICredentials instanceof BUsernameAndPassword) { + BUsernameAndPassword bUsernameAndPassword = (BUsernameAndPassword)bICredentials; + foxMessage2.add("username", bUsernameAndPassword.getUsername()); + foxMessage2.add("password", bUsernameAndPassword.getPassword().getValue()); + } else if (bICredentials instanceof BRetrievePasswordCredential) { + BRetrievePasswordCredential bRetrievePasswordCredential = (BRetrievePasswordCredential)bICredentials; + foxMessage2.add("username", bRetrievePasswordCredential.getUsername()); + foxMessage2.add("email", bRetrievePasswordCredential.getEmail()); + } else { + if (!(bICredentials instanceof BHttpFoxCredentials)) throw new IllegalStateException(); + BHttpFoxCredentials bHttpFoxCredentials = (BHttpFoxCredentials)bICredentials; + byte[] byArray2 = byArray; + foxMessage2.add("username", bHttpFoxCredentials.getUsername()); + foxMessage2.add("credentials", byArray2); + } + foxSession.setState("client.tune sendLogin"); + foxSession.sendTuning("login", foxMessage2); + Tuner.receiveWelcome(foxSession, string); + } else if (string.equals("digest-md5")) { + if (foxSession.getRemoteHello().getString("fox.version", "1.0").compareTo("1.0.1") < 0) { + FoxMessage foxMessage3 = new FoxMessage(); + BUsernameAndPassword bUsernameAndPassword = (BUsernameAndPassword)bICredentials; + byte[] byArray3 = foxMessage.getBlob("nonce"); + String string2 = bUsernameAndPassword.getUsername(); + byte[] byArray4 = Tuner.generateDigest(string2, bUsernameAndPassword.getPassword().getValue(), byArray3); + foxMessage3.add("username", string2); + foxMessage3.add("digest", byArray4); + foxSession.setState("client.tune sendLogin"); + foxSession.sendTuning("login", foxMessage3); + Tuner.receiveWelcome(foxSession, string); + } + } else if (string.equals("digest")) { + if (bICredentials instanceof BUsernameAndPassword) { + try { + FoxMessage foxMessage4 = new FoxMessage(); + foxMessage4.add("authInput", "authInputScram"); + BUsernameAndPassword bUsernameAndPassword = (BUsernameAndPassword)bICredentials; + ScramSha256Client scramSha256Client = new ScramSha256Client(bUsernameAndPassword.getUsername(), bUsernameAndPassword.getPassword().getValue()); + foxMessage4.add("authHandshake1", scramSha256Client.createClientFirstMessage()); + foxSession.setState("client.tune send scramsha1-clientFirstMessage"); + foxSession.sendTuning("authMessage1", foxMessage4); + FoxMessage foxMessage5 = foxSession.receiveTuning("authMessage1"); + foxMessage4 = new FoxMessage(); + String string3 = foxMessage5.getString("authHandshake1"); + foxMessage4.add("authHandshake2", scramSha256Client.createClientFinalMessage(string3)); + foxSession.setState("client.tune send scramsha1-clientFinalMessage"); + foxSession.sendTuning("authMessage2", foxMessage4); + foxMessage5 = foxSession.receiveTuning("authMessage2"); + String string4 = foxMessage5.getString("authHandshake2"); + foxSession.setState("client.tune process scramsha1-serverFinalMessage"); + scramSha256Client.processServerFinalMessage(string4); + } + catch (Exception exception) { + throw new FoxAuthenticationException("Rejected", string, null, foxSession); + } + Tuner.receiveWelcome(foxSession, string); + } else if (bICredentials instanceof BRetrievePasswordCredential) { + FoxMessage foxMessage6 = new FoxMessage(); + foxMessage6.add("authInput", "authInputRetrieve"); + BRetrievePasswordCredential bRetrievePasswordCredential = (BRetrievePasswordCredential)bICredentials; + foxMessage6.add("username", bRetrievePasswordCredential.getUsername()); + foxMessage6.add("email", bRetrievePasswordCredential.getEmail()); + foxSession.setState("client.tune sendFirstMessage"); + foxSession.sendTuning("authMessage1", foxMessage6); + Tuner.receiveWelcome(foxSession, string); + } else { + if (!(bICredentials instanceof BHttpFoxCredentials)) throw new IllegalStateException(); + FoxMessage foxMessage7 = new FoxMessage(); + foxMessage7.add("authInput", "authInputHttp"); + BHttpFoxCredentials bHttpFoxCredentials = (BHttpFoxCredentials)bICredentials; + byte[] byArray5 = byArray; + foxMessage7.add("username", bHttpFoxCredentials.getUsername()); + foxMessage7.add("credentials", byArray5); + foxSession.setState("client.tune sendFirstMessage"); + foxSession.sendTuning("authMessage1", foxMessage7); + Tuner.receiveWelcome(foxSession, string); + } + } else { + if (!string.equals("kerberos")) throw new FoxAuthenticationException("Unknown challenge method ", string, foxSession); + if (System.getProperty("java.vm.name").equalsIgnoreCase("J9")) { + throw new FoxAuthenticationException("Unsupported challenge method: ", string, foxSession); + } + if (bICredentials instanceof BHttpFoxCredentials) { + FoxMessage foxMessage8 = new FoxMessage(); + foxMessage8.add("authInput", "authInputHttp"); + BHttpFoxCredentials bHttpFoxCredentials = (BHttpFoxCredentials)bICredentials; + byte[] byArray6 = byArray; + foxMessage8.add("username", bHttpFoxCredentials.getUsername()); + foxMessage8.add("credentials", byArray6); + foxSession.setState("client.tune sendFirstMessage"); + foxSession.sendTuning("authMessage1", foxMessage8); + Tuner.receiveWelcome(foxSession, string); + } else { + KerberosAuthenticator.authenticate(foxSession, foxMessage, bICredentials); + Tuner.receiveWelcome(foxSession, string); + } + } + foxSession.setState("client.tune starting"); + foxSession.start(); + return foxSession; + } + catch (Error error) { + foxSession.close(error); + throw error; + } + catch (Exception exception) { + foxSession.close(exception); + throw exception; + } + } + + private static void receiveWelcome(FoxSession foxSession, String string) throws IOException, FoxAuthenticationException { + foxSession.setState("client.tune receiveWelcome"); + FoxFrame foxFrame = foxSession.readFrame(); + if (foxFrame.command != "welcome") { + foxSession.setState("client.tune receivedRejected"); + String string2 = foxFrame.message.getString("fatal", null); + String string3 = foxFrame.message.getString("msg", null); + FoxAuthenticationException foxAuthenticationException = null != string3 ? new FoxAuthenticationException(string3, string, string2, foxSession) : new FoxAuthenticationException("Rejected", string, string2, foxSession); + try { + foxAuthenticationException.data = foxFrame.message.getMessage("data"); + } + catch (IOException iOException) { + foxAuthenticationException.data = null; + } + throw foxAuthenticationException; + } + foxSession.remoteWelcome = foxFrame.message; + foxSession.setState("client.tune receivedWelcome"); + } + + static void openServer(FoxServer foxServer, Socket socket, String string) throws Exception { + FoxSession foxSession = new FoxSession(socket, foxServer.makeConnection(null, null)); + int n = Math.max(1, Fox.maxServerSessions); + if (Fox.getServerSessionCount() >= n) { + Log.getLog((String)"fox").warning("past fox.maxServerSessions limit: " + n); + foxSession.sendBusy(); + } + Fox.register(foxSession); + foxSession.setState("server.tune spawning"); + new Tuner(foxServer, foxSession, string).start(); + } + + private Tuner(FoxServer foxServer, FoxSession foxSession, String string) { + super("Fox:Tuner:" + foxSession.getId()); + this.server = foxServer; + this.session = foxSession; + this.scheme = string; + } + + public void run() { + try { + this.session.setState("server.tune receiveHello"); + if (!this.session.receiveHello()) { + this.session.start(); + return; + } + this.session.setState("server.tune makeConnection"); + this.session.conn = this.server.makeConnection(this.session, this.session.getRemoteHello()); + BFoxService bFoxService = (BFoxService)Sys.getService((Type)BFoxService.TYPE); + if (this.scheme.equalsIgnoreCase("fox") && bFoxService.getFoxsOnly() && bFoxService.getFoxsEnabled()) { + this.session.setState("server.tune sendRedirect"); + this.session.sendRedirect(bFoxService.getFoxsPort()); + throw new FoxsRedirectException(bFoxService.getFoxsPort()); + } + this.session.setState("server.tune sendHello"); + this.session.sendHello(null); + BUserService bUserService = (BUserService)Sys.getService((Type)BUserService.TYPE); + BIFoxAuthAgent bIFoxAuthAgent = (BIFoxAuthAgent)bUserService.getAuthAgent(BIFoxAuthAgent.TYPE); + if (null != bIFoxAuthAgent) { + bIFoxAuthAgent.authenticate(this.session, this.server); + } else { + BFoxDefaultAuthAgent.INSTANCE.authenticate(this.session, this.server); + } + } + catch (Throwable throwable) { + this.session.close(throwable); + } + } + + public static byte[] generateDigest(String string, String string2, byte[] byArray) throws Exception { + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream); + dataOutputStream.writeUTF(string); + dataOutputStream.writeUTF(string2); + dataOutputStream.write(byArray); + byte[] byArray2 = byteArrayOutputStream.toByteArray(); + MessageDigest messageDigest = MessageDigest.getInstance("MD5"); + messageDigest.update(byArray2); + return messageDigest.digest(); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/session/TunnelReceiver.java b/modules/cfr_output/com/tridium/fox/session/TunnelReceiver.java new file mode 100644 index 0000000..5d97fa4 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/session/TunnelReceiver.java @@ -0,0 +1,33 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.session; + +import com.tridium.fox.session.FoxFrame; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.session.SessionReceiver; + +public class TunnelReceiver +extends SessionReceiver { + public TunnelReceiver(FoxSession foxSession) { + super(foxSession); + this.name = "Fox:TunnelReceiver:" + foxSession.getId(); + } + + public void run() { + while (this.isAlive && !this.session.isClosed()) { + try { + FoxFrame foxFrame = this.session.readTunnelFrame(); + if (this.session.isClosed()) break; + this.session.writeFrame(foxFrame); + } + catch (Throwable throwable) { + if (this.isAlive) { + this.session.close(throwable); + } + return; + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/Acceptor.java b/modules/cfr_output/com/tridium/fox/sys/Acceptor.java new file mode 100644 index 0000000..4770d8c --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/Acceptor.java @@ -0,0 +1,130 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.license.Brand + * javax.baja.license.Feature + * javax.baja.license.LicenseException + * javax.baja.log.Log + * javax.baja.sys.BObject + * javax.baja.sys.Sys + */ +package com.tridium.fox.sys; + +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxConnection; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.sys.BFoxConnection; +import com.tridium.fox.sys.BFoxService; +import com.tridium.fox.sys.MismatchedStationNamesException; +import com.tridium.fox.sys.NiagaraStation; +import com.tridium.sys.license.Brand; +import javax.baja.license.Feature; +import javax.baja.license.LicenseException; +import javax.baja.log.Log; +import javax.baja.sys.BObject; +import javax.baja.sys.Sys; + +public class Acceptor { + public static final Log log = Log.getLog((String)"fox"); + private static boolean licenseChecked = false; + private static boolean foxTunnelingLicensed = false; + + public static void accept(FoxSession foxSession) { + boolean bl; + boolean bl2 = foxSession.isServer(); + boolean bl3 = false; + if (foxSession.getRemoteHello().getString("station.name", null) != null || foxSession.getRemoteHello().getString("app.name", "").equals("Station")) { + bl3 = true; + } + boolean bl4 = bl3; + boolean bl5 = false; + if (Sys.getStation() != null) { + bl5 = bl = true; + } + if (bl2) { + if (bl4) { + Acceptor.acceptStationIn(foxSession); + } else { + Acceptor.acceptWbIn(foxSession); + } + } else if (bl) { + Acceptor.acceptStationOut(foxSession); + } else { + Acceptor.acceptWbOut(foxSession); + } + } + + static final void acceptTunnel(FoxConnection foxConnection) { + Object object; + int n = -1; + if (foxConnection instanceof BObject && (object = ((BObject)foxConnection).fw(803, null, null, null, null)) instanceof Integer) { + n = (Integer)object; + } + if (foxConnection.isTunnelServerConnection() && !Acceptor.foxTunnelingLicensed() && n == -1) { + throw new LicenseException("Connection failure, fox tunneling is not licensed."); + } + } + + private static final void acceptStationIn(FoxSession foxSession) { + log.trace("Accept.station.in: " + foxSession); + String string = foxSession.getRemoteHello().getString("brandId", null); + Brand.checkStationIn((String)string); + BFoxConnection bFoxConnection = (BFoxConnection)foxSession.conn(); + NiagaraStation niagaraStation = bFoxConnection.getParentStation(); + if (niagaraStation != null && niagaraStation.isFatalFault()) { + throw new LicenseException("Station in fatal fault: " + niagaraStation.getFaultCause()); + } + } + + private static final void acceptStationOut(FoxSession foxSession) { + String string; + log.trace("Accept.station.out: " + foxSession); + BFoxConnection bFoxConnection = (BFoxConnection)foxSession.conn(); + NiagaraStation niagaraStation = bFoxConnection.getParentStation(); + if (niagaraStation != null) { + string = niagaraStation.getStationName(); + String string2 = foxSession.getRemoteHello().getString("station.name", null); + if (string != null && string2 != null && !string.equals(string2)) { + throw new MismatchedStationNamesException(string, string2); + } + } + string = foxSession.getRemoteHello().getString("brandId", null); + Brand.checkStationOut((String)string); + } + + private static final void acceptWbIn(FoxSession foxSession) { + log.trace("Accept.wb.in: " + foxSession); + String string = foxSession.getRemoteHello().getString("brandId", null); + Brand.checkWbIn((String)string); + } + + private static final void acceptWbOut(FoxSession foxSession) { + log.trace("Accept.wb.out: " + foxSession); + String string = foxSession.getRemoteHello().getString("brandId", null); + Brand.checkWbOut((String)string); + } + + public static final boolean foxTunnelingLicensed() { + block4: { + if (!licenseChecked) { + licenseChecked = true; + try { + Feature feature = Sys.getLicenseManager().getFeature("tridium", "tunneling"); + feature.check(); + foxTunnelingLicensed = feature.getb("fox", false); + } + catch (Exception exception) { + foxTunnelingLicensed = false; + if (!Fox.tunnelingEnabled) break block4; + BFoxService.log.trace("Fox tunneling not licensed."); + } + } + } + if (!foxTunnelingLicensed) { + Fox.tunnelingEnabled = false; + } + return foxTunnelingLicensed; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxAuthAgent.java b/modules/cfr_output/com/tridium/fox/sys/BFoxAuthAgent.java new file mode 100644 index 0000000..42a1cc1 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxAuthAgent.java @@ -0,0 +1,312 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.user.BUserPasswordConfiguration + * com.tridium.user.BUserServicePasswordConfiguration + * com.tridium.util.ValueByteBuffer + * javax.baja.registry.TypeInfo + * javax.baja.security.BICredentials + * javax.baja.sys.BAbsTime + * javax.baja.sys.BBoolean + * javax.baja.sys.BComplex + * javax.baja.sys.BFacets + * javax.baja.sys.BInteger + * javax.baja.sys.BObject + * javax.baja.sys.BRelTime + * javax.baja.sys.BString + * javax.baja.sys.BasicContext + * javax.baja.sys.Clock + * javax.baja.sys.Context + * javax.baja.sys.Flags + * javax.baja.sys.Localizable + * javax.baja.sys.LocalizableRuntimeException + * javax.baja.sys.Property + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.user.BAuthAgent + * javax.baja.user.BUser + * javax.baja.user.BUserService + * javax.baja.util.BTypeSpec + */ +package com.tridium.fox.sys; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.FoxAuthenticationException; +import com.tridium.fox.session.FoxServer; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.sys.BFoxServerConnection; +import com.tridium.fox.sys.BIFoxAuthAgent; +import com.tridium.user.BUserPasswordConfiguration; +import com.tridium.user.BUserServicePasswordConfiguration; +import com.tridium.util.ValueByteBuffer; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.util.HashMap; +import java.util.Random; +import javax.baja.registry.TypeInfo; +import javax.baja.security.BICredentials; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BComplex; +import javax.baja.sys.BFacets; +import javax.baja.sys.BInteger; +import javax.baja.sys.BObject; +import javax.baja.sys.BRelTime; +import javax.baja.sys.BString; +import javax.baja.sys.BasicContext; +import javax.baja.sys.Clock; +import javax.baja.sys.Context; +import javax.baja.sys.Flags; +import javax.baja.sys.Localizable; +import javax.baja.sys.LocalizableRuntimeException; +import javax.baja.sys.Property; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.user.BAuthAgent; +import javax.baja.user.BUser; +import javax.baja.user.BUserService; +import javax.baja.util.BTypeSpec; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BFoxAuthAgent +extends BAuthAgent +implements BIFoxAuthAgent { + public static final Type TYPE; + private static TypeInfo USER_SYNC_EXT_TYPE; + private static int nonceCount; + private static Random nonceRandom; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxAuthAgent; + static /* synthetic */ Class class$com$tridium$user$BUserServicePasswordConfiguration; + static /* synthetic */ Class class$com$tridium$user$BUserPasswordConfiguration; + + public Type getType() { + return TYPE; + } + + public boolean authenticate(FoxSession foxSession, FoxServer foxServer) throws Exception { + boolean bl = false; + boolean bl2 = false; + Throwable throwable = null; + Throwable throwable2 = null; + try { + switch (foxServer.getAuthenticationPolicy()) { + case 0: { + bl = this.authenticateBasic(foxSession); + break; + } + case 1: { + bl = this.authenticateDigest(foxSession); + break; + } + default: { + throw new IllegalStateException("Unknown authentication policy"); + } + } + } + catch (Throwable throwable3) { + bl = false; + if (!bl2) { + throwable = throwable3; + } + throwable2 = throwable3; + } + if (bl) { + this.acceptAuthentication(foxSession); + } else { + this.rejectAuthentication(foxSession, throwable, throwable2); + } + return bl; + } + + protected boolean authenticateBasic(FoxSession foxSession) throws Exception { + throw new FoxAuthenticationException("unimplemented method authenticateBasic", foxSession); + } + + protected boolean authenticateDigest(FoxSession foxSession) throws Exception { + throw new FoxAuthenticationException("unimplemented method authenticateDigest", foxSession); + } + + protected boolean authenticateTransactional(FoxSession foxSession) throws Exception { + throw new FoxAuthenticationException("unimplemented method authenticateSpecialized", foxSession); + } + + public byte[] generateNonce(FoxSession foxSession) throws Exception { + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream); + dataOutputStream.writeUTF("nonce"); + dataOutputStream.writeInt(nonceCount++); + dataOutputStream.writeUTF(foxSession.getRemoteHost()); + dataOutputStream.writeInt(foxSession.getRemotePort()); + dataOutputStream.writeLong(System.currentTimeMillis()); + dataOutputStream.writeInt(nonceRandom.nextInt()); + return byteArrayOutputStream.toByteArray(); + } + + public void acceptAuthentication(FoxSession foxSession) throws Exception { + FoxMessage foxMessage = new FoxMessage(); + boolean bl = false; + try { + BUserService bUserService = (BUserService)Sys.getService((Type)BUserService.TYPE); + BUser bUser = foxSession.getUser(); + if (bUserService.canUsePasswordFeatures(bUser)) { + BObject[] bObjectArray; + Class clazz = class$com$tridium$user$BUserServicePasswordConfiguration; + if (clazz == null) { + clazz = class$com$tridium$user$BUserServicePasswordConfiguration = BFoxAuthAgent.class("[Lcom.tridium.user.BUserServicePasswordConfiguration;", false); + } + if ((bObjectArray = (BObject[])bUserService.getChildren(clazz)).length > 0 && bObjectArray[0].getType().getTypeSpec().equals((Object)BTypeSpec.make((String)"baja:UserServicePasswordConfiguration"))) { + BObject[] bObjectArray2; + foxMessage.add("userHandle", bUser.getHandle().toString()); + Class clazz2 = class$com$tridium$user$BUserPasswordConfiguration; + if (clazz2 == null) { + clazz2 = class$com$tridium$user$BUserPasswordConfiguration = BFoxAuthAgent.class("[Lcom.tridium.user.BUserPasswordConfiguration;", false); + } + if ((bObjectArray2 = (BObject[])bUser.getChildren(clazz2)).length > 0 && bObjectArray2[0].getType().getTypeSpec().equals((Object)BTypeSpec.make((String)"baja:UserPasswordConfiguration"))) { + BBoolean bBoolean; + BAbsTime bAbsTime = (BAbsTime)((BUserPasswordConfiguration)bObjectArray2[0]).get("expiration"); + BRelTime bRelTime = (BRelTime)((BUserServicePasswordConfiguration)bObjectArray[0]).get("warningPeriod"); + if (!bAbsTime.isNull() && bAbsTime.subtract(bRelTime).isBefore(BAbsTime.now())) { + foxMessage.add("passwordExpires", bAbsTime.getMillis()); + } + if ((bBoolean = (BBoolean)((BUserPasswordConfiguration)bObjectArray2[0]).get("forceResetAtNextLogin")).getBoolean()) { + if (USER_SYNC_EXT_TYPE == null) { + USER_SYNC_EXT_TYPE = BTypeSpec.make((String)"niagaraDriver", (String)"UserSyncExt").getTypeInfo(); + } + Property property = bUser.getProperty("syncExt"); + boolean bl2 = false; + if (bUser.getNetworkUser() && Flags.isReadonly((BComplex)bUser.getParent(), (Slot)bUser.getPropertyInParent()) && property != null && USER_SYNC_EXT_TYPE != null && property.getType().is(USER_SYNC_EXT_TYPE)) { + bl2 = true; + } + bl = bl2; + foxMessage.add("forceReset", true); + } + } + } + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + if (bl && (foxSession.getRemoteHello().getString("station.name", null) == null || !foxSession.getRemoteHello().getString("app.name", "").equals("Station"))) { + this.rejectAuthentication(foxSession, (Throwable)new LocalizableRuntimeException("fox", "fox.illegal.network.user.passwordReset"), null); + } else { + foxSession.setState("server.tune sendWelcome"); + foxSession.sendTuning("welcome", foxMessage); + foxSession.setState("server.tune starting"); + foxSession.start(); + } + } + + public void rejectAuthentication(FoxSession foxSession, Throwable throwable, Throwable throwable2) throws Exception { + FoxMessage foxMessage = this.generateRejectedMessage(throwable, throwable2, foxSession.getSessionContext()); + foxSession.setState("server.tune sendRejected"); + foxSession.sendTuning("rejected", foxMessage); + throw new FoxAuthenticationException("client login failed", foxSession); + } + + protected FoxMessage generateRejectedMessage(Throwable throwable, Throwable throwable2, Context context) { + FoxMessage foxMessage = new FoxMessage(); + if (throwable != null) { + foxMessage.add("fatal", this.toFatalMessage(throwable, context)); + if (throwable instanceof FoxAuthenticationException) { + foxMessage.add("data", ((FoxAuthenticationException)throwable).data); + } + } + if (throwable2 != null) { + foxMessage.add("msg", this.toFatalMessage(throwable2, context)); + if (throwable2 instanceof FoxAuthenticationException) { + foxMessage.add("data", ((FoxAuthenticationException)throwable).data); + } + } + return foxMessage; + } + + public String toFatalMessage(Throwable throwable, Context context) { + String string; + if (throwable instanceof Localizable) { + return ((Localizable)throwable).toString(context); + } + String string2 = throwable.getClass().getName(); + int n = string2.lastIndexOf(46); + if (n > 0) { + string2 = string2.substring(n + 1); + } + if ((string = throwable.getMessage()) != null && string.length() > 0) { + string2 = string2 + ": " + string; + } + return string2; + } + + protected BICredentials extractCredentials(FoxSession foxSession, FoxMessage foxMessage) throws Exception { + byte[] byArray = foxMessage.getBlob("credentials", null); + if (byArray != null) { + foxSession.setState("server.tune receivedLogin data.len=" + byArray.length); + BICredentials bICredentials = (BICredentials)ValueByteBuffer.unmarshal((byte[])byArray); + return bICredentials; + } + return null; + } + + protected BUserService authenticateAttempt(FoxSession foxSession, String string) { + BFoxServerConnection bFoxServerConnection = (BFoxServerConnection)foxSession.conn(); + bFoxServerConnection.setLastLoginTime(Clock.time()); + if (string != null) { + bFoxServerConnection.setLastLoginUsername(string); + } + bFoxServerConnection.setLastLoginAddress(foxSession.getRemoteHost() + ':' + foxSession.getRemotePort()); + bFoxServerConnection.setLastLoginApp(foxSession.getRemoteHello().getString("app.name", "") + ' ' + foxSession.getRemoteHello().getString("app.version", "")); + return (BUserService)Sys.getService((Type)BUserService.TYPE); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + protected void authenticateSuccess(FoxSession foxSession, BUser bUser) { + Object object = foxSession.getSessionStateLock(); + synchronized (object) { + FoxMessage foxMessage = foxSession.getRemoteHello(); + String string = foxMessage.getString("lang", null); + String string2 = foxMessage.getString("vmUuid", null); + HashMap hashMap = new HashMap(); + hashMap.put("foxSessionId", BInteger.make((int)foxSession.getId())); + if (string2 != null) { + hashMap.put("foxRemoteVmUuid", BString.make((String)string2)); + } + foxSession.setUser(bUser); + foxSession.setSessionContext((Context)new BasicContext((Context)new BasicContext(bUser, string), BFacets.make(hashMap))); + return; + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxAuthAgent; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxAuthAgent = BFoxAuthAgent.class("[Lcom.tridium.fox.sys.BFoxAuthAgent;", false); + } + TYPE = Sys.loadType((Class)clazz); + USER_SYNC_EXT_TYPE = null; + nonceRandom = new Random(); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxAuthenticationPolicy.java b/modules/cfr_output/com/tridium/fox/sys/BFoxAuthenticationPolicy.java new file mode 100644 index 0000000..9ff623e --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxAuthenticationPolicy.java @@ -0,0 +1,66 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BFrozenEnum + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys; + +import javax.baja.sys.BFrozenEnum; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public final class BFoxAuthenticationPolicy +extends BFrozenEnum { + public static final int BASIC = 0; + public static final int DIGEST = 1; + public static final BFoxAuthenticationPolicy basic = new BFoxAuthenticationPolicy(0); + public static final BFoxAuthenticationPolicy digest = new BFoxAuthenticationPolicy(1); + public static final Type TYPE; + public static final BFoxAuthenticationPolicy DEFAULT; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxAuthenticationPolicy; + + public final Type getType() { + return TYPE; + } + + public static final BFoxAuthenticationPolicy make(int n) { + return (BFoxAuthenticationPolicy)basic.getRange().get(n, false); + } + + public static final BFoxAuthenticationPolicy make(String string) { + return (BFoxAuthenticationPolicy)basic.getRange().get(string); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private BFoxAuthenticationPolicy(int n) { + super(n); + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxAuthenticationPolicy; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxAuthenticationPolicy = BFoxAuthenticationPolicy.class("[Lcom.tridium.fox.sys.BFoxAuthenticationPolicy;", false); + } + TYPE = Sys.loadType((Class)clazz); + DEFAULT = basic; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxChannel.java b/modules/cfr_output/com/tridium/fox/sys/BFoxChannel.java new file mode 100644 index 0000000..1733a12 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxChannel.java @@ -0,0 +1,214 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.transfer.TransferListener + * javax.baja.net.NotConnectedException + * javax.baja.security.BIProtected + * javax.baja.security.BPermissions + * javax.baja.sys.BComponent + * javax.baja.sys.BIcon + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.FoxCircuit; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.InvalidCommandException; +import com.tridium.fox.sys.BFoxClientConnection; +import com.tridium.fox.sys.BFoxConnection; +import com.tridium.fox.sys.BFoxServerConnection; +import com.tridium.fox.sys.BFoxSession; +import com.tridium.fox.sys.spy.FoxLog; +import com.tridium.sys.transfer.TransferListener; +import javax.baja.net.NotConnectedException; +import javax.baja.security.BIProtected; +import javax.baja.security.BPermissions; +import javax.baja.sys.BComponent; +import javax.baja.sys.BIcon; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BFoxChannel +extends BComponent { + public static final Type TYPE; + private static final BIcon icon; + public final FoxLog log; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxChannel; + + public Type getType() { + return TYPE; + } + + public void sessionOpened() throws Exception { + } + + public void sessionClosed(Throwable throwable) throws Exception { + } + + public abstract FoxResponse process(FoxRequest var1) throws Throwable; + + public void circuitOpened(FoxCircuit foxCircuit) throws Throwable { + throw new InvalidCommandException(foxCircuit.command); + } + + public final FoxRequest makeRequest(String string) { + return new FoxRequest(this.getName(), string); + } + + public final FoxCircuit openCircuit(String string) throws Exception { + return this.getConnection().session().openCircuit(this.getName(), string); + } + + public final FoxResponse sendSync(FoxRequest foxRequest) throws Exception { + try { + return this.getConnection().sendSync(foxRequest); + } + catch (NullPointerException nullPointerException) { + if (this.getConnection() == null) { + throw new NotConnectedException(); + } + throw nullPointerException; + } + } + + public final void sendAsync(FoxRequest foxRequest) throws Exception { + try { + this.getConnection().sendAsync(foxRequest); + } + catch (NullPointerException nullPointerException) { + if (this.getConnection() == null) { + throw new NotConnectedException(); + } + throw nullPointerException; + } + } + + public BIcon getIcon() { + return icon; + } + + public final BFoxConnection getConnection() { + try { + return (BFoxConnection)this.getParent().getParent(); + } + catch (NullPointerException nullPointerException) { + return null; + } + } + + public final BFoxClientConnection getClientConnection() { + try { + return (BFoxClientConnection)this.getParent().getParent(); + } + catch (NullPointerException nullPointerException) { + return null; + } + } + + public final BFoxServerConnection getServerConnection() { + try { + return (BFoxServerConnection)this.getParent().getParent(); + } + catch (NullPointerException nullPointerException) { + return null; + } + } + + public final Context getSessionContext() { + return this.getServerConnection().getSessionContext(); + } + + public final BPermissions getPermissionsFor(Object object) { + return this.getPermissionsFor(object, true); + } + + public final BPermissions getPermissionsFor(Object object, boolean bl) { + block3: { + try { + if (object instanceof BIProtected) { + return ((BIProtected)object).getPermissions(this.getSessionContext()); + } + } + catch (Exception exception) { + if (!bl) break block3; + exception.printStackTrace(); + } + } + return BPermissions.all; + } + + public final BFoxSession getFoxSession() { + return this.getClientConnection().getFoxSession(); + } + + public boolean isTraceOn() { + return this.log.isTraceOn(); + } + + public void trace(String string) { + System.out.print("-- "); + System.out.print(this.log.getLogName()); + System.out.print(" "); + System.out.println(string); + this.log.logRecOnly(0, string); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + protected BFoxChannel(String string) { + this.log = FoxLog.make("fox." + string); + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxChannel; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxChannel = BFoxChannel.class("[Lcom.tridium.fox.sys.BFoxChannel;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BIcon.std((String)"bookmark.png"); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class TransferStatusPipe + implements TransferListener { + FoxCircuit circuit; + + public void updateStatus(String string) { + try { + FoxMessage foxMessage = new FoxMessage(); + foxMessage.add("s", string); + this.circuit.writeMessage(foxMessage); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + public TransferStatusPipe(FoxCircuit foxCircuit) { + this.circuit = foxCircuit; + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxChannelRegistry.java b/modules/cfr_output/com/tridium/fox/sys/BFoxChannelRegistry.java new file mode 100644 index 0000000..e5e53da --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxChannelRegistry.java @@ -0,0 +1,146 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BComponent + * javax.baja.sys.BIcon + * javax.baja.sys.BValue + * javax.baja.sys.SlotCursor + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys; + +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.sys.BFoxChannel; +import com.tridium.fox.sys.BFoxConnection; +import com.tridium.fox.sys.BSysChannel; +import com.tridium.fox.sys.data.BDataChannel; +import com.tridium.fox.sys.file.BFileChannel; +import com.tridium.fox.sys.spy.BSpyChannel; +import com.tridium.fox.sys.user.BUserChannel; +import javax.baja.sys.BComponent; +import javax.baja.sys.BIcon; +import javax.baja.sys.BValue; +import javax.baja.sys.SlotCursor; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxChannelRegistry +extends BComponent { + public static final Type TYPE; + private static BFoxChannelRegistry prototype; + private static final BIcon icon; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxChannelRegistry; + + public Type getType() { + return TYPE; + } + + public final BSysChannel getSysChannel() { + return (BSysChannel)this.get("sys"); + } + + public final BFileChannel getFileChannel() { + return (BFileChannel)this.get("file"); + } + + public final BUserChannel getUserChannel() { + return (BUserChannel)this.get("user"); + } + + public final BFoxChannel get(String string, Type type) { + BFoxChannel bFoxChannel = (BFoxChannel)this.get(string); + if (bFoxChannel != null) { + if (bFoxChannel.getType() != type) { + throw new ClassCastException("Type mismatch: " + bFoxChannel.getType() + " != " + type); + } + } else { + bFoxChannel = (BFoxChannel)type.getInstance(); + this.add(string, (BValue)bFoxChannel, 2); + if (((BFoxConnection)this.getParent()).isConnected()) { + this.sessionOpened(bFoxChannel); + } + } + return bFoxChannel; + } + + public static BFoxChannelRegistry getPrototype() { + return prototype; + } + + public void sessionOpened() { + SlotCursor slotCursor = this.getProperties(); + while (slotCursor.nextComponent()) { + this.sessionOpened((BFoxChannel)slotCursor.get()); + } + } + + public void sessionClosed(Throwable throwable) { + SlotCursor slotCursor = this.getProperties(); + while (slotCursor.nextComponent()) { + this.sessionClosed((BFoxChannel)slotCursor.get(), throwable); + } + } + + private final void sessionOpened(BFoxChannel bFoxChannel) { + try { + FoxSession foxSession = ((BFoxConnection)this.getParent()).session(); + bFoxChannel.log.setSession(foxSession); + bFoxChannel.sessionOpened(); + } + catch (Throwable throwable) { + throwable.printStackTrace(); + } + } + + private final void sessionClosed(BFoxChannel bFoxChannel, Throwable throwable) { + try { + bFoxChannel.sessionClosed(throwable); + } + catch (Throwable throwable2) { + throwable2.printStackTrace(); + } + bFoxChannel.log.setSession(null); + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxChannelRegistry; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxChannelRegistry = BFoxChannelRegistry.class("[Lcom.tridium.fox.sys.BFoxChannelRegistry;", false); + } + TYPE = Sys.loadType((Class)clazz); + prototype = new BFoxChannelRegistry(); + prototype.add("data", (BValue)new BDataChannel()); + prototype.add("file", (BValue)new BFileChannel()); + prototype.add("spy", (BValue)new BSpyChannel()); + prototype.add("sys", (BValue)new BSysChannel()); + prototype.add("user", (BValue)new BUserChannel()); + try { + prototype.add("alarmui", (BValue)((BFoxChannel)((Object)Sys.newInstance((String)"alarm", (String)"com.tridium.alarm.BAlarmConsoleChannel")))); + } + catch (Throwable throwable) {} + icon = BIcon.std((String)"book.png"); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxClientConnection.java b/modules/cfr_output/com/tridium/fox/sys/BFoxClientConnection.java new file mode 100644 index 0000000..040b509 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxClientConnection.java @@ -0,0 +1,761 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.Nre + * javax.baja.naming.BHost + * javax.baja.security.BICredentials + * javax.baja.security.BPassword + * javax.baja.security.BUsernameAndPassword + * javax.baja.security.crypto.BTlsEnum + * javax.baja.security.crypto.CertManagerFactory + * javax.baja.spy.SpyWriter + * javax.baja.sys.Action + * javax.baja.sys.BAbsTime + * javax.baja.sys.BComplex + * javax.baja.sys.BComponent + * javax.baja.sys.BRelTime + * javax.baja.sys.BValue + * javax.baja.sys.Clock + * javax.baja.sys.Clock$Ticket + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.ServiceNotFoundException + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.CoalesceQueue + * javax.baja.util.IFuture + * javax.baja.util.Invocation + * javax.baja.util.ThreadPoolWorker + * javax.baja.util.Worker$ITodo + */ +package com.tridium.fox.sys; + +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxAuthenticationException; +import com.tridium.fox.session.FoxConnection; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.session.FoxsRedirectException; +import com.tridium.fox.sys.Acceptor; +import com.tridium.fox.sys.BFoxChannelRegistry; +import com.tridium.fox.sys.BFoxConnection; +import com.tridium.fox.sys.BFoxSession; +import com.tridium.fox.sys.NiagaraStation; +import com.tridium.sys.Nre; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import javax.baja.naming.BHost; +import javax.baja.security.BICredentials; +import javax.baja.security.BPassword; +import javax.baja.security.BUsernameAndPassword; +import javax.baja.security.crypto.BTlsEnum; +import javax.baja.security.crypto.CertManagerFactory; +import javax.baja.spy.SpyWriter; +import javax.baja.sys.Action; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BRelTime; +import javax.baja.sys.BValue; +import javax.baja.sys.Clock; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.ServiceNotFoundException; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.CoalesceQueue; +import javax.baja.util.IFuture; +import javax.baja.util.Invocation; +import javax.baja.util.ThreadPoolWorker; +import javax.baja.util.Worker; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxClientConnection +extends BFoxConnection { + public static final Property port = BFoxClientConnection.newProperty((int)0, (int)1911, null); + public static final Property useFoxs = BFoxClientConnection.newProperty((int)5, (boolean)false, null); + public static final Property username = BFoxClientConnection.newProperty((int)0, (String)"", null); + public static final Property password = BFoxClientConnection.newProperty((int)0, (BValue)BPassword.DEFAULT, null); + public static final Property lastFailureTime = BFoxClientConnection.newProperty((int)1, (BValue)BAbsTime.DEFAULT, null); + public static final Property lastFailureCause = BFoxClientConnection.newProperty((int)1, (String)"", null); + public static final Property retryPeriod = BFoxClientConnection.newProperty((int)0, (BValue)BRelTime.make((long)300000L), null); + public static final Property nextAttemptTime = BFoxClientConnection.newProperty((int)1, (BValue)BAbsTime.DEFAULT, null); + public static final Action manualConnect = BFoxClientConnection.newAction((int)0, null); + public static final Action manualDisconnect = BFoxClientConnection.newAction((int)0, null); + public static final Action lingerTimeout = BFoxClientConnection.newAction((int)20, null); + public static final Type TYPE; + public static long engageLinger; + private static CoalesceQueue queue; + private static ThreadPoolWorker threadPool; + private BFoxSession foxSession; + private BICredentials credentials; + private BHost remoteHost; + private Object connectLock; + private long lastFailureTicks; + private Exception lastFailureException; + private Object retryLock; + private HashMap interests; + private ArrayList interestLog; + private Clock.Ticket lingerTicket; + private boolean checkBrandCompatibility; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxClientConnection; + + public int getPort() { + return this.getInt(port); + } + + public void setPort(int n) { + this.setInt(port, n, null); + } + + public boolean getUseFoxs() { + return this.getBoolean(useFoxs); + } + + public void setUseFoxs(boolean bl) { + this.setBoolean(useFoxs, bl, null); + } + + public String getUsername() { + return this.getString(username); + } + + public void setUsername(String string) { + this.setString(username, string, null); + } + + public BPassword getPassword() { + return (BPassword)this.get(password); + } + + public void setPassword(BPassword bPassword) { + this.set(password, (BValue)bPassword, null); + } + + public BAbsTime getLastFailureTime() { + return (BAbsTime)this.get(lastFailureTime); + } + + public void setLastFailureTime(BAbsTime bAbsTime) { + this.set(lastFailureTime, (BValue)bAbsTime, null); + } + + public String getLastFailureCause() { + return this.getString(lastFailureCause); + } + + public void setLastFailureCause(String string) { + this.setString(lastFailureCause, string, null); + } + + public BRelTime getRetryPeriod() { + return (BRelTime)this.get(retryPeriod); + } + + public void setRetryPeriod(BRelTime bRelTime) { + this.set(retryPeriod, (BValue)bRelTime, null); + } + + public BAbsTime getNextAttemptTime() { + return (BAbsTime)this.get(nextAttemptTime); + } + + public void setNextAttemptTime(BAbsTime bAbsTime) { + this.set(nextAttemptTime, (BValue)bAbsTime, null); + } + + public void manualConnect() { + this.invoke(manualConnect, null, null); + } + + public void manualDisconnect() { + this.invoke(manualDisconnect, null, null); + } + + public void lingerTimeout() { + this.invoke(lingerTimeout, null, null); + } + + public Type getType() { + return TYPE; + } + + private final void init() { + if (System.getProperty("java.vm.name").equalsIgnoreCase("J9")) { + this.setUseFoxs(false); + this.setFlags((Slot)useFoxs, this.getFlags((Slot)useFoxs) | 1 | 4); + } else if (Sys.getStation() != null) { + try { + Nre.serviceManager.getService("platCrypto:CertManagerService"); + this.setFlags((Slot)useFoxs, this.getFlags((Slot)useFoxs) & 0xFFFFFFFA); + } + catch (Exception exception) { + this.setUseFoxs(false); + this.setFlags((Slot)useFoxs, this.getFlags((Slot)useFoxs) | 1 | 4); + } + } else { + this.setFlags((Slot)useFoxs, this.getFlags((Slot)useFoxs) & 0xFFFFFFFA); + } + this.set(channels, BFoxChannelRegistry.getPrototype().newCopy()); + } + + public final BFoxSession getFoxSession() { + return this.foxSession; + } + + public final NiagaraStation getParentStation() { + BComplex bComplex = this.getParent(); + if (bComplex instanceof NiagaraStation) { + return (NiagaraStation)bComplex; + } + return null; + } + + public final BHost getRemoteHost() { + if (this.getParent() instanceof NiagaraStation) { + return ((NiagaraStation)this.getParent()).getRemoteHost(); + } + return this.remoteHost; + } + + public void setRemoteHost(BHost bHost) { + this.remoteHost = bHost; + } + + public void setRemoteHost(BHost bHost, int n) { + this.setRemoteHost(bHost); + this.setPort(n); + } + + public void setCredentials(BICredentials bICredentials) { + this.credentials = bICredentials; + } + + public BICredentials getCredentials() { + if (this.credentials != null) { + return this.credentials; + } + return new BUsernameAndPassword(this.getUsername(), this.getPassword()); + } + + public void sessionOpened(FoxSession foxSession) { + NiagaraStation niagaraStation; + if (this.checkBrandCompatibility) { + Acceptor.accept(foxSession); + } + super.sessionOpened(foxSession); + if (this.foxSession != null) { + this.foxSession.sessionOpened(); + } + if ((niagaraStation = this.getParentStation()) != null) { + niagaraStation.clientOpened(); + } + } + + public void sessionClosed(FoxSession foxSession, Throwable throwable) { + NiagaraStation niagaraStation; + super.sessionClosed(foxSession, throwable); + if (this.foxSession != null) { + this.foxSession.sessionClosed(); + } + if ((niagaraStation = this.getParentStation()) != null) { + niagaraStation.clientClosed(); + } + } + + public boolean isTunnelClientConnection() { + boolean bl = false; + if (this.foxSession != null && this.foxSession.tunnelAuthorities != null) { + bl = true; + } + return bl; + } + + public String[] getTunnelAuthorities() { + return this.foxSession.tunnelAuthorities; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Unable to fully structure code + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void connect() throws Exception { + var1_1 = this.getParentStation(); + var2_2 = Clock.ticks(); + var4_3 = this.connectLock; + synchronized (var4_3) { + block22: { + if (this.isConnected()) { + return; + } + if (this.lastFailureTicks > var2_2) { + throw this.lastFailureException; + } + var6_4 = this.getState(); + var7_5 = FoxSession.createListeners(this); + try { + if (var1_1 != null && var1_1.isFatalFault()) { + throw new Exception(var1_1.getFaultCause()); + } + this.transition("Connecting..."); + this.setNextAttemptTime(BAbsTime.NULL); + var8_6 = this.getRemoteHost(); + if (var8_6 == null) { + throw new IllegalStateException("Remote host not set"); + } + var9_8 = this.getCredentials(); + var10_10 = null; + var11_14 = false; + var12_15 = 4911; + if (!this.getUseFoxs()) { + try { + var10_10 = var8_6.openSocket(this.getPort()); + Fox.open((FoxConnection)this, var10_10, var9_8, var7_5); + } + catch (FoxsRedirectException var13_16) { + var10_10.close(); + var11_14 = true; + var12_15 = var13_16.getPort(); + this.setPort(var13_16.getPort()); + this.setUseFoxs(true); + this.log.message("received foxs redirect to port " + var12_15); + } + } + if (this.getUseFoxs() || var11_14) { + try { + var13_17 = CertManagerFactory.getInstanceEx(); + var14_19 = var13_17.getClientSocketFactory(BTlsEnum.DEFAULT.getTag()); + var10_10 = var8_6.openSocket(this.getPort(), var14_19); + if (this.foxSession != null) { + this.foxSession.setUseFoxs(true); + this.foxSession.setPort(this.getPort()); + } + Fox.open((FoxConnection)this, var10_10, var9_8, var7_5); + } + catch (ServiceNotFoundException var13_18) { + throw new IOException("CertManagerService not found."); + } + } + this.lastFailureTicks = 0L; + this.lastFailureException = null; + this.setLastFailureTime(BAbsTime.NULL); + this.setLastFailureCause(""); + this.pingOk(); + if (this.foxSession != null) { + this.foxSession.postConnect(); + } + } + catch (Exception var8_7) { + var9_9 = var8_7.toString(); + if (var8_7 instanceof FoxAuthenticationException) { + var10_11 = (FoxAuthenticationException)var8_7; + var9_9 = "Authentication Failed"; + if (var10_11.fatal != null) { + var9_9 = var9_9 + ": " + var10_11.fatal; + } + } + this.transition(var6_4); + this.lastFailureTicks = Clock.ticks(); + this.lastFailureException = var8_7; + this.setLastFailureTime(Clock.time()); + this.setLastFailureCause(var9_9); + this.pingFail(var9_9); + if (var7_5 == FoxSession.nullListeners) break block22; + var10_12 = 0; + if (true) ** GOTO lbl81 + } + return; + do { + var7_5[var10_12].connectionAborted(var9_9, var8_7); + ++var10_12; +lbl81: + // 2 sources + + } while (var10_12 < var7_5.length); + } + if (var7_5 != FoxSession.nullListeners) { + var10_13 = 0; + while (var10_13 < var7_5.length) { + var7_5[var10_13].connectionAborted(var9_9, var8_7); + ++var10_13; + } + } + throw var8_7; + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public Interest[] getInterests() { + HashMap hashMap = this.interests; + synchronized (hashMap) { + return this.interests.keySet().toArray(new Interest[this.interests.size()]); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + boolean hasInterests() { + HashMap hashMap = this.interests; + synchronized (hashMap) { + return this.interests.isEmpty() ^ true; + } + } + + public InterestLogItem[] getInterestLog() { + InterestLogItem[] interestLogItemArray = this.interests.values().toArray(new InterestLogItem[this.interests.size()]); + InterestLogItem[] interestLogItemArray2 = this.interestLog.toArray(new InterestLogItem[this.interestLog.size()]); + InterestLogItem[] interestLogItemArray3 = new InterestLogItem[interestLogItemArray.length + interestLogItemArray2.length]; + System.arraycopy(interestLogItemArray, 0, interestLogItemArray3, 0, interestLogItemArray.length); + System.arraycopy(interestLogItemArray2, 0, interestLogItemArray3, interestLogItemArray.length, interestLogItemArray2.length); + return interestLogItemArray3; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public boolean isEngaged(Interest interest) { + Interest interest2 = interest; + synchronized (interest2) { + boolean bl = false; + if (this.interests.get(interest) == null) return bl; + return true; + } + } + + public void engageNoRetry(Interest interest) throws Exception { + this.engageNoRetry(interest, 5000L); + } + + public void engageNoRetry(Interest interest, long l) throws Exception { + this.engageNoRetry(interest, l, false); + } + + public void engageNoRetry(Interest interest, long l, boolean bl) throws Exception { + Exception exception = this.lastFailureException; + if (exception != null && Clock.ticks() - this.lastFailureTicks < l) { + throw exception; + } + try { + this.engage(interest, false); + } + catch (Exception exception2) { + if (bl) { + this.transition("Waiting for retry..."); + long l2 = this.getRetryPeriod().getMillis(); + this.setNextAttemptTime(BAbsTime.make((long)(Clock.millis() + l2))); + } + throw exception2; + } + } + + public void engageRetry(Interest interest) throws Exception { + this.engage(interest, true); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + private final void engage(Interest interest, boolean bl) throws Exception { + HashMap hashMap = this.interests; + synchronized (hashMap) { + if (this.interests.get(interest) == null) { + InterestLogItem interestLogItem = this.logEngaged(interest); + this.interests.put(interest, interestLogItem); + } + if (this.lingerTicket != null) { + this.lingerTicket.cancel(); + } + } + while (true) { + try { + this.connect(); + this.interruptRetries(); + return; + } + catch (Exception exception) { + if (!bl) { + throw exception; + } + this.transition("Waiting for retry..."); + long l = this.getRetryPeriod().getMillis(); + this.setNextAttemptTime(BAbsTime.make((long)(Clock.millis() + l))); + Object object = this.retryLock; + synchronized (object) { + this.retryLock.wait(l); + } + } + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void disengage(Interest interest) { + HashMap hashMap = this.interests; + synchronized (hashMap) { + block5: { + block6: { + int n = this.interests.size(); + if (interest != null) { + InterestLogItem interestLogItem = (InterestLogItem)this.interests.get(interest); + if (interestLogItem != null) { + this.logDisengaged(interestLogItem); + } + this.interests.remove(interest); + } + if (n <= 0 || this.interests.size() != 0) break block5; + if (!this.isRunning()) break block6; + this.lingerTicket = Clock.schedule((BComponent)this, (BRelTime)BRelTime.make((long)engageLinger), (Action)lingerTimeout, null); + break block5; + } + this.close(); + } + return; + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void interruptRetries() { + if (this.retryLock == null) { + return; + } + Object object = this.retryLock; + synchronized (object) { + this.retryLock.notifyAll(); + return; + } + } + + private final void transition(String string) { + if (this.log.isTraceOn()) { + this.log.trace(this.getState() + " -> " + string); + } + this.setState(string); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void doLingerTimeout() { + HashMap hashMap = this.interests; + synchronized (hashMap) { + this.lingerTicket = null; + if (this.interests.size() == 0) { + this.close(); + } + return; + } + } + + public boolean getCheckBrandCompatibility() { + return this.checkBrandCompatibility; + } + + public void setCheckBrandCompatibility(boolean bl) { + this.checkBrandCompatibility = bl; + } + + public void pingOk() { + if (this.getParent() instanceof NiagaraStation) { + ((NiagaraStation)this.getParent()).pingOk(); + } + } + + public void pingFail(String string) { + if (this.getParent() instanceof NiagaraStation) { + ((NiagaraStation)this.getParent()).pingFail(string); + } + } + + public void doManualConnect() throws Exception { + this.connect(); + } + + public void doManualDisconnect() throws Exception { + this.close(); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public IFuture post(Action action, BValue bValue, Context context) { + if (!action.equals((Object)lingerTimeout)) return super.post(action, bValue, context); + try { + if (!threadPool.isRunning()) { + ThreadPoolWorker threadPoolWorker = threadPool; + synchronized (threadPoolWorker) { + if (!threadPool.isRunning()) { + threadPool.start("foxLingerTimeout"); + } + } + } + queue.enqueue((Object)new Invocation((BComponent)this, action, bValue, context)); + return null; + } + catch (Exception exception) { + this.log.error("Could not invoke lingerTimeout action on fox client connection " + this.toDebugString(), exception); + } + return null; + } + + public void changed(Property property, Context context) { + super.changed(property, context); + if (property.isFrozen() && (property.getDefaultFlags() & 1) == 0) { + this.interruptRetries(); + } + } + + private final InterestLogItem logEngaged(Interest interest) { + InterestLogItem interestLogItem = new InterestLogItem(); + interestLogItem.interest = interest.toString(); + interestLogItem.startTicks = Clock.ticks(); + return interestLogItem; + } + + private final void logDisengaged(InterestLogItem interestLogItem) { + interestLogItem.endTicks = Clock.ticks(); + while (this.interestLog.size() >= 20) { + this.interestLog.remove(0); + } + this.interestLog.add(interestLogItem); + } + + public static void spyThreadPoolWorker(SpyWriter spyWriter) { + try { + threadPool.spy(spyWriter); + } + catch (Exception exception) {} + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.connectLock = new Object(); + this.retryLock = new Object(); + this.interests = new HashMap(5); + this.interestLog = new ArrayList(20); + this.checkBrandCompatibility = true; + } + + public BFoxClientConnection(BFoxSession bFoxSession) { + this.this(); + this.foxSession = bFoxSession; + this.setRemoteHost(bFoxSession.getHost()); + this.setPort(bFoxSession.getPort()); + this.setUseFoxs(bFoxSession.getUseFoxs()); + this.init(); + } + + public BFoxClientConnection() { + this.this(); + this.init(); + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxClientConnection; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxClientConnection = BFoxClientConnection.class("[Lcom.tridium.fox.sys.BFoxClientConnection;", false); + } + TYPE = Sys.loadType((Class)clazz); + engageLinger = 5000L; + try { + engageLinger = Long.parseLong(System.getProperty("niagara.fox.engageLinger", "" + engageLinger).trim()); + } + catch (Exception exception) { + exception.printStackTrace(); + } + queue = new CoalesceQueue(1000); + threadPool = new ThreadPoolWorker((Worker.ITodo)queue); + threadPool.setMaxThreads(1000); + } + + public static interface Interest { + public int hashCode(); + + public boolean equals(Object var1); + + public String toString(); + } + + public static class InterestLogItem { + public String interest; + public long startTicks; + public long endTicks; + } + + public static class StringInterest + implements Interest { + private String string; + + public int hashCode() { + return this.string.hashCode(); + } + + public boolean equals(Object object) { + if (object instanceof StringInterest) { + return ((StringInterest)object).string.equals(this.string); + } + return false; + } + + public String toString() { + return this.string; + } + + public StringInterest(String string) { + if (string == null) { + throw new IllegalArgumentException("interest string is null"); + } + this.string = string; + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxConnection.java b/modules/cfr_output/com/tridium/fox/sys/BFoxConnection.java new file mode 100644 index 0000000..ab6e461 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxConnection.java @@ -0,0 +1,338 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.Nre + * com.tridium.sys.license.Brand + * javax.baja.net.NotConnectedException + * javax.baja.spy.Spy + * javax.baja.sys.BAbsTime + * javax.baja.sys.BComponent + * javax.baja.sys.BFacets + * javax.baja.sys.BIcon + * javax.baja.sys.BStation + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.Clock + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.timezone.BTimeZone + * javax.baja.user.BUserService + * javax.baja.util.Version + */ +package com.tridium.fox.sys; + +import com.tridium.fox.encoding.BogCodec; +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.FoxAsyncCallbacks; +import com.tridium.fox.session.FoxCircuit; +import com.tridium.fox.session.FoxConnection; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.session.InvalidChannelException; +import com.tridium.fox.sys.BFoxAuthAgent; +import com.tridium.fox.sys.BFoxChannel; +import com.tridium.fox.sys.BFoxChannelRegistry; +import com.tridium.fox.sys.BFoxClientConnection; +import com.tridium.fox.sys.BFoxSession; +import com.tridium.fox.sys.NiagaraStation; +import com.tridium.fox.sys.spy.FoxIndexSpy; +import com.tridium.fox.sys.spy.FoxLog; +import com.tridium.sys.Nre; +import com.tridium.sys.license.Brand; +import java.net.Socket; +import javax.baja.net.NotConnectedException; +import javax.baja.spy.Spy; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BIcon; +import javax.baja.sys.BStation; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.Clock; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.timezone.BTimeZone; +import javax.baja.user.BUserService; +import javax.baja.util.Version; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BFoxConnection +extends BComponent +implements FoxConnection { + public static final Property state = BFoxConnection.newProperty((int)3, (String)"Not connected", null); + public static final Property lastConnectTime = BFoxConnection.newProperty((int)65537, (BValue)BAbsTime.DEFAULT, null); + public static final Property lastDisconnectTime = BFoxConnection.newProperty((int)65537, (BValue)BAbsTime.DEFAULT, null); + public static final Property lastDisconnectCause = BFoxConnection.newProperty((int)1, (String)"", null); + public static final Property channels = BFoxConnection.newProperty((int)7, (BValue)new BFoxChannelRegistry(), null); + public static final Type TYPE; + private static final BIcon icon; + protected final FoxLog log; + private FoxSession session; + private Version remoteVersion; + Integer fwConnectionType; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxConnection; + + public String getState() { + return this.getString(state); + } + + public void setState(String string) { + this.setString(state, string, null); + } + + public BAbsTime getLastConnectTime() { + return (BAbsTime)this.get(lastConnectTime); + } + + public void setLastConnectTime(BAbsTime bAbsTime) { + this.set(lastConnectTime, (BValue)bAbsTime, null); + } + + public BAbsTime getLastDisconnectTime() { + return (BAbsTime)this.get(lastDisconnectTime); + } + + public void setLastDisconnectTime(BAbsTime bAbsTime) { + this.set(lastDisconnectTime, (BValue)bAbsTime, null); + } + + public String getLastDisconnectCause() { + return this.getString(lastDisconnectCause); + } + + public void setLastDisconnectCause(String string) { + this.setString(lastDisconnectCause, string, null); + } + + public BFoxChannelRegistry getChannels() { + return (BFoxChannelRegistry)this.get(channels); + } + + public void setChannels(BFoxChannelRegistry bFoxChannelRegistry) { + this.set(channels, (BValue)bFoxChannelRegistry, null); + } + + public Type getType() { + return TYPE; + } + + public final boolean isConnected() { + boolean bl = false; + if (this.session != null && !this.session.isClosed()) { + bl = true; + } + return bl; + } + + public void assertConnected() throws NotConnectedException { + if (this.session == null || this.session.isClosed()) { + throw new NotConnectedException(); + } + } + + public FoxSession session() { + return this.session; + } + + public Version getRemoteVersion() { + return this.remoteVersion; + } + + public void close() { + this.setState("Not connected"); + if (this.session != null) { + this.session.close(null); + } + } + + public NiagaraStation getParentStation() { + if (this.getParent() instanceof NiagaraStation) { + return (NiagaraStation)this.getParent(); + } + return null; + } + + public void initHello(FoxMessage foxMessage) throws Exception { + NiagaraStation niagaraStation; + BStation bStation; + BFoxSession bFoxSession = null; + if (this instanceof BFoxClientConnection) { + bFoxSession = ((BFoxClientConnection)this).getFoxSession(); + bStation = this.get("httpSession"); + if (bStation instanceof BString) { + foxMessage.add("httpSession", ((BString)bStation).getString()); + } + } + if ((bStation = Sys.getStation()) != null && bFoxSession == null) { + foxMessage.add("station.name", bStation.getStationName()); + } + if ((niagaraStation = this.getParentStation()) != null) { + niagaraStation.initHello(foxMessage); + } + foxMessage.add("lang", Sys.getLanguage()); + foxMessage.add("timeZone", BTimeZone.getLocal().encodeToString()); + foxMessage.add("hostId", Nre.getHostId()); + foxMessage.add("vmUuid", Nre.vmUuid); + try { + foxMessage.add("brandId", Brand.getBrandId()); + } + catch (Exception exception) {} + if (bStation != null) { + BFoxAuthAgent bFoxAuthAgent; + BUserService bUserService; + BFacets bFacets = bStation.getSysInfo(); + BogCodec.add(foxMessage, "sysInfo", (BValue)bFacets, null); + String string = bFacets.gets("realms", null); + if (string != null) { + foxMessage.add("realms", string); + } + if ((bUserService = BUserService.getService()) != null && (bFoxAuthAgent = (BFoxAuthAgent)bUserService.getAuthAgent(BFoxAuthAgent.TYPE)) != null) { + foxMessage.add("authAgentTypeSpecs", bFoxAuthAgent.getType().getTypeSpec().encodeToString()); + } + } + } + + public void sessionOpened(FoxSession foxSession) { + this.session = foxSession; + this.log.opened(foxSession); + this.setState("Connected [" + foxSession.getId() + ']'); + this.setLastConnectTime(Clock.time()); + this.getChannels().sessionOpened(); + try { + this.remoteVersion = new Version(foxSession.getRemoteHello().getString("app.version")); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + public void sessionClosed(FoxSession foxSession, Throwable throwable) { + this.log.closed(foxSession, throwable); + this.session = null; + this.setState("Not connected"); + this.setLastDisconnectTime(Clock.time()); + this.setLastDisconnectCause(throwable == null ? "" : throwable.toString()); + this.getChannels().sessionClosed(throwable); + } + + public FoxResponse process(FoxRequest foxRequest) throws Throwable { + return this.getChannel(foxRequest.channel).process(foxRequest); + } + + public void circuitOpened(FoxCircuit foxCircuit) throws Throwable { + this.getChannel(foxCircuit.channel).circuitOpened(foxCircuit); + } + + private final BFoxChannel getChannel(String string) { + BFoxChannel bFoxChannel = (BFoxChannel)this.getChannels().get(string); + if (bFoxChannel != null) { + return bFoxChannel; + } + BFoxChannel bFoxChannel2 = (BFoxChannel)BFoxChannelRegistry.getPrototype().get(string); + if (bFoxChannel2 != null) { + bFoxChannel = (BFoxChannel)bFoxChannel2.newCopy(); + this.getChannels().add(string, (BValue)bFoxChannel); + return bFoxChannel; + } + throw new InvalidChannelException(string); + } + + public Thread makeThread(ThreadGroup threadGroup, Runnable runnable, String string) { + return new Thread(threadGroup, runnable, string); + } + + public void error(String string, Throwable throwable) { + this.log.error(string, throwable); + } + + public boolean isTunnelClientConnection() { + return false; + } + + public boolean isTunnelServerConnection() { + return false; + } + + public String[] getTunnelAuthorities() { + return null; + } + + public Socket createTunnelSocket(String string, boolean bl) throws Exception { + return null; + } + + public FoxResponse sendSync(FoxRequest foxRequest) throws Exception { + FoxSession foxSession = this.session; + if (foxSession == null) { + throw new NotConnectedException(); + } + return foxSession.sendSync(foxRequest); + } + + public void sendAsync(FoxRequest foxRequest) throws Exception { + this.sendAsync(foxRequest, null); + } + + public void sendAsync(FoxRequest foxRequest, FoxAsyncCallbacks foxAsyncCallbacks) throws Exception { + FoxSession foxSession = this.session; + if (foxSession == null) { + throw new NotConnectedException(); + } + foxSession.sendAsync(foxRequest, foxAsyncCallbacks); + } + + public BIcon getIcon() { + return icon; + } + + public final Object fw(int n, Object object, Object object2, Object object3, Object object4) { + if (n == 803) { + if (object instanceof Integer) { + this.fwConnectionType = (Integer)object; + } + return this.fwConnectionType; + } + return super.fw(n, object, object2, object3, object4); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.log = FoxLog.make("fox"); + this.fwConnectionType = FoxSession.NON_FW_FOX_SESSION; + } + + public BFoxConnection() { + this.this(); + this.set(channels, BFoxChannelRegistry.getPrototype().newCopy()); + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxConnection; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxConnection = BFoxConnection.class("[Lcom.tridium.fox.sys.BFoxConnection;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BIcon.std((String)"connection.png"); + Spy.ROOT.add("fox", (Spy)new FoxIndexSpy()); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxDefaultAuthAgent.java b/modules/cfr_output/com/tridium/fox/sys/BFoxDefaultAuthAgent.java new file mode 100644 index 0000000..dbd8760 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxDefaultAuthAgent.java @@ -0,0 +1,274 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.nre.auth.ScramSha256Server + * com.tridium.nre.auth.ScramSha256Server$IUserKeyFactory + * com.tridium.util.ValueByteBuffer + * javax.baja.data.BIDataValue + * javax.baja.log.Log + * javax.baja.security.AuthenticationException + * javax.baja.security.BHttpFoxCredentials + * javax.baja.security.BICredentials + * javax.baja.security.BPassword + * javax.baja.security.BPbkdf2HmacSha256PasswordEncoder + * javax.baja.security.BUsernameAndPassword + * javax.baja.sys.BAbsTime + * javax.baja.sys.BFacets + * javax.baja.sys.BString + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.user.AuthenticateUtil + * javax.baja.user.BUser + * javax.baja.user.BUserService + * javax.baja.util.Lexicon + */ +package com.tridium.fox.sys; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.FoxAuthenticationException; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.sys.Acceptor; +import com.tridium.fox.sys.BFoxAuthAgent; +import com.tridium.fox.sys.BFoxServerConnection; +import com.tridium.fox.sys.BFoxService; +import com.tridium.fox.sys.FatalAuthenticationException; +import com.tridium.nre.auth.ScramSha256Server; +import com.tridium.util.ValueByteBuffer; +import javax.baja.data.BIDataValue; +import javax.baja.log.Log; +import javax.baja.security.AuthenticationException; +import javax.baja.security.BHttpFoxCredentials; +import javax.baja.security.BICredentials; +import javax.baja.security.BPassword; +import javax.baja.security.BPbkdf2HmacSha256PasswordEncoder; +import javax.baja.security.BUsernameAndPassword; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BFacets; +import javax.baja.sys.BString; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.user.AuthenticateUtil; +import javax.baja.user.BUser; +import javax.baja.user.BUserService; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxDefaultAuthAgent +extends BFoxAuthAgent { + public static final BFoxDefaultAuthAgent INSTANCE = new BFoxDefaultAuthAgent(); + public static final Type TYPE; + Lexicon lex; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxDefaultAuthAgent; + + public Type getType() { + return TYPE; + } + + protected boolean authenticateBasic(FoxSession foxSession) throws Exception { + BUsernameAndPassword bUsernameAndPassword; + FoxMessage foxMessage = new FoxMessage(); + foxMessage.add("method", "basic"); + foxSession.setState("server.tune sendChallenge basic"); + foxSession.sendTuning("challenge", foxMessage); + foxSession.setState("server.tune receiveLogin"); + FoxMessage foxMessage2 = foxSession.receiveTuning("login"); + String string = foxMessage2.getString("username"); + String string2 = foxMessage2.getString("password", null); + BICredentials bICredentials = this.extractCredentials(foxSession, foxMessage2); + if (bICredentials != null) { + if (bICredentials instanceof BUsernameAndPassword) { + bUsernameAndPassword = (BUsernameAndPassword)bICredentials; + string = bUsernameAndPassword.getUsername(); + string2 = bUsernameAndPassword.getPassword().encodeToString(); + } else if (bICredentials instanceof BHttpFoxCredentials) { + bUsernameAndPassword = (BHttpFoxCredentials)bICredentials; + string = bUsernameAndPassword.getUsername(); + string2 = ""; + } else { + throw new FoxAuthenticationException("Unsupported credential type: " + bICredentials.getType().getTypeName(), foxSession); + } + } + foxSession.setState("server.tune receivedLogin user=" + string + " pass.len=" + string2.length()); + Acceptor.accept(foxSession); + bUsernameAndPassword = this.authenticateAttempt(foxSession, string); + Context context = this.getAuditContext(foxSession); + BUser bUser = null; + if (bICredentials instanceof BHttpFoxCredentials) { + try { + bUser = BUserService.httpHandler.processCredentials((BHttpFoxCredentials)bICredentials, foxSession.getRemoteHost()); + bUser.authenticateOk((BUserService)bUsernameAndPassword); + bUsernameAndPassword.auditLoginAttempt(true, bUser, context); + } + catch (AuthenticationException authenticationException) { + if (bUser != null) { + bUser.authenticateFailed((BUserService)bUsernameAndPassword); + bUsernameAndPassword.auditLoginAttempt(false, bUser, context); + } + if (authenticationException.getMessage().startsWith("Fatal")) { + throw authenticationException; + } + return false; + } + } + try { + bUser = this.authenticateUser((BUserService)bUsernameAndPassword, string, string2, context); + } + catch (AuthenticationException authenticationException) { + return false; + } + this.authenticateSuccess(foxSession, bUser); + return true; + } + + protected boolean authenticateDigest(FoxSession foxSession) throws Exception { + FoxMessage foxMessage = foxSession.getRemoteHello(); + if (foxMessage.getString("fox.version", "1.0").compareTo("1.0.1") < 0) { + BFoxService bFoxService = (BFoxService)Sys.getService((Type)BFoxService.TYPE); + BAbsTime bAbsTime = bFoxService.getLegacyAuthentication(); + if (!bAbsTime.isNull() && bAbsTime.isAfter(BAbsTime.now())) { + return this.authenticateBasic(foxSession); + } + Log log = Log.getLog((String)"fox"); + if (log.isTraceOn()) { + log.error(this.lex.getText("fox.legacy.cannotAuth")); + } + return false; + } + FoxMessage foxMessage2 = new FoxMessage(); + foxMessage2.add("method", "digest"); + foxSession.setState("server.tune sendChallenge digest"); + foxSession.sendTuning("challenge", foxMessage2); + BUserService bUserService = (BUserService)Sys.getService((Type)BUserService.TYPE); + BUser bUser = null; + Context context = this.getAuditContext(foxSession); + try { + Acceptor.accept(foxSession); + ScramSha256Server scramSha256Server = new ScramSha256Server((ScramSha256Server.IUserKeyFactory)new FoxUserKeyFactory(foxSession)); + bUserService = this.authenticateAttempt(foxSession, scramSha256Server.getUserName()); + foxSession.setState("server.tune receive firstMessage"); + FoxMessage foxMessage3 = foxSession.receiveTuning("authMessage1"); + String string = foxMessage3.getString("authInput"); + if (string.equals("authInputHttp")) { + try { + byte[] byArray = foxMessage3.getBlob("credentials"); + BHttpFoxCredentials bHttpFoxCredentials = (BHttpFoxCredentials)ValueByteBuffer.unmarshal((byte[])byArray); + bUser = BUserService.httpHandler.processCredentials(bHttpFoxCredentials, foxSession.getRemoteHost()); + } + catch (AuthenticationException authenticationException) { + if (authenticationException.getMessage().startsWith("Fatal")) { + throw new FatalAuthenticationException(authenticationException.getMessage()); + } + throw authenticationException; + } + } else if (string.equals("authInputScram")) { + String string2 = foxMessage3.getString("authHandshake1"); + String string3 = scramSha256Server.createServerFirstMessage(string2); + bUser = bUserService.getUser(scramSha256Server.getUserName()); + FoxMessage foxMessage4 = new FoxMessage(); + foxMessage4.add("authHandshake1", string3); + foxSession.setState("server.tune send scramsha1-serverFirstMessage"); + foxSession.sendTuning("authMessage1", foxMessage4); + foxSession.setState("server.tune receive scramsha1-clientFinalMessage"); + foxMessage3 = foxSession.receiveTuning("authMessage2"); + String string4 = foxMessage3.getString("authHandshake2"); + String string5 = scramSha256Server.createServerFinalMessage(string4); + foxMessage4 = new FoxMessage(); + foxMessage4.add("authHandshake2", string5); + foxSession.setState("server.tune send scramsha1-serverFinalMessage"); + foxSession.sendTuning("authMessage2", foxMessage4); + } else if (string.equals("authInputRetrieve")) { + throw new IllegalStateException("Password retrieval is not supported."); + } + bUser.authenticateOk(bUserService); + bUserService.auditLoginAttempt(true, bUser, context); + this.authenticateSuccess(foxSession, bUser); + return true; + } + catch (FatalAuthenticationException fatalAuthenticationException) { + throw fatalAuthenticationException; + } + catch (Exception exception) { + if (bUser != null) { + bUser.authenticateFailed(bUserService); + bUserService.auditLoginAttempt(false, bUser, context); + } + return false; + } + } + + protected Context getAuditContext(FoxSession foxSession) { + BFacets bFacets = null; + if (BFoxService.auditConnection(foxSession)) { + bFacets = BFacets.make((String)"target", (BIDataValue)BString.make((String)((BFoxServerConnection)foxSession.conn()).toPathString()), (String)"slotName", (BIDataValue)BString.make((String)foxSession.getRemoteHost())); + } + return bFacets; + } + + protected BUser authenticateUser(BUserService bUserService, String string, String string2, Context context) { + return AuthenticateUtil.authenticateUsernameAndPassword((String)string, (String)string2, (BUserService)bUserService, (Context)context); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + Class clazz = class$com$tridium$fox$sys$BFoxDefaultAuthAgent; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxDefaultAuthAgent = BFoxDefaultAuthAgent.class("[Lcom.tridium.fox.sys.BFoxDefaultAuthAgent;", false); + } + this.lex = Lexicon.make((Class)clazz); + } + + public BFoxDefaultAuthAgent() { + this.this(); + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxDefaultAuthAgent; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxDefaultAuthAgent = BFoxDefaultAuthAgent.class("[Lcom.tridium.fox.sys.BFoxDefaultAuthAgent;", false); + } + TYPE = Sys.loadType((Class)clazz); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class FoxUserKeyFactory + implements ScramSha256Server.IUserKeyFactory { + private FoxSession session; + + public String getUserKey(String string) { + BUserService bUserService = BFoxDefaultAuthAgent.this.authenticateAttempt(this.session, string); + BUser bUser = bUserService.getUser(string); + if (bUser == null || !bUserService.canLogin(bUser)) { + BPbkdf2HmacSha256PasswordEncoder bPbkdf2HmacSha256PasswordEncoder = BPbkdf2HmacSha256PasswordEncoder.makeFake((String)string); + return bPbkdf2HmacSha256PasswordEncoder.getValue(); + } + BPbkdf2HmacSha256PasswordEncoder.makeFake((String)string); + BPassword bPassword = bUser.getPassword(); + BPbkdf2HmacSha256PasswordEncoder bPbkdf2HmacSha256PasswordEncoder = (BPbkdf2HmacSha256PasswordEncoder)bPassword.getPasswordEncoder(); + return bPbkdf2HmacSha256PasswordEncoder.getValue(); + } + + public FoxUserKeyFactory(FoxSession foxSession) { + this.session = foxSession; + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxScheme.java b/modules/cfr_output/com/tridium/fox/sys/BFoxScheme.java new file mode 100644 index 0000000..7705d58 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxScheme.java @@ -0,0 +1,241 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.net.HttpUtil + * javax.baja.naming.BHost + * javax.baja.naming.BIpHost + * javax.baja.naming.BStationSessionScheme + * javax.baja.naming.OrdQuery + * javax.baja.naming.OrdQueryList + * javax.baja.naming.OrdTarget + * javax.baja.naming.SyntaxException + * javax.baja.naming.UnresolvedException + * javax.baja.nre.util.TextUtil + * javax.baja.security.AuthenticationException + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys; + +import com.tridium.fox.sys.BFoxSession; +import com.tridium.fox.sys.LocalizableServerException; +import com.tridium.net.HttpUtil; +import javax.baja.naming.BHost; +import javax.baja.naming.BIpHost; +import javax.baja.naming.BStationSessionScheme; +import javax.baja.naming.OrdQuery; +import javax.baja.naming.OrdQueryList; +import javax.baja.naming.OrdTarget; +import javax.baja.naming.SyntaxException; +import javax.baja.naming.UnresolvedException; +import javax.baja.nre.util.TextUtil; +import javax.baja.security.AuthenticationException; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxScheme +extends BStationSessionScheme { + public static final int DEFAULT_PORT = 1911; + public static final String SCHEME_NAME = "fox"; + public static final BFoxScheme INSTANCE = new BFoxScheme(); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxScheme; + + public OrdQuery parse(String string) { + return new FoxQuery(string); + } + + public OrdTarget resolve(OrdTarget ordTarget, OrdQuery ordQuery) throws SyntaxException, UnresolvedException { + Object object; + BHost bHost; + BHost bHost2 = null; + BObject bObject = ordTarget.get(); + bHost2 = bObject instanceof BHost ? (BHost)bObject : ((BComponent)bObject).getHost(); + FoxQuery foxQuery = (FoxQuery)ordQuery; + int n = foxQuery.port; + String[] stringArray = foxQuery.tunnelAuthorities; + BFoxSession bFoxSession = BFoxSession.make(null, bHost2, n, false, stringArray); + if (Sys.isStationStarted() && stringArray != null && stringArray.length > 0 && (bHost = BHost.getHost((String)(object = BFoxScheme.parseHost(stringArray[stringArray.length - 1])))) == null) { + bHost = new BIpHost((String)object); + BHost.mount((BHost)bHost); + } + try { + bFoxSession.connect(); + if (bFoxSession.getUseFoxs() && (object = (BFoxSession)bHost2.getNavChild(BFoxSession.buildNavName(bFoxSession.getPort(), true, stringArray))) != null) { + ((BFoxSession)object).close(); + } + return new OrdTarget(ordTarget, (BObject)bFoxSession); + } + catch (LocalizableServerException localizableServerException) { + if (localizableServerException.getLexiconModule().equals(SCHEME_NAME) && localizableServerException.getLexiconKey().equals("error.NoPermissionForStation")) { + bFoxSession.disconnect(); + } + throw localizableServerException; + } + catch (AuthenticationException authenticationException) { + throw authenticationException; + } + catch (Throwable throwable) { + throw new UnresolvedException(ordQuery.toString(), throwable); + } + } + + public int getDefaultPort() { + return 1911; + } + + static String parseHost(String string) { + return HttpUtil.parseHost((String)string); + } + + static int parsePort(String string) { + return HttpUtil.parsePort((String)string, (int)1911); + } + + static String[] validateAuthorities(String[] stringArray) { + if (stringArray == null) { + return null; + } + int n = stringArray.length; + if (n < 1) { + return null; + } + String[] stringArray2 = new String[n]; + int n2 = 0; + int n3 = 0; + while (n3 < n) { + if (stringArray[n3] != null && !stringArray[n3].equals("")) { + stringArray2[n2] = stringArray[n3]; + ++n2; + } + ++n3; + } + String[] stringArray3 = new String[n2]; + System.arraycopy(stringArray2, 0, stringArray3, 0, n2); + return stringArray3; + } + + public Type getType() { + return TYPE; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private BFoxScheme() { + super(SCHEME_NAME); + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxScheme; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxScheme = BFoxScheme.class("[Lcom.tridium.fox.sys.BFoxScheme;", false); + } + TYPE = Sys.loadType((Class)clazz); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public static class FoxQuery + implements OrdQuery { + int port; + String[] tunnelAuthorities; + + public boolean isHost() { + return false; + } + + public boolean isSession() { + return true; + } + + public void normalize(OrdQueryList ordQueryList, int n) { + ordQueryList.shiftToHost(n); + } + + public String getScheme() { + return BFoxScheme.SCHEME_NAME; + } + + public String getBody() { + StringBuffer stringBuffer = new StringBuffer(); + if (this.port != 1911) { + stringBuffer.append(String.valueOf(this.port)); + } + if (this.tunnelAuthorities != null) { + int n = 0; + while (n < this.tunnelAuthorities.length) { + if (this.tunnelAuthorities[n] != null && !this.tunnelAuthorities[n].equals("")) { + stringBuffer.append("/").append(this.tunnelAuthorities[n]); + } + ++n; + } + } + return stringBuffer.toString(); + } + + public String toString() { + return "fox:" + this.getBody(); + } + + public int getPort() { + return this.port; + } + + public String[] getTunnelAuthorities() { + return this.tunnelAuthorities; + } + + private final /* synthetic */ void this() { + this.tunnelAuthorities = null; + } + + FoxQuery(String string) { + this.this(); + string = string.trim(); + if (string.length() == 0) { + this.port = 1911; + } else { + int n = string.indexOf(47); + if (n >= 0) { + this.port = n == 0 ? 1911 : Integer.parseInt(string.substring(0, n)); + string = string.substring(n); + this.tunnelAuthorities = BFoxScheme.validateAuthorities(TextUtil.splitAndTrim((String)string, (char)'/')); + } else { + this.port = Integer.parseInt(string); + } + } + } + + FoxQuery(int n) { + this.this(); + this.port = n; + } + + FoxQuery(int n, String[] stringArray) { + this.this(); + this.port = n; + this.tunnelAuthorities = BFoxScheme.validateAuthorities(stringArray); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxServerConnection.java b/modules/cfr_output/com/tridium/fox/sys/BFoxServerConnection.java new file mode 100644 index 0000000..0b2c3ab --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxServerConnection.java @@ -0,0 +1,193 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.util.ContextThread + * javax.baja.security.AuditEvent + * javax.baja.sys.Action + * javax.baja.sys.BAbsTime + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.user.BUser + */ +package com.tridium.fox.sys; + +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.sys.BFoxConnection; +import com.tridium.fox.sys.BFoxService; +import com.tridium.fox.sys.BServerConnections; +import com.tridium.fox.sys.NiagaraStation; +import com.tridium.util.ContextThread; +import javax.baja.security.AuditEvent; +import javax.baja.sys.Action; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.user.BUser; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxServerConnection +extends BFoxConnection { + public static final Property lastLoginTime = BFoxServerConnection.newProperty((int)3, (BValue)BAbsTime.NULL, null); + public static final Property lastLoginAddress = BFoxServerConnection.newProperty((int)3, (String)"-", null); + public static final Property lastLoginUsername = BFoxServerConnection.newProperty((int)3, (String)"-", null); + public static final Property lastLoginApp = BFoxServerConnection.newProperty((int)3, (String)"-", null); + public static final Action forceDisconnect = BFoxServerConnection.newAction((int)0, null); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxServerConnection; + + public BAbsTime getLastLoginTime() { + return (BAbsTime)this.get(lastLoginTime); + } + + public void setLastLoginTime(BAbsTime bAbsTime) { + this.set(lastLoginTime, (BValue)bAbsTime, null); + } + + public String getLastLoginAddress() { + return this.getString(lastLoginAddress); + } + + public void setLastLoginAddress(String string) { + this.setString(lastLoginAddress, string, null); + } + + public String getLastLoginUsername() { + return this.getString(lastLoginUsername); + } + + public void setLastLoginUsername(String string) { + this.setString(lastLoginUsername, string, null); + } + + public String getLastLoginApp() { + return this.getString(lastLoginApp); + } + + public void setLastLoginApp(String string) { + this.setString(lastLoginApp, string, null); + } + + public void forceDisconnect() { + this.invoke(forceDisconnect, null, null); + } + + public Type getType() { + return TYPE; + } + + public void stopped() throws Exception { + if (this.session() != null) { + this.session().close(null); + } + } + + public final BUser getUser() { + FoxSession foxSession = this.session(); + if (foxSession != null) { + return foxSession.getUser(); + } + return null; + } + + public final Context getSessionContext() { + FoxSession foxSession = this.session(); + if (foxSession != null) { + return foxSession.getSessionContext(); + } + return null; + } + + public void sessionOpened(FoxSession foxSession) { + if (this.session() != null) { + this.session().close(new Exception("Reconnect while still server still connected")); + } + super.sessionOpened(foxSession); + NiagaraStation niagaraStation = this.getParentStation(); + if (niagaraStation != null) { + niagaraStation.serverOpened(); + } + } + + public void sessionClosed(FoxSession foxSession, Throwable throwable) { + Object object; + if (BFoxService.auditConnection(foxSession)) { + try { + object = Sys.getAuditor(); + if (object != null && foxSession.getUser() != null) { + object.audit(new AuditEvent("Logout", this.toPathString(), foxSession.getRemoteHost(), "", "", foxSession.getUser().getUsername())); + } + } + catch (Throwable throwable2) { + throwable2.printStackTrace(); + } + } + if (this.session() != foxSession) { + this.log.warning("Closing session [" + foxSession + " doesn't match opened session [" + this.session() + ']'); + if (this.getParent() instanceof BServerConnections) { + this.getParent().asComponent().remove(this.getPropertyInParent()); + } + return; + } + super.sessionClosed(foxSession, throwable); + object = this.getParentStation(); + if (object != null) { + object.serverClosed(); + } else if (this.getParent() instanceof BServerConnections) { + this.getParent().asComponent().remove(this.getPropertyInParent()); + } + } + + public Thread makeThread(ThreadGroup threadGroup, Runnable runnable, String string) { + return new FoxServerThread(threadGroup, runnable, string); + } + + public void doForceDisconnect() throws Exception { + this.close(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxServerConnection; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxServerConnection = BFoxServerConnection.class("[Lcom.tridium.fox.sys.BFoxServerConnection;", false); + } + TYPE = Sys.loadType((Class)clazz); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + class FoxServerThread + extends Thread + implements ContextThread { + public Context getContext() { + return BFoxServerConnection.this.getSessionContext(); + } + + FoxServerThread(ThreadGroup threadGroup, Runnable runnable, String string) { + super(threadGroup, runnable, string); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxService.java b/modules/cfr_output/com/tridium/fox/sys/BFoxService.java new file mode 100644 index 0000000..d62e19b --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxService.java @@ -0,0 +1,815 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.Nre + * com.tridium.sys.NreLib + * com.tridium.sys.license.Brand + * javax.baja.data.BIDataValue + * javax.baja.io.net.IServerSocketFactory + * javax.baja.log.Log + * javax.baja.security.AuthenticationException + * javax.baja.security.DigestFactory + * javax.baja.security.crypto.BSslTlsEnum + * javax.baja.security.crypto.BTlsEnum + * javax.baja.security.crypto.CertManagerFactory + * javax.baja.security.crypto.ICryptoManagerEx + * javax.baja.space.BComponentSpace + * javax.baja.sys.Action + * javax.baja.sys.BAbsTime + * javax.baja.sys.BComplex + * javax.baja.sys.BComponent + * javax.baja.sys.BFacets + * javax.baja.sys.BIService + * javax.baja.sys.BIcon + * javax.baja.sys.BInteger + * javax.baja.sys.BRelTime + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.Clock + * javax.baja.sys.Clock$Ticket + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.Lexicon + * javax.baja.util.Version + */ +package com.tridium.fox.sys; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxConnection; +import com.tridium.fox.session.FoxServer; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.session.Tuner; +import com.tridium.fox.sys.Acceptor; +import com.tridium.fox.sys.BFoxAuthenticationPolicy; +import com.tridium.fox.sys.BFoxServerConnection; +import com.tridium.fox.sys.BFoxTunnelServerConnection; +import com.tridium.fox.sys.BServerConnections; +import com.tridium.fox.sys.NiagaraNetwork; +import com.tridium.sys.Nre; +import com.tridium.sys.NreLib; +import com.tridium.sys.license.Brand; +import java.io.IOException; +import java.lang.reflect.Method; +import java.net.BindException; +import java.net.InetAddress; +import java.net.ServerSocket; +import java.util.ArrayList; +import javax.baja.data.BIDataValue; +import javax.baja.io.net.IServerSocketFactory; +import javax.baja.log.Log; +import javax.baja.security.AuthenticationException; +import javax.baja.security.DigestFactory; +import javax.baja.security.crypto.BSslTlsEnum; +import javax.baja.security.crypto.BTlsEnum; +import javax.baja.security.crypto.CertManagerFactory; +import javax.baja.security.crypto.ICryptoManagerEx; +import javax.baja.space.BComponentSpace; +import javax.baja.sys.Action; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BIService; +import javax.baja.sys.BIcon; +import javax.baja.sys.BInteger; +import javax.baja.sys.BRelTime; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.Clock; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.Lexicon; +import javax.baja.util.Version; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxService +extends BComponent +implements BIService { + public static final Property port = BFoxService.newProperty((int)0, (int)1911, null); + public static final Property foxEnabled = BFoxService.newProperty((int)0, (boolean)true, null); + public static final Property foxsPort = BFoxService.newProperty((int)0, (int)4911, null); + public static final Property foxsEnabled = BFoxService.newProperty((int)0, (boolean)false, null); + public static final Property foxsOnly = BFoxService.newProperty((int)0, (boolean)false, null); + public static final Property foxsMinProtocol = BFoxService.newProperty((int)5, (BValue)BSslTlsEnum.tlsv1, null); + public static final Property tlsMinProtocol = BFoxService.newProperty((int)4, (BValue)BTlsEnum.tlsv1, null); + public static final Property foxsCert = BFoxService.newProperty((int)0, (String)"tridium", (BFacets)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"workbench:CertificateAliasFE"))); + public static final Property authenticationPolicy = BFoxService.newProperty((int)0, (BValue)BFoxAuthenticationPolicy.digest, null); + public static final Property legacyAuthentication = BFoxService.newProperty((int)0, (BValue)BAbsTime.NULL, (BFacets)BFacets.make((String)"fieldEditor", (String)"workbench:RelaxedFE")); + public static final Property requestTimeout = BFoxService.newProperty((int)0, (BValue)BRelTime.make((long)Fox.requestTimeout), (BFacets)BFacets.make((String)"min", (BIDataValue)BRelTime.make((long)1L))); + public static final Property socketOptionTimeout = BFoxService.newProperty((int)0, (BValue)BRelTime.make((long)Fox.soTimeout), (BFacets)BFacets.make((String)"min", (BIDataValue)BRelTime.make((long)1L))); + public static final Property socketTcpNoDelay = BFoxService.newProperty((int)0, (boolean)true, null); + public static final Property keepAliveInterval = BFoxService.newProperty((int)0, (BValue)BRelTime.make((long)Fox.keepAliveInterval), null); + public static final Property maxServerSessions = BFoxService.newProperty((int)0, (int)Fox.maxServerSessions, null); + public static final Property multicastEnabled = BFoxService.newProperty((int)0, (boolean)true, null); + public static final Property enableAnnouncement = BFoxService.newProperty((int)0, (boolean)true, null); + public static final Property multicastTimeToLive = BFoxService.newProperty((int)0, (int)Fox.multicastTimeToLive, null); + public static final Property serverConnections = BFoxService.newProperty((int)0, (BValue)new BServerConnections(), null); + public static final Property traceSessionStates = BFoxService.newProperty((int)0, (boolean)false, null); + public static final Property traceReadFrame = BFoxService.newProperty((int)0, (boolean)false, null); + public static final Property traceWriteFrame = BFoxService.newProperty((int)0, (boolean)false, null); + public static final Property traceMulticast = BFoxService.newProperty((int)0, (boolean)false, null); + public static final Property tunnelingEnabled = BFoxService.newProperty((int)0, (boolean)false, null); + public static final Property onlyTunnelKnownStations = BFoxService.newProperty((int)0, (boolean)false, null); + public static final Action delayStationStarted = BFoxService.newAction((int)4, null); + public static final Action checkLegacyAuth = BFoxService.newAction((int)4, null); + public static final Type TYPE; + private static final Type[] serviceTypes; + private static final BIcon icon; + public static final Log log; + private static final Version FOXS_MIN_PROTOCOL_VERSION; + private Daemon daemon; + private Clock.Ticket restartTicket; + private Clock.Ticket legacyAuthCheckTicket; + private boolean tlsMinProtocolChecked; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxService; + static /* synthetic */ Class class$java$lang$String; + + public int getPort() { + return this.getInt(port); + } + + public void setPort(int n) { + this.setInt(port, n, null); + } + + public boolean getFoxEnabled() { + return this.getBoolean(foxEnabled); + } + + public void setFoxEnabled(boolean bl) { + this.setBoolean(foxEnabled, bl, null); + } + + public int getFoxsPort() { + return this.getInt(foxsPort); + } + + public void setFoxsPort(int n) { + this.setInt(foxsPort, n, null); + } + + public boolean getFoxsEnabled() { + return this.getBoolean(foxsEnabled); + } + + public void setFoxsEnabled(boolean bl) { + this.setBoolean(foxsEnabled, bl, null); + } + + public boolean getFoxsOnly() { + return this.getBoolean(foxsOnly); + } + + public void setFoxsOnly(boolean bl) { + this.setBoolean(foxsOnly, bl, null); + } + + public BSslTlsEnum getFoxsMinProtocol() { + return (BSslTlsEnum)this.get(foxsMinProtocol); + } + + public void setFoxsMinProtocol(BSslTlsEnum bSslTlsEnum) { + this.set(foxsMinProtocol, (BValue)bSslTlsEnum, null); + } + + public BTlsEnum getTlsMinProtocol() { + return (BTlsEnum)this.get(tlsMinProtocol); + } + + public void setTlsMinProtocol(BTlsEnum bTlsEnum) { + this.set(tlsMinProtocol, (BValue)bTlsEnum, null); + } + + public String getFoxsCert() { + return this.getString(foxsCert); + } + + public void setFoxsCert(String string) { + this.setString(foxsCert, string, null); + } + + public BFoxAuthenticationPolicy getAuthenticationPolicy() { + return (BFoxAuthenticationPolicy)this.get(authenticationPolicy); + } + + public void setAuthenticationPolicy(BFoxAuthenticationPolicy bFoxAuthenticationPolicy) { + this.set(authenticationPolicy, (BValue)bFoxAuthenticationPolicy, null); + } + + public BAbsTime getLegacyAuthentication() { + return (BAbsTime)this.get(legacyAuthentication); + } + + public void setLegacyAuthentication(BAbsTime bAbsTime) { + this.set(legacyAuthentication, (BValue)bAbsTime, null); + } + + public BRelTime getRequestTimeout() { + return (BRelTime)this.get(requestTimeout); + } + + public void setRequestTimeout(BRelTime bRelTime) { + this.set(requestTimeout, (BValue)bRelTime, null); + } + + public BRelTime getSocketOptionTimeout() { + return (BRelTime)this.get(socketOptionTimeout); + } + + public void setSocketOptionTimeout(BRelTime bRelTime) { + this.set(socketOptionTimeout, (BValue)bRelTime, null); + } + + public boolean getSocketTcpNoDelay() { + return this.getBoolean(socketTcpNoDelay); + } + + public void setSocketTcpNoDelay(boolean bl) { + this.setBoolean(socketTcpNoDelay, bl, null); + } + + public BRelTime getKeepAliveInterval() { + return (BRelTime)this.get(keepAliveInterval); + } + + public void setKeepAliveInterval(BRelTime bRelTime) { + this.set(keepAliveInterval, (BValue)bRelTime, null); + } + + public int getMaxServerSessions() { + return this.getInt(maxServerSessions); + } + + public void setMaxServerSessions(int n) { + this.setInt(maxServerSessions, n, null); + } + + public boolean getMulticastEnabled() { + return this.getBoolean(multicastEnabled); + } + + public void setMulticastEnabled(boolean bl) { + this.setBoolean(multicastEnabled, bl, null); + } + + public boolean getEnableAnnouncement() { + return this.getBoolean(enableAnnouncement); + } + + public void setEnableAnnouncement(boolean bl) { + this.setBoolean(enableAnnouncement, bl, null); + } + + public int getMulticastTimeToLive() { + return this.getInt(multicastTimeToLive); + } + + public void setMulticastTimeToLive(int n) { + this.setInt(multicastTimeToLive, n, null); + } + + public BServerConnections getServerConnections() { + return (BServerConnections)this.get(serverConnections); + } + + public void setServerConnections(BServerConnections bServerConnections) { + this.set(serverConnections, (BValue)bServerConnections, null); + } + + public boolean getTraceSessionStates() { + return this.getBoolean(traceSessionStates); + } + + public void setTraceSessionStates(boolean bl) { + this.setBoolean(traceSessionStates, bl, null); + } + + public boolean getTraceReadFrame() { + return this.getBoolean(traceReadFrame); + } + + public void setTraceReadFrame(boolean bl) { + this.setBoolean(traceReadFrame, bl, null); + } + + public boolean getTraceWriteFrame() { + return this.getBoolean(traceWriteFrame); + } + + public void setTraceWriteFrame(boolean bl) { + this.setBoolean(traceWriteFrame, bl, null); + } + + public boolean getTraceMulticast() { + return this.getBoolean(traceMulticast); + } + + public void setTraceMulticast(boolean bl) { + this.setBoolean(traceMulticast, bl, null); + } + + public boolean getTunnelingEnabled() { + return this.getBoolean(tunnelingEnabled); + } + + public void setTunnelingEnabled(boolean bl) { + this.setBoolean(tunnelingEnabled, bl, null); + } + + public boolean getOnlyTunnelKnownStations() { + return this.getBoolean(onlyTunnelKnownStations); + } + + public void setOnlyTunnelKnownStations(boolean bl) { + this.setBoolean(onlyTunnelKnownStations, bl, null); + } + + public void delayStationStarted() { + this.invoke(delayStationStarted, null, null); + } + + public void checkLegacyAuth() { + this.invoke(checkLegacyAuth, null, null); + } + + public Type getType() { + return TYPE; + } + + public Type[] getServiceTypes() { + return serviceTypes; + } + + public boolean isServing() { + Daemon daemon = this.daemon; + boolean bl = false; + if (daemon != null && daemon.isServing()) { + bl = true; + } + return bl; + } + + public void stationStarted() { + int n = -1; + int n2 = -1; + try { + ArrayList arrayList = new ArrayList(); + ArrayList arrayList2 = new ArrayList(); + this.serviceStopped(); + this.initOptions(); + if (this.getFoxEnabled()) { + n = this.getFoxPort(); + } + if (this.getFoxsEnabled()) { + n2 = this.getFoxsPort(); + } + this.daemon = new Daemon(this, n, n2); + this.daemon.run(); + arrayList.add("foxport"); + arrayList2.add(String.valueOf(n)); + arrayList.add("foxsport"); + arrayList2.add(String.valueOf(n2)); + Nre.getPlatform().reportSummaryFields(arrayList.toArray(new String[0]), arrayList2.toArray(new String[0])); + this.doCheckLegacyAuth(); + } + catch (Exception exception) { + log.error("Cannot start", (Throwable)exception); + } + } + + public void serviceStarted() { + try { + Nre.serviceManager.getService("platCrypto:CertManagerService"); + this.setFacets((Slot)tlsMinProtocol, BFacets.make((String)"supportsTlsMinProtocol", (boolean)true)); + this.setFlags((Slot)tlsMinProtocol, this.getFlags((Slot)tlsMinProtocol) & 0xFFFFFFFB); + this.setFlags((Slot)foxsPort, this.getFlags((Slot)foxsPort) & 0xFFFFFFFA); + this.setFlags((Slot)foxsEnabled, this.getFlags((Slot)foxsEnabled) & 0xFFFFFFFA); + this.setFlags((Slot)foxsOnly, this.getFlags((Slot)foxsOnly) & 0xFFFFFFFA); + this.setFlags((Slot)foxsCert, this.getFlags((Slot)foxsCert) & 0xFFFFFFFA); + try { + Class clazz = Class.forName("javax.net.ssl.SSLContext"); + Class[] classArray = new Class[1]; + Class clazz2 = class$java$lang$String; + if (clazz2 == null) { + clazz2 = class$java$lang$String = BFoxService.class("[Ljava.lang.String;", false); + } + classArray[0] = clazz2; + Method method = clazz.getMethod("getInstance", classArray); + method.invoke(null, "TLSv1.1"); + this.setFlags((Slot)tlsMinProtocol, this.getFlags((Slot)tlsMinProtocol) & 0xFFFFFFFA); + this.setFacets((Slot)tlsMinProtocol, BFacets.make((String)"supportsTls11AndAbove", (boolean)true)); + } + catch (Exception exception) { + this.setTlsMinProtocol(BTlsEnum.tlsv1); + this.setFlags((Slot)tlsMinProtocol, this.getFlags((Slot)tlsMinProtocol) | 1); + this.setFacets((Slot)tlsMinProtocol, BFacets.make((String)"supportsTls11AndAbove", (boolean)false)); + log.message("Only TLSv1 is supported on this platform, forcing to TLSv1"); + } + } + catch (Exception exception) { + if (this.getFoxsEnabled()) { + log.warning("Foxs is unsupported on this device. Using fox instead."); + } + this.setFoxEnabled(true); + this.setFlags((Slot)foxsPort, this.getFlags((Slot)foxsPort) | 1 | 4); + this.setFoxsEnabled(false); + this.setFlags((Slot)foxsEnabled, this.getFlags((Slot)foxsEnabled) | 1 | 4); + this.setFoxsOnly(false); + this.setFlags((Slot)foxsOnly, this.getFlags((Slot)foxsOnly) | 1 | 4); + this.setFlags((Slot)tlsMinProtocol, this.getFlags((Slot)tlsMinProtocol) | 1 | 4); + this.setFlags((Slot)foxsCert, this.getFlags((Slot)foxsCert) | 1 | 4); + } + } + + public void serviceStopped() { + if (this.daemon != null) { + log.message("Service stopped"); + this.daemon.stop(); + } + this.daemon = null; + } + + private final void initOptions() { + Fox.appName = "Station"; + Fox.appVersion = "" + Sys.getBajaModule().getVendorVersion(); + Fox.hostName = Sys.getLocalHost().getHostName(); + Fox.hostAddress = Sys.getLocalHost().getHostAddress(); + Fox.ipv4Enabled = NreLib.getLocalHost((boolean)false).isLoopbackAddress() ^ true; + boolean bl = false; + if (Fox.ipv6Enabled && !NreLib.getLocalHost((boolean)true).isLoopbackAddress()) { + bl = true; + } + Fox.ipv6Enabled = bl; + Fox.requestTimeout = (int)this.getRequestTimeout().getMillis(); + Fox.keepAliveInterval = (int)this.getKeepAliveInterval().getMillis(); + Fox.soTimeout = (int)this.getSocketOptionTimeout().getMillis(); + Fox.tcpNoDelay = this.getSocketTcpNoDelay(); + Fox.multicastEnabled = this.getMulticastEnabled(); + Fox.multicastTimeToLive = this.getMulticastTimeToLive(); + Fox.maxServerSessions = this.getMaxServerSessions(); + Fox.traceSessionStates = this.getTraceSessionStates(); + Fox.traceReadFrame = this.getTraceReadFrame(); + Fox.traceWriteFrame = this.getTraceWriteFrame(); + Fox.traceMulticast = this.getTraceMulticast(); + Fox.tunnelingEnabled = this.getTunnelingEnabled(); + Fox.onlyTunnelKnownStations = this.getOnlyTunnelKnownStations(); + Acceptor.foxTunnelingLicensed(); + } + + public static BFoxService waitUntilPortOpen(long l) { + try { + BFoxService bFoxService = (BFoxService)Sys.getService((Type)TYPE); + long l2 = Clock.ticks(); + while (!bFoxService.isServing()) { + if (Clock.ticks() - l2 > l) { + throw new BajaRuntimeException("BFoxService.waitUntilPortOpen timed out"); + } + Thread.sleep(100L); + } + return bFoxService; + } + catch (BajaRuntimeException bajaRuntimeException) { + throw bajaRuntimeException; + } + catch (Exception exception) { + System.out.println("ERROR: BFoxService.waitUntilPortOpen failed"); + exception.printStackTrace(); + throw new BajaRuntimeException("FoxService.waitUntilPortOpen", (Throwable)exception); + } + } + + public boolean isNavChild() { + BComponentSpace bComponentSpace; + if (!this.tlsMinProtocolChecked && (bComponentSpace = this.getComponentSpace()) != null && bComponentSpace.isProxyComponentSpace()) { + this.tlsMinProtocolChecked = true; + Version version = (Version)this.fw(404, "baja", null, null, null); + if (version != null && !version.isNull() && version.compareTo((Object)FOXS_MIN_PROTOCOL_VERSION) >= 0) { + this.loadSlots(); + this.setFoxsMinProtocol(BSslTlsEnum.tlsv1); + this.setFlags((Slot)foxsMinProtocol, 5); + BFacets bFacets = this.getSlotFacets((Slot)tlsMinProtocol); + if (bFacets != null) { + boolean bl = bFacets.getb("supportsTlsMinProtocol", false); + if (!bl) { + this.setFlags((Slot)tlsMinProtocol, 5, Context.commit); + } else { + boolean bl2 = bFacets.getb("supportsTls11AndAbove", false); + if (bl2) { + this.setFlags((Slot)tlsMinProtocol, this.getFlags((Slot)tlsMinProtocol) & 0xFFFFFFFA); + } else { + this.setFlags((Slot)tlsMinProtocol, this.getFlags((Slot)tlsMinProtocol) & 0xFFFFFFFB | 1); + } + } + } else { + this.setFlags((Slot)tlsMinProtocol, 4, Context.commit); + } + } + } + return super.isNavChild(); + } + + public void changed(Property property, Context context) { + super.changed(property, context); + if (!this.isRunning()) { + return; + } + if (property == port || property == foxsPort) { + this.triggerDelayedStationStarted(); + } else if (property == foxsCert || property == tlsMinProtocol || property == foxsOnly) { + if (this.getFoxsEnabled()) { + this.triggerDelayedStationStarted(); + } + } else if (property == foxEnabled || property == foxsEnabled || property == multicastEnabled) { + this.triggerDelayedStationStarted(); + } else { + this.initOptions(); + } + } + + private final synchronized void triggerDelayedStationStarted() { + this.triggerDelayedStationStarted(500L); + } + + private final synchronized void triggerDelayedStationStarted(long l) { + if (this.restartTicket == null) { + this.restartTicket = Clock.schedule((BComponent)this, (BRelTime)BRelTime.make((long)l), (Action)delayStationStarted, null); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void doDelayStationStarted() { + BFoxService bFoxService = this; + synchronized (bFoxService) { + this.restartTicket = null; + // MONITOREXIT @DISABLED, blocks:[0, 1] lbl5 : MonitorExitStatement: MONITOREXIT : var1_1 + this.stationStarted(); + return; + } + } + + public void doCheckLegacyAuth() { + BAbsTime bAbsTime; + Class clazz = class$com$tridium$fox$sys$BFoxService; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxService = BFoxService.class("[Lcom.tridium.fox.sys.BFoxService;", false); + } + Lexicon lexicon = Lexicon.make((Class)clazz); + if (this.legacyAuthCheckTicket != null) { + this.legacyAuthCheckTicket.cancel(); + } + if (!(bAbsTime = this.getLegacyAuthentication()).isNull()) { + if (bAbsTime.isBefore(BAbsTime.now())) { + log.warning(lexicon.getText("fox.legacy.relaxed.expired")); + } else { + log.warning(lexicon.getText("fox.legacy.relaxed")); + if (BAbsTime.now().delta(bAbsTime).getDays() < 7) { + log.warning(lexicon.getText("fox.legacy.relaxed.expiring", new Object[]{bAbsTime})); + } + } + } + BAbsTime bAbsTime2 = Clock.time().timeOfDay(1, 0, 0, 0).nextDay(); + this.legacyAuthCheckTicket = Clock.schedule((BComponent)this, (BAbsTime)bAbsTime2, (Action)checkLegacyAuth, null); + } + + public BFoxServerConnection makeServerConnection(FoxSession foxSession, FoxMessage foxMessage) throws Exception { + BFoxServerConnection bFoxServerConnection = new BFoxServerConnection(); + this.getServerConnections().add("Session" + foxSession.getId(), (BValue)bFoxServerConnection, 3); + return bFoxServerConnection; + } + + public FoxServer getFoxServer() { + return this.daemon; + } + + public int getFoxPort() { + return this.getPort(); + } + + public static NiagaraNetwork getNiagaraNetwork() { + BFoxService bFoxService = (BFoxService)Sys.getService((Type)TYPE); + BComplex bComplex = bFoxService.getParent(); + while (bComplex != null) { + if (bComplex instanceof NiagaraNetwork) { + return (NiagaraNetwork)bComplex; + } + bComplex = bComplex.getParent(); + } + return null; + } + + public static void httpSessionClosed(String string) { + if (string == null) { + return; + } + BFoxService bFoxService = (BFoxService)Sys.getService((Type)TYPE); + BComponent[] bComponentArray = bFoxService.getServerConnections().getChildComponents(); + if (bComponentArray == null) { + return; + } + int n = 0; + while (n < bComponentArray.length) { + String string2; + BFoxServerConnection bFoxServerConnection = (BFoxServerConnection)bComponentArray[n]; + if (bFoxServerConnection != null && string.equals(string2 = bFoxServerConnection.session().getRemoteHello().getString("httpSession", null))) { + bFoxServerConnection.close(); + } + ++n; + } + } + + public static int getHttpPort() { + try { + Type type = Sys.getType((String)"web:WebService"); + BComponent bComponent = Sys.getService((Type)type); + BInteger bInteger = (BInteger)bComponent.get("httpPort"); + return bInteger.getInt(); + } + catch (Exception exception) { + return -1; + } + } + + public static boolean auditConnection(FoxSession foxSession) { + String string = foxSession.getRemoteHello().getString("app.name", "Station"); + return string.equals("Station") ^ true; + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.restartTicket = null; + this.legacyAuthCheckTicket = null; + this.tlsMinProtocolChecked = false; + } + + public BFoxService() { + this.this(); + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxService; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxService = BFoxService.class("[Lcom.tridium.fox.sys.BFoxService;", false); + } + TYPE = Sys.loadType((Class)clazz); + serviceTypes = new Type[]{TYPE}; + icon = BIcon.std((String)"fox.png"); + log = Log.getLog((String)"fox"); + FOXS_MIN_PROTOCOL_VERSION = new Version("3.7.0"); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + class Daemon + extends FoxServer { + private BFoxService service; + + public void run() { + try { + super.run(); + } + catch (Exception exception) {} + } + + public ServerSocket getFoxsServerSocket() throws IOException { + ICryptoManagerEx iCryptoManagerEx; + try { + iCryptoManagerEx = CertManagerFactory.getInstanceEx(); + } + catch (Exception exception) { + throw new IOException("Unable to get crypto service instance"); + } + try { + IServerSocketFactory iServerSocketFactory = iCryptoManagerEx.getServerSocketFactory(this.service.getTlsMinProtocol().getTag(), false, this.service.getFoxsCert()); + return iServerSocketFactory.createServerSocket(BFoxService.this.getFoxsPort(), 10); + } + catch (BindException bindException) { + throw bindException; + } + catch (Exception exception) { + if (log.isTraceOn()) { + exception.printStackTrace(); + } + if (!BFoxService.this.getFoxEnabled() || BFoxService.this.getFoxsOnly()) { + log.warning("Unable to start foxs, enabling fox connectivity!"); + BFoxService.this.setFoxEnabled(true); + BFoxService.this.setFoxsOnly(false); + } + throw new IOException("Unable to create socket: " + exception.getLocalizedMessage()); + } + } + + public FoxConnection makeConnection(FoxSession foxSession, FoxMessage foxMessage) throws Exception { + if (foxSession == null) { + return new BFoxTunnelServerConnection(); + } + return BFoxService.this.makeServerConnection(foxSession, foxMessage); + } + + public FoxMessage getAnnouncement() { + InetAddress inetAddress; + if (!BFoxService.this.getEnableAnnouncement()) { + return null; + } + FoxMessage foxMessage = new FoxMessage(); + foxMessage.add("station", Sys.getStation().getStationName()); + if (Fox.ipv4Enabled && !(inetAddress = NreLib.getLocalHost((boolean)false)).isLoopbackAddress()) { + foxMessage.add("hostName", inetAddress.getHostName()); + foxMessage.add("hostAddress", inetAddress.getHostAddress()); + } + if (Fox.ipv6Enabled && !(inetAddress = NreLib.getLocalHost((boolean)true)).isLoopbackAddress()) { + foxMessage.add("hostNameIPv6", inetAddress.getHostName()); + foxMessage.add("hostAddressIPv6", inetAddress.getHostAddress()); + } + if (BFoxService.this.getFoxEnabled()) { + foxMessage.add("foxPort", BFoxService.this.getFoxPort()); + } + if (BFoxService.this.getFoxsEnabled()) { + foxMessage.add("foxsPort", BFoxService.this.getFoxsPort()); + } + foxMessage.add("httpPort", BFoxService.getHttpPort()); + foxMessage.add("version", Sys.getBajaModule().getVendorVersion().toString()); + foxMessage.add("hostId", Nre.getHostId()); + foxMessage.add("hostModel", Nre.getHostModel()); + foxMessage.add("brandId", Brand.getBrandId()); + foxMessage.add("vmName", Fox.vmName); + foxMessage.add("vmVersion", Fox.vmVersion); + foxMessage.add("osName", Fox.osName); + foxMessage.add("osVersion", Fox.osVersion); + return foxMessage; + } + + public int getAuthenticationPolicy() { + return BFoxService.this.getAuthenticationPolicy().getOrdinal(); + } + + public boolean authenticateBasic(FoxSession foxSession, String string, String string2) throws Exception { + throw new AuthenticationException("Unsupported method call authenticateBasic in BFoxService. This call should be handled by an Authentication Agent."); + } + + public boolean authenticateDigest(FoxSession foxSession, String string, byte[] byArray, byte[] byArray2) throws Exception { + throw new AuthenticationException("Unsupported method call authenticateDigest in BFoxService. This call should be handled by an Authentication Agent."); + } + + public Daemon(BFoxService bFoxService2, int n, int n2) { + super(n, n2); + this.service = bFoxService2; + } + } + + static class FoxDigestFactory + implements DigestFactory { + byte[] nonce; + + public byte[] makeDigest(String string, String string2) { + try { + return Tuner.generateDigest(string, string2, this.nonce); + } + catch (Exception exception) { + throw new BajaRuntimeException((Throwable)exception); + } + } + + public byte[] getNonce() { + return this.nonce; + } + + FoxDigestFactory(byte[] byArray) { + this.nonce = byArray; + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxSession.java b/modules/cfr_output/com/tridium/fox/sys/BFoxSession.java new file mode 100644 index 0000000..f3fd58a --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxSession.java @@ -0,0 +1,735 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.util.ArrayUtil + * com.tridium.util.BSessionInfo + * com.tridium.util.IFoxSession + * javax.baja.agent.AgentList + * javax.baja.data.BIDataValue + * javax.baja.file.BIFile + * javax.baja.naming.BHost + * javax.baja.naming.BOrd + * javax.baja.naming.BServiceScheme$ServiceSession + * javax.baja.naming.OrdQuery + * javax.baja.naming.SlotPath + * javax.baja.nav.BINavNode + * javax.baja.nav.BNavFileSpace + * javax.baja.nav.NavFileDecoder + * javax.baja.registry.TypeInfo + * javax.baja.security.AuthenticationException + * javax.baja.security.AuthenticationRealm + * javax.baja.security.BICredentials + * javax.baja.security.BIUserCredentials + * javax.baja.security.BPassword + * javax.baja.security.BUsernameAndPassword + * javax.baja.space.BSpace + * javax.baja.sys.BAbsTime + * javax.baja.sys.BComponent + * javax.baja.sys.BFacets + * javax.baja.sys.BIcon + * javax.baja.sys.BObject + * javax.baja.sys.BRelTime + * javax.baja.sys.BString + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.Context + * javax.baja.sys.ModuleNotFoundException + * javax.baja.sys.ServiceNotFoundException + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.timezone.BTimeZone + * javax.baja.util.LexiconText + * javax.baja.util.Version + */ +package com.tridium.fox.sys; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxAuthenticationException; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.sys.BFoxClientConnection; +import com.tridium.fox.sys.BFoxScheme; +import com.tridium.fox.sys.BFoxsScheme; +import com.tridium.fox.sys.BIFoxProxySpace; +import com.tridium.fox.sys.BSysChannel; +import com.tridium.fox.sys.FatalAuthenticationException; +import com.tridium.fox.sys.LocalizableExceptionTranslator; +import com.tridium.fox.sys.LocalizableServerException; +import com.tridium.fox.sys.ModuleNotFoundLocalException; +import com.tridium.fox.sys.ModuleNotFoundRemoteException; +import com.tridium.fox.sys.broker.BBrokerChannel; +import com.tridium.util.ArrayUtil; +import com.tridium.util.BSessionInfo; +import com.tridium.util.IFoxSession; +import java.lang.reflect.Method; +import java.net.Socket; +import java.util.ArrayList; +import java.util.HashMap; +import javax.baja.agent.AgentList; +import javax.baja.data.BIDataValue; +import javax.baja.file.BIFile; +import javax.baja.fox.BFoxProxySession; +import javax.baja.naming.BHost; +import javax.baja.naming.BOrd; +import javax.baja.naming.BServiceScheme; +import javax.baja.naming.OrdQuery; +import javax.baja.naming.SlotPath; +import javax.baja.nav.BINavNode; +import javax.baja.nav.BNavFileSpace; +import javax.baja.nav.NavFileDecoder; +import javax.baja.registry.TypeInfo; +import javax.baja.security.AuthenticationException; +import javax.baja.security.AuthenticationRealm; +import javax.baja.security.BICredentials; +import javax.baja.security.BIUserCredentials; +import javax.baja.security.BPassword; +import javax.baja.security.BUsernameAndPassword; +import javax.baja.space.BSpace; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BIcon; +import javax.baja.sys.BObject; +import javax.baja.sys.BRelTime; +import javax.baja.sys.BString; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.Context; +import javax.baja.sys.ModuleNotFoundException; +import javax.baja.sys.ServiceNotFoundException; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.timezone.BTimeZone; +import javax.baja.util.LexiconText; +import javax.baja.util.Version; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxSession +extends BFoxProxySession +implements AuthenticationRealm, +BServiceScheme.ServiceSession, +IFoxSession, +BFoxClientConnection.Interest { + public static final Type TYPE; + private static final BIcon iconConnected; + private static final BIcon iconDisconnected; + private static final BIcon tunnelIconConnected; + private static final BIcon tunnelIconDisconnected; + private static final BIcon secureBadgeConnected; + private static final BIcon secureBadgeDisconnected; + String[] tunnelAuthorities; + private final BHost host; + private boolean useFoxs; + private int port; + private final BFoxClientConnection connection; + private boolean connected; + private BOrd absOrd; + private BOrd ordInHost; + private String stationName; + private BIUserCredentials credentials; + private String authenticationScheme; + private Context sessionContext; + String stationFault; + public Object uiCache; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxSession; + static /* synthetic */ Class class$java$lang$String; + static /* synthetic */ Class class$javax$baja$sys$BAbsTime; + static /* synthetic */ Class class$java$net$Socket; + + public Type getType() { + return TYPE; + } + + public static BFoxSession[] list() { + ArrayList arrayList = new ArrayList(); + BHost[] bHostArray = BHost.getAllHosts(); + int n = 0; + while (n < bHostArray.length) { + BHost bHost = bHostArray[n]; + BINavNode[] bINavNodeArray = bHost.getNavChildren(); + int n2 = 0; + while (n2 < bINavNodeArray.length) { + if (bINavNodeArray[n2] instanceof BFoxSession) { + arrayList.add(bINavNodeArray[n2]); + } + ++n2; + } + ++n; + } + return arrayList.toArray(new BFoxSession[arrayList.size()]); + } + + public static BFoxSession make(BHost bHost, int n) { + return BFoxSession.make(null, bHost, n, false); + } + + public static BFoxSession make(BHost bHost, int n, boolean bl) { + return BFoxSession.make(null, bHost, n, bl); + } + + public static BFoxSession make(String string, BHost bHost, int n, boolean bl) { + return BFoxSession.make(string, bHost, n, bl, null); + } + + public static BFoxSession make(String string, BHost bHost, int n, boolean bl, String string2) { + String[] stringArray = null; + if (string2 != null) { + stringArray = new String[]{string2}; + } + return BFoxSession.make(string, bHost, n, bl, stringArray); + } + + public static BFoxSession make(String string, BHost bHost, int n, boolean bl, String[] stringArray) { + String string2 = BFoxSession.buildNavName(n, bl, stringArray); + BFoxSession bFoxSession = (BFoxSession)bHost.getNavChild(string2); + if (bFoxSession == null) { + bFoxSession = new BFoxSession(string2, string, bHost, n, bl, stringArray); + bHost.addNavChild((BINavNode)bFoxSession); + } + return bFoxSession; + } + + protected static String buildNavName(int n, boolean bl, String[] stringArray) { + int n2; + String string = bl ? "foxs" : "fox"; + int n3 = n2 = bl ? 4911 : 1911; + if (n != n2) { + string = string + ':' + n; + } + if (stringArray != null) { + int n4 = 0; + while (n4 < stringArray.length) { + if (stringArray[n4] != null) { + string = string + '/' + stringArray[n4]; + } + ++n4; + } + } + return string; + } + + public BHost getHost() { + return this.host; + } + + public int getPort() { + return this.port; + } + + public void setPort(int n) { + this.port = n; + } + + public boolean getUseFoxs() { + return this.useFoxs; + } + + public void setUseFoxs(boolean bl) { + this.useFoxs = bl; + } + + public String[] getTunnelAuthorities() { + return this.tunnelAuthorities; + } + + public BFoxClientConnection getConnection() { + return this.connection; + } + + public String getStationName() { + return this.stationName; + } + + public BSessionInfo getSessionInfo() { + BSessionInfo bSessionInfo; + FoxSession foxSession = this.connection.session(); + BAbsTime bAbsTime = BAbsTime.make((long)foxSession.getConnectTime()); + Type type = BSessionInfo.TYPE; + if (this.useFoxs) { + type = Sys.getType((String)"platCrypto:SslSessionInfo"); + } + Class clazz = type.getTypeClass(); + String string = null; + if (this.getCredentials() instanceof BIUserCredentials) { + string = ((BIUserCredentials)this.getCredentials()).getUsername(); + } + try { + Class clazz2; + Class clazz3; + Class clazz4; + Class[] classArray = new Class[4]; + Class clazz5 = class$java$lang$String; + if (clazz5 == null) { + clazz5 = classArray[0] = (class$java$lang$String = BFoxSession.class("[Ljava.lang.String;", false)); + } + if ((clazz4 = class$javax$baja$sys$BAbsTime) == null) { + clazz4 = classArray[1] = (class$javax$baja$sys$BAbsTime = BFoxSession.class("[Ljavax.baja.sys.BAbsTime;", false)); + } + if ((clazz3 = class$java$net$Socket) == null) { + clazz3 = classArray[2] = (class$java$net$Socket = BFoxSession.class("[Ljava.net.Socket;", false)); + } + if ((clazz2 = class$java$lang$String) == null) { + clazz2 = class$java$lang$String = BFoxSession.class("[Ljava.lang.String;", false); + } + classArray[3] = clazz2; + Method method = clazz.getMethod("make", classArray); + Socket socket = foxSession.getSocket(); + bSessionInfo = (BSessionInfo)method.invoke(null, this.stationName, bAbsTime, socket, string); + } + catch (Exception exception) { + exception.printStackTrace(); + bSessionInfo = null; + } + return bSessionInfo; + } + + public boolean isConnected() { + return this.connected; + } + + public synchronized void connect() throws Exception { + if (this.connected) { + return; + } + if (this.credentials == null) { + this.credentials = new BUsernameAndPassword(); + } + this.connection.setCredentials((BICredentials)this.credentials); + this.connection.setUsername(this.credentials.getUsername()); + try { + this.connection.connect(); + BOrd bOrd = null; + if (this.tunnelAuthorities != null) { + this.setLexiconText(LexiconText.make((String)"fox", (String)"nav.foxTunnelSession")); + bOrd = this.useFoxs ? BOrd.make((OrdQuery)new BFoxsScheme.FoxQuery(this.port, this.tunnelAuthorities)) : BOrd.make((OrdQuery)new BFoxScheme.FoxQuery(this.port, this.tunnelAuthorities)); + } else { + bOrd = this.useFoxs ? BOrd.make((OrdQuery)new BFoxsScheme.FoxQuery(this.port)) : BOrd.make((OrdQuery)new BFoxScheme.FoxQuery(this.port)); + } + if (!bOrd.equivalent((Object)this.ordInHost)) { + this.ordInHost = bOrd; + this.absOrd = BOrd.make((BOrd)this.host.getAbsoluteOrd(), (BOrd)this.ordInHost); + } + if (!this.connection.hasInterests()) { + this.connection.engageNoRetry(this, 0L); + } + } + catch (FoxAuthenticationException foxAuthenticationException) { + if (foxAuthenticationException.fatal != null) { + throw new FatalAuthenticationException(foxAuthenticationException.fatal); + } + this.authenticationScheme = foxAuthenticationException.method == null ? "Fox" : "Fox (" + foxAuthenticationException.method + ')'; + throw new AuthenticationException((AuthenticationRealm)this, (Throwable)foxAuthenticationException); + } + } + + void postConnect() throws Exception { + FoxMessage foxMessage = this.connection.session().getRemoteHello(); + this.stationName = null; + try { + this.stationName = foxMessage.getString("station.name"); + } + catch (Exception exception) {} + this.connection.getChannels().getUserChannel().fetchPrefs(); + this.connection.getChannels().getSysChannel().subscribeNavEvents(); + this.loadSubSpaces(); + this.loadNavFileSpace(); + BTimeZone bTimeZone = BTimeZone.getLocal(); + try { + bTimeZone = (BTimeZone)BTimeZone.DEFAULT.decodeFromString(foxMessage.getString("timeZone")); + } + catch (Exception exception) {} + this.sessionContext = BFacets.make((String)"TimeZone", (BIDataValue)bTimeZone, (String)"username", (BIDataValue)BString.make((String)this.getUsername())); + this.connected = true; + } + + public void disconnect() { + this.connection.disengage(this); + this.connection.close(); + } + + public void close() { + this.disconnect(); + this.host.removeNavChild((BINavNode)this); + } + + public String getStationFault() { + return this.stationFault; + } + + public Context getSessionContext() { + return this.sessionContext; + } + + public String getUsername() { + return this.connection.getUsername(); + } + + public BAbsTime getLastFailureTime() { + return this.connection.getLastFailureTime(); + } + + public String getLastFailureCause() { + return this.connection.getLastFailureCause(); + } + + public BRelTime getRetryPeriod() { + return this.connection.getRetryPeriod(); + } + + public void setRetryPeriod(BRelTime bRelTime) { + this.connection.setRetryPeriod(bRelTime); + } + + public BAbsTime getNextAttemptTime() { + return this.connection.getNextAttemptTime(); + } + + public boolean isEngaged(String string) { + return this.connection.isEngaged(this.toInterest(string)); + } + + public void engageNoRetry(String string) throws Exception { + this.connection.engageNoRetry(this.toInterest(string)); + } + + public void engageNoRetry(String string, long l) throws Exception { + this.connection.engageNoRetry(this.toInterest(string), l); + } + + public void engageRetry(String string) throws Exception { + this.connection.engageRetry(this.toInterest(string)); + } + + public void disengage(String string) { + this.connection.disengage(this.toInterest(string)); + } + + private final BFoxClientConnection.Interest toInterest(String string) { + return new BFoxClientConnection.StringInterest(string); + } + + synchronized void sessionOpened() { + } + + synchronized void sessionClosed() { + this.connected = false; + this.stationFault = null; + this.unloadSubSpaces(); + this.credentials = null; + this.connection.setUsername(""); + this.connection.setPassword(BPassword.DEFAULT); + } + + public String getAuthenticationRealmName() { + return this.absOrd.toString(); + } + + public String getAuthenticationScheme() { + return this.authenticationScheme; + } + + public BICredentials makeCredentials() { + return new BUsernameAndPassword(); + } + + public BICredentials getCredentials() { + return this.credentials; + } + + public void setCredentials(BICredentials bICredentials) { + if (!(bICredentials instanceof BIUserCredentials)) { + throw new IllegalArgumentException(); + } + this.credentials = (BIUserCredentials)bICredentials; + } + + public void loadSubSpaces() { + try { + BSysChannel bSysChannel = this.getConnection().getChannels().getSysChannel(); + HashMap hashMap = bSysChannel.listLocalSpaces(); + TypeInfo[] typeInfoArray = Sys.getRegistry().getTypes(BIFoxProxySpace.TYPE.getTypeInfo()); + int n = 0; + while (n < typeInfoArray.length) { + TypeInfo typeInfo = typeInfoArray[n]; + if (!typeInfo.isInterface() && !typeInfo.isAbstract()) { + try { + BSpace bSpace = (BSpace)typeInfoArray[n].getInstance(); + if (hashMap.containsKey(bSpace.getNavName()) && this.getNavChild(bSpace.getNavName()) == null) { + ((BIFoxProxySpace)bSpace).init(this); + this.addNavChild((BINavNode)bSpace); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + ++n; + } + } + catch (LocalizableServerException localizableServerException) { + if (localizableServerException.getLexiconModule().equals("fox") && localizableServerException.getLexiconKey().equals("error.NoPermissionForStation")) { + throw localizableServerException; + } + localizableServerException.printStackTrace(); + } + catch (Throwable throwable) { + throwable.printStackTrace(); + } + } + + public void loadNavFileSpace() { + BOrd bOrd = null; + try { + Object[] objectArray = this.getNavChildren(); + int n = 0; + while (n < objectArray.length) { + if (objectArray[n] instanceof BNavFileSpace) { + this.removeNavChild(objectArray[n]); + break; + } + ++n; + } + bOrd = this.connection.getChannels().getUserChannel().getNavFile(); + if (bOrd.isNull()) { + return; + } + BIFile bIFile = (BIFile)bOrd.get((BObject)this); + BNavFileSpace bNavFileSpace = new NavFileDecoder(bIFile).decodeDocument(); + this.addNavChild((BINavNode)bNavFileSpace); + objectArray = this.getNavChildren(); + objectArray = (BINavNode[])ArrayUtil.toTop((Object[])objectArray, (int)(objectArray.length - 1)); + this.reorderNavChildren((BINavNode[])objectArray); + } + catch (Throwable throwable) { + System.out.println("ERROR: Cannot load nav file \"" + bOrd + "\": " + throwable); + } + } + + public void unloadSubSpaces() { + try { + BINavNode[] bINavNodeArray = this.getNavChildren(); + int n = 0; + while (n < bINavNodeArray.length) { + try { + BINavNode bINavNode = bINavNodeArray[n]; + if (bINavNode instanceof BIFoxProxySpace) { + BIFoxProxySpace bIFoxProxySpace = (BIFoxProxySpace)bINavNode; + bIFoxProxySpace.cleanup(this); + } + this.removeNavChild(bINavNode); + } + catch (Exception exception) { + exception.printStackTrace(); + } + ++n; + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + public BOrd getAbsoluteOrd() { + return this.absOrd; + } + + public BOrd getOrdInHost() { + return this.ordInHost; + } + + public String getNavDisplayName(Context context) { + String string = super.getNavDisplayName(context); + if (!this.useFoxs) { + if (this.connection.getPort() != 1911) { + string = string + ':' + this.connection.getPort(); + } + } else if (this.connection.getPort() != 4911) { + string = string + ':' + this.connection.getPort(); + } + if (this.stationName != null) { + string = string + " (" + this.stationName + ')'; + return string; + } + return string; + } + + public BOrd getNavOrd() { + return this.absOrd; + } + + public BComponent getService(Type type) { + try { + BBrokerChannel bBrokerChannel = (BBrokerChannel)this.connection.getChannels().get("station", BBrokerChannel.TYPE); + SlotPath slotPath = bBrokerChannel.serviceToPath(type.toString()); + BOrd bOrd = BOrd.make((String)("station:|" + slotPath)); + return (BComponent)bOrd.get((BObject)this); + } + catch (Exception exception) { + throw new ServiceNotFoundException(type.toString(), (Throwable)exception); + } + } + + public AgentList getAgents(Context context) { + AgentList agentList = super.getAgents(context); + if (this.tunnelAuthorities != null) { + agentList.toTop("workbench:FoxTunnelSessionAgent"); + } else { + agentList.toTop("workbench:FoxSessionAgent"); + } + agentList.toTop("workbench:StationSummary"); + agentList.remove("workbench:NavContainerView"); + return agentList; + } + + public BIcon getIcon() { + BIcon bIcon = null; + if (this.isConnected()) { + BIcon bIcon2 = bIcon = this.tunnelAuthorities == null ? iconConnected : tunnelIconConnected; + if (this.useFoxs) { + return BIcon.make((BIcon)bIcon, (BIcon)secureBadgeConnected); + } + } else { + BIcon bIcon3 = bIcon = this.tunnelAuthorities == null ? iconDisconnected : tunnelIconDisconnected; + if (this.useFoxs) { + return BIcon.make((BIcon)bIcon, (BIcon)secureBadgeDisconnected); + } + } + return bIcon; + } + + public static RuntimeException toException(Throwable throwable) { + if (throwable instanceof ModuleNotFoundLocalException) { + return (RuntimeException)throwable; + } + if (throwable instanceof ModuleNotFoundRemoteException) { + return (RuntimeException)throwable; + } + ModuleNotFoundException moduleNotFoundException = LocalizableExceptionTranslator.getModuleNotFoundException(throwable); + if (moduleNotFoundException != null) { + return new ModuleNotFoundLocalException(moduleNotFoundException.getModuleName(), throwable); + } + if (throwable instanceof RuntimeException) { + return (RuntimeException)throwable; + } + return new BajaRuntimeException(throwable); + } + + public final Object fw(int n, Object object, Object object2, Object object3, Object object4) { + boolean bl = false; + switch (n) { + case 805: + case 806: { + bl = true; + } + case 801: + case 802: { + String string = (String)object; + BHost bHost = (BHost)object2; + String string2 = bl ? "fwFoxs-" + bHost.getHostname() : "fwFox-" + bHost.getHostname(); + int n2 = bl ? 4911 : 1911; + int n3 = object3 != null ? (Integer)object3 : n2; + String[] stringArray = (String[])object4; + if (n3 != n2) { + string2 = string2 + ':' + n3; + } + if (stringArray != null) { + int n4 = 0; + while (n4 < stringArray.length) { + if (stringArray[n4] != null) { + string2 = string2 + '/' + stringArray[n4]; + } + ++n4; + } + } + BFoxSession bFoxSession = new BFoxSession(string2, string, bHost, n3, bl, stringArray); + Integer n5 = n == 801 || n == 805 ? FoxSession.FW_FOX_SESSION : FoxSession.FW_STATION_FOX_SESSION; + bFoxSession.connection.fw(803, n5, null, null, null); + return bFoxSession; + } + case 404: { + if (object == null || ((String)object).equalsIgnoreCase("baja")) { + return this.getConnection().getRemoteVersion(); + } + if (this.getConnection().getRemoteVersion().compareTo((Object)new Version(new int[]{3, 6, 13})) != -1) { + BSysChannel bSysChannel = this.getConnection().getChannels().getSysChannel(); + try { + byte[] byArray = bSysChannel.stationCall("module.version", ((String)object).getBytes()); + return new Version(new String(byArray)); + } + catch (Exception exception) { + return null; + } + } + return null; + } + } + return super.fw(n, object, object2, object3, object4); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.tunnelAuthorities = null; + this.authenticationScheme = "Fox"; + this.uiCache = null; + } + + private BFoxSession(String string, String string2, BHost bHost, int n, boolean bl, String[] stringArray) { + super(string); + this.this(); + this.stationName = string2; + this.host = bHost; + this.port = n; + this.useFoxs = bl; + this.tunnelAuthorities = stringArray; + if (stringArray != null) { + this.setLexiconText(LexiconText.make((String)"fox", (String)"nav.foxTunnelSession")); + this.ordInHost = bl ? BOrd.make((OrdQuery)new BFoxsScheme.FoxQuery(n, stringArray)) : BOrd.make((OrdQuery)new BFoxScheme.FoxQuery(n, stringArray)); + } else { + this.ordInHost = bl ? BOrd.make((OrdQuery)new BFoxsScheme.FoxQuery(n)) : BOrd.make((OrdQuery)new BFoxScheme.FoxQuery(n)); + } + this.absOrd = BOrd.make((BOrd)bHost.getAbsoluteOrd(), (BOrd)this.ordInHost); + this.connection = new BFoxClientConnection(this); + if (Fox.appVersion == "unknown") { + try { + Fox.appVersion = "" + Sys.getBajaModule().getVendorVersion(); + } + catch (Exception exception) {} + try { + Fox.hostName = Sys.getLocalHost().getHostName(); + } + catch (Exception exception) {} + try { + Fox.hostAddress = Sys.getLocalHost().getHostAddress(); + } + catch (Exception exception) {} + } + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxSession; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxSession = BFoxSession.class("[Lcom.tridium.fox.sys.BFoxSession;", false); + } + TYPE = Sys.loadType((Class)clazz); + iconConnected = BIcon.std((String)"fox.png"); + iconDisconnected = BIcon.std((String)"foxDisconnected.png"); + tunnelIconConnected = BIcon.std((String)"foxTunnel.png"); + tunnelIconDisconnected = BIcon.std((String)"foxTunnelDisconnected.png"); + secureBadgeConnected = BIcon.std((String)"badges/lock.png"); + secureBadgeDisconnected = BIcon.std((String)"badges/lockDisconnected.png"); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxTunnelServerConnection.java b/modules/cfr_output/com/tridium/fox/sys/BFoxTunnelServerConnection.java new file mode 100644 index 0000000..875aaf6 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxTunnelServerConnection.java @@ -0,0 +1,144 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.io.net.IClientSocketFactory + * javax.baja.naming.BHost + * javax.baja.naming.BIpHost + * javax.baja.security.crypto.BTlsEnum + * javax.baja.security.crypto.CertManagerFactory + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.Clock + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxCircuit; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.sys.Acceptor; +import com.tridium.fox.sys.BFoxConnection; +import com.tridium.fox.sys.BFoxScheme; +import com.tridium.fox.sys.BFoxService; +import com.tridium.fox.sys.BFoxsScheme; +import com.tridium.fox.sys.NiagaraNetwork; +import com.tridium.fox.sys.NiagaraStation; +import java.net.Socket; +import javax.baja.io.net.IClientSocketFactory; +import javax.baja.naming.BHost; +import javax.baja.naming.BIpHost; +import javax.baja.security.crypto.BTlsEnum; +import javax.baja.security.crypto.CertManagerFactory; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.Clock; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxTunnelServerConnection +extends BFoxConnection { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxTunnelServerConnection; + + public Type getType() { + return TYPE; + } + + public void initHello(FoxMessage foxMessage) throws Exception { + } + + public final void sessionOpened(FoxSession foxSession) { + Acceptor.acceptTunnel(this); + this.log.opened(foxSession); + this.setState("Connected Tunnel [" + foxSession.getId() + ']'); + this.setLastConnectTime(Clock.time()); + } + + public FoxResponse process(FoxRequest foxRequest) throws Throwable { + return null; + } + + public void circuitOpened(FoxCircuit foxCircuit) throws Throwable { + } + + public void sessionClosed(FoxSession foxSession, Throwable throwable) { + this.log.closed(foxSession, throwable); + this.setState("Not connected"); + this.setLastDisconnectTime(Clock.time()); + this.setLastDisconnectCause(throwable == null ? "" : throwable.toString()); + } + + public final boolean isTunnelServerConnection() { + return true; + } + + /* + * Enabled force condition propagation + * Lifted jumps to return sites + */ + public Socket createTunnelSocket(String string, boolean bl) throws Exception { + NiagaraStation niagaraStation; + NiagaraNetwork niagaraNetwork; + boolean bl2 = bl; + String string2 = BFoxScheme.parseHost(string); + int n = bl2 ? BFoxsScheme.parsePort(string) : BFoxScheme.parsePort(string); + BHost bHost = null; + if (Fox.onlyTunnelKnownStations || this.fwConnectionType != -1) { + niagaraNetwork = BFoxService.getNiagaraNetwork(); + if (niagaraNetwork == null) { + throw new BajaRuntimeException("NiagaraNetwork not found. Cannot create tunnel socket to " + string); + } + niagaraStation = niagaraNetwork.getStation(string2); + if (niagaraStation == null) { + if (this.fwConnectionType == -1) throw new BajaRuntimeException("NiagaraStation '" + string2 + "' not found. Cannot create tunnel socket to " + string); + bHost = BHost.getHost((String)string2); + if (bHost == null) { + bHost = new BIpHost(string2); + } + } else { + bHost = niagaraStation.getRemoteHost(); + n = niagaraStation.getFoxPort(); + String string3 = niagaraStation.getScheme(); + bl2 = string3.equalsIgnoreCase("foxs"); + } + } else { + bHost = BHost.getHost((String)string2); + if (bHost == null) { + bHost = new BIpHost(string2); + BHost.mount((BHost)bHost); + } + } + if (!bl2) return bHost.openSocket(n); + niagaraNetwork = CertManagerFactory.getInstanceEx(); + niagaraStation = niagaraNetwork.getClientSocketFactory(BTlsEnum.DEFAULT.getTag()); + return bHost.openSocket(n, (IClientSocketFactory)niagaraStation); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxTunnelServerConnection; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxTunnelServerConnection = BFoxTunnelServerConnection.class("[Lcom.tridium.fox.sys.BFoxTunnelServerConnection;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxUsernamePasswordAuthAgent.java b/modules/cfr_output/com/tridium/fox/sys/BFoxUsernamePasswordAuthAgent.java new file mode 100644 index 0000000..4edf6d6 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxUsernamePasswordAuthAgent.java @@ -0,0 +1,71 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.user.AuthenticateUtil + * javax.baja.user.BUser + * javax.baja.user.BUserService + */ +package com.tridium.fox.sys; + +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.sys.BFoxDefaultAuthAgent; +import com.tridium.fox.sys.BIFoxAuthAgent; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.user.AuthenticateUtil; +import javax.baja.user.BUser; +import javax.baja.user.BUserService; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxUsernamePasswordAuthAgent +extends BFoxDefaultAuthAgent +implements BIFoxAuthAgent { + public static final BFoxUsernamePasswordAuthAgent INSTANCE = new BFoxUsernamePasswordAuthAgent(); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxUsernamePasswordAuthAgent; + + public Type getType() { + return TYPE; + } + + protected boolean authenticateBasic(FoxSession foxSession) throws Exception { + return super.authenticateBasic(foxSession); + } + + protected boolean authenticateDigest(FoxSession foxSession) throws Exception { + return super.authenticateDigest(foxSession); + } + + protected BUser authenticateUser(BUserService bUserService, String string, String string2, Context context) { + return AuthenticateUtil.authenticateUsernameAndPassword((String)string, (String)string2, (BUserService)bUserService, (Context)context); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxUsernamePasswordAuthAgent; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxUsernamePasswordAuthAgent = BFoxUsernamePasswordAuthAgent.class("[Lcom.tridium.fox.sys.BFoxUsernamePasswordAuthAgent;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BFoxsScheme.java b/modules/cfr_output/com/tridium/fox/sys/BFoxsScheme.java new file mode 100644 index 0000000..d91237f --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BFoxsScheme.java @@ -0,0 +1,238 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.net.HttpUtil + * javax.baja.naming.BHost + * javax.baja.naming.BIpHost + * javax.baja.naming.BStationSessionScheme + * javax.baja.naming.OrdQuery + * javax.baja.naming.OrdQueryList + * javax.baja.naming.OrdTarget + * javax.baja.naming.SyntaxException + * javax.baja.naming.UnresolvedException + * javax.baja.nre.util.TextUtil + * javax.baja.security.AuthenticationException + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys; + +import com.tridium.fox.sys.BFoxSession; +import com.tridium.fox.sys.LocalizableServerException; +import com.tridium.net.HttpUtil; +import javax.baja.naming.BHost; +import javax.baja.naming.BIpHost; +import javax.baja.naming.BStationSessionScheme; +import javax.baja.naming.OrdQuery; +import javax.baja.naming.OrdQueryList; +import javax.baja.naming.OrdTarget; +import javax.baja.naming.SyntaxException; +import javax.baja.naming.UnresolvedException; +import javax.baja.nre.util.TextUtil; +import javax.baja.security.AuthenticationException; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxsScheme +extends BStationSessionScheme { + public static final int DEFAULT_PORT = 4911; + public static final String SCHEME_NAME = "foxs"; + public static final BFoxsScheme INSTANCE = new BFoxsScheme(); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$fox$sys$BFoxsScheme; + + public OrdQuery parse(String string) { + return new FoxQuery(string); + } + + public OrdTarget resolve(OrdTarget ordTarget, OrdQuery ordQuery) throws SyntaxException, UnresolvedException { + String string; + BHost bHost; + BHost bHost2 = null; + BObject bObject = ordTarget.get(); + bHost2 = bObject instanceof BHost ? (BHost)bObject : ((BComponent)bObject).getHost(); + FoxQuery foxQuery = (FoxQuery)ordQuery; + int n = foxQuery.port; + String[] stringArray = foxQuery.tunnelAuthorities; + BFoxSession bFoxSession = BFoxSession.make(null, bHost2, n, true, stringArray); + if (Sys.isStationStarted() && stringArray != null && stringArray.length > 0 && (bHost = BHost.getHost((String)(string = BFoxsScheme.parseHost(stringArray[stringArray.length - 1])))) == null) { + bHost = new BIpHost(string); + BHost.mount((BHost)bHost); + } + try { + bFoxSession.connect(); + return new OrdTarget(ordTarget, (BObject)bFoxSession); + } + catch (LocalizableServerException localizableServerException) { + if (localizableServerException.getLexiconModule().equals("fox") && localizableServerException.getLexiconKey().equals("error.NoPermissionForStation")) { + bFoxSession.disconnect(); + } + throw localizableServerException; + } + catch (AuthenticationException authenticationException) { + throw authenticationException; + } + catch (Throwable throwable) { + throw new UnresolvedException(ordQuery.toString(), throwable); + } + } + + public int getDefaultPort() { + return 4911; + } + + static String parseHost(String string) { + return HttpUtil.parseHost((String)string); + } + + static int parsePort(String string) { + return HttpUtil.parsePort((String)string, (int)4911); + } + + static String[] validateAuthorities(String[] stringArray) { + if (stringArray == null) { + return null; + } + int n = stringArray.length; + if (n < 1) { + return null; + } + String[] stringArray2 = new String[n]; + int n2 = 0; + int n3 = 0; + while (n3 < n) { + if (stringArray[n3] != null && !stringArray[n3].equals("")) { + stringArray2[n2] = stringArray[n3]; + ++n2; + } + ++n3; + } + String[] stringArray3 = new String[n2]; + System.arraycopy(stringArray2, 0, stringArray3, 0, n2); + return stringArray3; + } + + public Type getType() { + return TYPE; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private BFoxsScheme() { + super(SCHEME_NAME); + } + + static { + Class clazz = class$com$tridium$fox$sys$BFoxsScheme; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BFoxsScheme = BFoxsScheme.class("[Lcom.tridium.fox.sys.BFoxsScheme;", false); + } + TYPE = Sys.loadType((Class)clazz); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public static class FoxQuery + implements OrdQuery { + int port; + String[] tunnelAuthorities; + + public boolean isHost() { + return false; + } + + public boolean isSession() { + return true; + } + + public void normalize(OrdQueryList ordQueryList, int n) { + ordQueryList.shiftToHost(n); + } + + public String getScheme() { + return BFoxsScheme.SCHEME_NAME; + } + + public String getBody() { + StringBuffer stringBuffer = new StringBuffer(); + if (this.port != 4911) { + stringBuffer.append(String.valueOf(this.port)); + } + if (this.tunnelAuthorities != null) { + int n = 0; + while (n < this.tunnelAuthorities.length) { + if (this.tunnelAuthorities[n] != null && !this.tunnelAuthorities[n].equals("")) { + stringBuffer.append("/").append(this.tunnelAuthorities[n]); + } + ++n; + } + } + return stringBuffer.toString(); + } + + public String toString() { + return "foxs:" + this.getBody(); + } + + public int getPort() { + return this.port; + } + + public String[] getTunnelAuthorities() { + return this.tunnelAuthorities; + } + + private final /* synthetic */ void this() { + this.tunnelAuthorities = null; + } + + FoxQuery(String string) { + this.this(); + string = string.trim(); + if (string.length() == 0) { + this.port = 4911; + } else { + int n = string.indexOf(47); + if (n >= 0) { + this.port = n == 0 ? 4911 : Integer.parseInt(string.substring(0, n)); + string = string.substring(n); + this.tunnelAuthorities = BFoxsScheme.validateAuthorities(TextUtil.splitAndTrim((String)string, (char)'/')); + } else { + this.port = Integer.parseInt(string); + } + } + } + + FoxQuery(int n) { + this.this(); + this.port = n; + } + + FoxQuery(int n, String[] stringArray) { + this.this(); + this.port = n; + this.tunnelAuthorities = BFoxsScheme.validateAuthorities(stringArray); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BIFoxAuthAgent.java b/modules/cfr_output/com/tridium/fox/sys/BIFoxAuthAgent.java new file mode 100644 index 0000000..f08cd0a --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BIFoxAuthAgent.java @@ -0,0 +1,31 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BInterface + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys; + +import com.tridium.fox.session.FoxServer; +import com.tridium.fox.session.FoxSession; +import javax.baja.sys.BInterface; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public interface BIFoxAuthAgent +extends BInterface { + public static final Type TYPE; + + public boolean authenticate(FoxSession var1, FoxServer var2) throws Exception; + + static { + Class clazz = 1.class$com$tridium$fox$sys$BIFoxAuthAgent; + if (clazz == null) { + clazz = 1.class$com$tridium$fox$sys$BIFoxAuthAgent = 1.class("[Lcom.tridium.fox.sys.BIFoxAuthAgent;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BIFoxGatewayProxyFactory.java b/modules/cfr_output/com/tridium/fox/sys/BIFoxGatewayProxyFactory.java new file mode 100644 index 0000000..104008c --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BIFoxGatewayProxyFactory.java @@ -0,0 +1,33 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.space.BGateway + * javax.baja.agent.BIAgent + * javax.baja.space.BSpace + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys; + +import com.tridium.space.BGateway; +import javax.baja.agent.BIAgent; +import javax.baja.space.BSpace; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public interface BIFoxGatewayProxyFactory +extends BIAgent { + public static final Type TYPE; + + public BSpace makeFoxGatewayProxySpace(BGateway var1); + + static { + Class clazz = 1.class$com$tridium$fox$sys$BIFoxGatewayProxyFactory; + if (clazz == null) { + clazz = 1.class$com$tridium$fox$sys$BIFoxGatewayProxyFactory = 1.class("[Lcom.tridium.fox.sys.BIFoxGatewayProxyFactory;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BIFoxProxySpace.java b/modules/cfr_output/com/tridium/fox/sys/BIFoxProxySpace.java new file mode 100644 index 0000000..f84c11c --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BIFoxProxySpace.java @@ -0,0 +1,32 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nav.BINavNode + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys; + +import com.tridium.fox.sys.BFoxSession; +import javax.baja.nav.BINavNode; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public interface BIFoxProxySpace +extends BINavNode { + public static final Type TYPE; + + public void init(BFoxSession var1) throws Exception; + + public void cleanup(BFoxSession var1) throws Exception; + + static { + Class clazz = 1.class$com$tridium$fox$sys$BIFoxProxySpace; + if (clazz == null) { + clazz = 1.class$com$tridium$fox$sys$BIFoxProxySpace = 1.class("[Lcom.tridium.fox.sys.BIFoxProxySpace;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BLearnStation.java b/modules/cfr_output/com/tridium/fox/sys/BLearnStation.java new file mode 100644 index 0000000..5f569d4 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BLearnStation.java @@ -0,0 +1,242 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nre.util.Array + * javax.baja.sys.BStruct + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.MulticastUtil; +import javax.baja.nre.util.Array; +import javax.baja.sys.BStruct; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BLearnStation +extends BStruct { + public static final Property stationName = BLearnStation.newProperty((int)8, (String)"", null); + public static final Property scheme = BLearnStation.newProperty((int)8, (String)"fox", null); + public static final Property address = BLearnStation.newProperty((int)8, (String)"", null); + public static final Property hostName = BLearnStation.newProperty((int)0, (String)"", null); + public static final Property hostAddress = BLearnStation.newProperty((int)0, (String)"", null); + public static final Property foxPort = BLearnStation.newProperty((int)0, (int)0, null); + public static final Property version = BLearnStation.newProperty((int)8, (String)"", null); + public static final Property hostModel = BLearnStation.newProperty((int)8, (String)"", null); + public static final Property hostId = BLearnStation.newProperty((int)0, (String)"", null); + public static final Property vmName = BLearnStation.newProperty((int)0, (String)"", null); + public static final Property vmVersion = BLearnStation.newProperty((int)0, (String)"", null); + public static final Property osName = BLearnStation.newProperty((int)0, (String)"", null); + public static final Property osVersion = BLearnStation.newProperty((int)0, (String)"", null); + public static final Type TYPE; + private String key; + static /* synthetic */ Class class$com$tridium$fox$sys$BLearnStation; + + public String getStationName() { + return this.getString(stationName); + } + + public void setStationName(String string) { + this.setString(stationName, string, null); + } + + public String getScheme() { + return this.getString(scheme); + } + + public void setScheme(String string) { + this.setString(scheme, string, null); + } + + public String getAddress() { + return this.getString(address); + } + + public void setAddress(String string) { + this.setString(address, string, null); + } + + public String getHostName() { + return this.getString(hostName); + } + + public void setHostName(String string) { + this.setString(hostName, string, null); + } + + public String getHostAddress() { + return this.getString(hostAddress); + } + + public void setHostAddress(String string) { + this.setString(hostAddress, string, null); + } + + public int getFoxPort() { + return this.getInt(foxPort); + } + + public void setFoxPort(int n) { + this.setInt(foxPort, n, null); + } + + public String getVersion() { + return this.getString(version); + } + + public void setVersion(String string) { + this.setString(version, string, null); + } + + public String getHostModel() { + return this.getString(hostModel); + } + + public void setHostModel(String string) { + this.setString(hostModel, string, null); + } + + public String getHostId() { + return this.getString(hostId); + } + + public void setHostId(String string) { + this.setString(hostId, string, null); + } + + public String getVmName() { + return this.getString(vmName); + } + + public void setVmName(String string) { + this.setString(vmName, string, null); + } + + public String getVmVersion() { + return this.getString(vmVersion); + } + + public void setVmVersion(String string) { + this.setString(vmVersion, string, null); + } + + public String getOsName() { + return this.getString(osName); + } + + public void setOsName(String string) { + this.setString(osName, string, null); + } + + public String getOsVersion() { + return this.getString(osVersion); + } + + public void setOsVersion(String string) { + this.setString(osVersion, string, null); + } + + public Type getType() { + return TYPE; + } + + public static BLearnStation[] make(FoxMessage foxMessage) throws Exception { + BLearnStation bLearnStation; + Class clazz = class$com$tridium$fox$sys$BLearnStation; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BLearnStation = BLearnStation.class("[Lcom.tridium.fox.sys.BLearnStation;", false); + } + Array array = new Array(clazz); + BLearnStation bLearnStation2 = new BLearnStation(); + bLearnStation2.setStationName(foxMessage.getString("station")); + if (MulticastUtil.isIpv6Message(foxMessage)) { + bLearnStation2.setHostName(foxMessage.getString("hostNameIPv6", foxMessage.getString("hostName", "unknown"))); + bLearnStation2.setHostAddress(foxMessage.getString("hostAddressIPv6", foxMessage.getString("hostAddress", "unknown"))); + } else { + bLearnStation2.setHostName(foxMessage.getString("hostName")); + bLearnStation2.setHostAddress(foxMessage.getString("hostAddress")); + } + bLearnStation2.setVersion(foxMessage.getString("version", "unknown")); + bLearnStation2.setHostModel(foxMessage.getString("hostModel", "unknown")); + bLearnStation2.setHostId(foxMessage.getString("hostId", "unknown")); + bLearnStation2.setVmName(foxMessage.getString("vmName", "unknown")); + bLearnStation2.setVmVersion(foxMessage.getString("vmVersion", "unknown")); + bLearnStation2.setOsName(foxMessage.getString("osName", "unknown")); + bLearnStation2.setOsVersion(foxMessage.getString("osVersion", "unknown")); + bLearnStation2.invariant(false); + if (foxMessage.getInt("foxPort", 0) != 0) { + bLearnStation = (BLearnStation)bLearnStation2.newCopy(); + bLearnStation.setScheme("fox"); + bLearnStation.setFoxPort(foxMessage.getInt("foxPort", 0)); + bLearnStation.invariant(false); + array.add((Object)bLearnStation); + } + if (foxMessage.getInt("foxsPort", 0) != 0) { + bLearnStation = (BLearnStation)bLearnStation2.newCopy(); + bLearnStation.setScheme("foxs"); + bLearnStation.setFoxPort(foxMessage.getInt("foxsPort", 0)); + bLearnStation.invariant(false); + array.add((Object)bLearnStation); + } + return (BLearnStation[])array.trim(); + } + + public String getKey() { + return this.key; + } + + public void invariant(boolean bl) { + String string; + String string2 = string = bl ? this.getHostName() : this.getHostAddress(); + if (string.indexOf(58) != -1) { + string = "[" + string + ']'; + } + if (this.getScheme().equalsIgnoreCase("fox") && this.getFoxPort() != 1911) { + string = string + ':' + this.getFoxPort(); + } else if (this.getScheme().equalsIgnoreCase("foxs") && this.getFoxPort() != 4911) { + string = string + ':' + this.getFoxPort(); + } + this.setAddress(string); + this.key = this.getStationName() + ':' + this.getScheme() + '@' + this.getHostAddress() + ':' + this.getFoxPort(); + } + + public String toString(Context context) { + String string = this.getHostAddress(); + if (string.indexOf(58) != -1) { + string = "[" + string + ']'; + } + return this.getStationName() + ':' + this.getScheme() + " @ " + this.getHostName() + '/' + string + ':' + this.getFoxPort() + " [" + this.getVersion() + "; " + this.getHostId() + "; " + this.getHostModel() + "; " + this.getOsName() + ' ' + this.getOsVersion() + "; " + this.getVmName() + ' ' + this.getVmVersion() + ']'; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$fox$sys$BLearnStation; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BLearnStation = BLearnStation.class("[Lcom.tridium.fox.sys.BLearnStation;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BServerConnections.java b/modules/cfr_output/com/tridium/fox/sys/BServerConnections.java new file mode 100644 index 0000000..b9ac3ad --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BServerConnections.java @@ -0,0 +1,56 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BComponent + * javax.baja.sys.BIcon + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys; + +import javax.baja.sys.BComponent; +import javax.baja.sys.BIcon; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BServerConnections +extends BComponent { + public static final Type TYPE; + private static final BIcon icon; + static /* synthetic */ Class class$com$tridium$fox$sys$BServerConnections; + + public Type getType() { + return TYPE; + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$fox$sys$BServerConnections; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BServerConnections = BServerConnections.class("[Lcom.tridium.fox.sys.BServerConnections;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BIcon.std((String)"connections.png"); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/BSysChannel.java b/modules/cfr_output/com/tridium/fox/sys/BSysChannel.java new file mode 100644 index 0000000..91a3f19 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/BSysChannel.java @@ -0,0 +1,488 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.space.BIGatewaySpace + * com.tridium.sys.Nre + * com.tridium.sys.station.Station + * com.tridium.sys.station.Station$Message + * com.tridium.sys.station.Station$RemoteListener + * javax.baja.naming.BLocalHost + * javax.baja.naming.BOrd + * javax.baja.nav.BINavNode + * javax.baja.nav.BNavRoot + * javax.baja.nav.NavEvent + * javax.baja.nav.NavListener + * javax.baja.net.NotConnectedException + * javax.baja.security.BIProtected + * javax.baja.space.BComponentSpace + * javax.baja.space.BSpace + * javax.baja.sys.BAbsTime + * javax.baja.sys.BComponent + * javax.baja.sys.Context + * javax.baja.sys.LocalizableRuntimeException + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.Lexicon + * javax.baja.virtual.BVirtualComponentSpace + */ +package com.tridium.fox.sys; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.message.FoxString; +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.InvalidCommandException; +import com.tridium.fox.sys.BFoxChannel; +import com.tridium.fox.sys.BFoxChannelRegistry; +import com.tridium.fox.sys.BFoxServerConnection; +import com.tridium.fox.sys.broker.BBrokerChannel; +import com.tridium.fox.sys.broker.BFoxComponentSpace; +import com.tridium.space.BIGatewaySpace; +import com.tridium.sys.Nre; +import com.tridium.sys.station.Station; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Locale; +import java.util.StringTokenizer; +import javax.baja.naming.BLocalHost; +import javax.baja.naming.BOrd; +import javax.baja.nav.BINavNode; +import javax.baja.nav.BNavRoot; +import javax.baja.nav.NavEvent; +import javax.baja.nav.NavListener; +import javax.baja.net.NotConnectedException; +import javax.baja.security.BIProtected; +import javax.baja.space.BComponentSpace; +import javax.baja.space.BSpace; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BComponent; +import javax.baja.sys.Context; +import javax.baja.sys.LocalizableRuntimeException; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.Lexicon; +import javax.baja.virtual.BVirtualComponentSpace; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BSysChannel +extends BFoxChannel +implements NavListener, +Station.RemoteListener { + public static final Type TYPE; + static byte[] noPayload; + private Type[] stationMixIns; + static /* synthetic */ Class class$com$tridium$fox$sys$BSysChannel; + + public Type getType() { + return TYPE; + } + + public FoxResponse process(FoxRequest foxRequest) throws Exception { + String string = foxRequest.command; + if (string == "navEvent") { + return this.navEvent(foxRequest); + } + if (string == "summary") { + return this.summary(foxRequest); + } + if (string == "stationCall") { + return this.stationCall(foxRequest); + } + if (string == "stationEvent") { + return this.stationEvent(foxRequest); + } + if (string == "listLocalSpaces") { + return this.listLocalSpaces(foxRequest); + } + if (string == "makeBrokerChannel") { + return this.makeBrokerChannel(foxRequest); + } + if (string == "subNavEvents") { + return this.subscribeNavEvents(foxRequest); + } + if (string == "unsubNavEvents") { + return this.unsubscribeNavEvents(foxRequest); + } + throw new InvalidCommandException(string); + } + + public void sessionClosed(Throwable throwable) throws Exception { + BNavRoot.INSTANCE.removeNavListener((NavListener)this); + Station.removeRemoteListener((Station.RemoteListener)this); + } + + public String[][] summary() throws Exception { + FoxRequest foxRequest = this.makeRequest("summary"); + if (this.isTraceOn()) { + this.trace("c:summary"); + } + FoxResponse foxResponse = this.sendSync(foxRequest); + String[][] stringArray = new String[foxResponse.count][]; + int n = 0; + while (n < foxResponse.count) { + FoxString foxString = (FoxString)foxResponse.tuples[n]; + stringArray[n] = new String[]{foxString.name, foxString.value}; + ++n; + } + return stringArray; + } + + public FoxResponse summary(FoxRequest foxRequest) throws Exception { + if (this.isTraceOn()) { + this.trace("s:listLocalSpaces"); + } + Context context = this.getSessionContext(); + FoxResponse foxResponse = new FoxResponse(foxRequest); + foxResponse.add("stationName", Sys.getStation().getStationName()); + foxResponse.add("host", "" + Sys.getLocalHost()); + foxResponse.add("hostModel", Nre.getHostModel()); + foxResponse.add("hostId", Nre.getHostId()); + foxResponse.add("niagaraVersion", "" + Sys.getBajaModule().getVendorVersion()); + foxResponse.add("javaVersion", System.getProperty("java.vm.name") + ' ' + System.getProperty("java.vm.version")); + foxResponse.add("osVersion", System.getProperty("os.arch") + ' ' + System.getProperty("os.name") + ' ' + System.getProperty("os.version")); + foxResponse.add("locale", "" + Locale.getDefault()); + foxResponse.add("currentTime", BAbsTime.make().toString(context)); + return foxResponse; + } + + public byte[] stationCall(String string, byte[] byArray) throws Exception { + if (byArray == null) { + byArray = noPayload; + } + FoxRequest foxRequest = this.makeRequest("stationCall"); + foxRequest.add("id", string); + foxRequest.add("payload", byArray); + if (this.isTraceOn()) { + this.trace("c:stationCall " + string); + } + FoxResponse foxResponse = this.sendSync(foxRequest); + return foxResponse.getBlob("payload"); + } + + public FoxResponse stationCall(FoxRequest foxRequest) throws Exception { + Station.Message message; + String string = foxRequest.getString("id"); + byte[] byArray = foxRequest.getBlob("payload"); + if (this.isTraceOn()) { + this.trace("s:stationCall " + string); + } + if ((message = Station.remoteCall((Station.Message)new Station.Message(string, byArray))) != null) { + byArray = message.payload; + } + if (byArray == null) { + byArray = noPayload; + } + FoxResponse foxResponse = new FoxResponse(foxRequest); + foxResponse.add("payload", byArray); + return foxResponse; + } + + public void stationEvent(Station.Message message) throws Exception { + FoxRequest foxRequest = this.makeRequest("stationEvent"); + foxRequest.add("id", message.id); + foxRequest.add("payload", message.payload); + if (this.isTraceOn()) { + this.trace("c:stationEvent " + message.id); + } + this.sendAsync(foxRequest); + } + + public FoxResponse stationEvent(FoxRequest foxRequest) throws Exception { + String string = foxRequest.getString("id"); + byte[] byArray = foxRequest.getBlob("payload"); + if (this.isTraceOn()) { + this.trace("s:stationEvent " + string); + } + if (string.equals("stationFault")) { + String string2 = null; + if (byArray.length > 0) { + string2 = Lexicon.make((String)"baja").getText(new String(byArray)); + } + this.getFoxSession().stationFault = string2; + } else if (string.equals("mixIns")) { + this.stationMixIns = Station.decodeMixIns((byte[])byArray); + } + return null; + } + + public Type[] getStationMixIns() { + return (Type[])this.stationMixIns.clone(); + } + + public HashMap listLocalSpaces() throws Exception { + FoxRequest foxRequest = this.makeRequest("listLocalSpaces"); + if (this.isTraceOn()) { + this.trace("c:listLocalSpaces"); + } + FoxResponse foxResponse = this.sendSync(foxRequest); + FoxTuple[] foxTupleArray = foxResponse.list("space"); + String[] stringArray = new String[foxTupleArray.length]; + HashMap hashMap = new HashMap(); + int n = 0; + while (n < foxTupleArray.length) { + FoxMessage foxMessage = (FoxMessage)foxTupleArray[n]; + String string = foxMessage.getString("schemeId"); + hashMap.put(string, string); + ++n; + } + return hashMap; + } + + public FoxResponse listLocalSpaces(FoxRequest foxRequest) throws Exception { + if (this.isTraceOn()) { + this.trace("s:listLocalSpaces"); + } + FoxResponse foxResponse = new FoxResponse(foxRequest); + BINavNode[] bINavNodeArray = BLocalHost.INSTANCE.getNavChildren(); + int n = 0; + while (n < bINavNodeArray.length) { + BINavNode bINavNode = bINavNodeArray[n]; + if (bINavNode instanceof BSpace) { + Object[] objectArray; + BSpace bSpace = (BSpace)bINavNode; + if (bSpace instanceof BIProtected && !this.getPermissionsFor(bSpace).hasOperatorRead()) { + if (bSpace.getNavName().equals("station")) { + objectArray = new String[]{this.getConnection() instanceof BFoxServerConnection ? this.getServerConnection().getUser().getUsername() : this.getClientConnection().getUsername()}; + throw new LocalizableRuntimeException("fox", "error.NoPermissionForStation", objectArray); + } + } else { + objectArray = new FoxMessage("space"); + objectArray.add("schemeId", bSpace.getNavName()); + objectArray.add("type", bSpace.getType().toString()); + foxResponse.add((FoxTuple)objectArray); + } + } + ++n; + } + return foxResponse; + } + + public BBrokerChannel makeBrokerChannel(BFoxComponentSpace bFoxComponentSpace) throws Exception { + FoxRequest foxRequest = this.makeRequest("makeBrokerChannel"); + foxRequest.add("ord", "" + bFoxComponentSpace.getOrdInSession()); + if (this.isTraceOn()) { + this.trace("c:makebrokerChannel"); + } + FoxResponse foxResponse = this.sendSync(foxRequest); + String string = foxResponse.getString("channelName"); + BFoxChannelRegistry bFoxChannelRegistry = this.getConnection().getChannels(); + BBrokerChannel bBrokerChannel = (BBrokerChannel)bFoxChannelRegistry.get(string, BBrokerChannel.TYPE); + bBrokerChannel.initClient(bFoxComponentSpace); + return bBrokerChannel; + } + + public FoxResponse makeBrokerChannel(FoxRequest foxRequest) throws Exception { + String string; + Object object; + BOrd bOrd = BOrd.make((String)foxRequest.getString("ord")); + BComponentSpace bComponentSpace = (BComponentSpace)bOrd.get(); + if (bComponentSpace instanceof BVirtualComponentSpace) { + object = ((BVirtualComponentSpace)bComponentSpace).getVirtualGateway(); + string = "virt_" + object.getHandle(); + } else { + string = bComponentSpace instanceof BIGatewaySpace ? "gw_" + ((BIGatewaySpace)bComponentSpace).getGateway().getHandle() : bComponentSpace.getNavName(); + } + object = this.getConnection().getChannels(); + BBrokerChannel bBrokerChannel = (BBrokerChannel)((BFoxChannelRegistry)((Object)object)).get(string, BBrokerChannel.TYPE); + bBrokerChannel.initServer(bComponentSpace); + if (this.isTraceOn()) { + this.trace("s:makebrokerChannel " + bOrd + " -> " + string); + } + FoxResponse foxResponse = new FoxResponse(foxRequest); + foxResponse.add("channelName", string); + return foxResponse; + } + + public void subscribeNavEvents() throws Exception { + if (this.isTraceOn()) { + this.trace("c:subNavEvents"); + } + this.sendAsync(this.makeRequest("subNavEvents")); + } + + private final FoxResponse subscribeNavEvents(FoxRequest foxRequest) { + if (this.isTraceOn()) { + this.trace("s:subNavEvents"); + } + BNavRoot.INSTANCE.addNavListener((NavListener)this); + Station.addRemoteListener((Station.RemoteListener)this); + Station.broadcastStationFault(); + Station.broadcastStationMixIns(); + return null; + } + + public void unsubscribeNavEvents() throws Exception { + if (this.isTraceOn()) { + this.trace("c:unsubNavEvents"); + } + try { + this.sendAsync(this.makeRequest("unsubNavEvents")); + } + catch (NotConnectedException notConnectedException) {} + } + + private final FoxResponse unsubscribeNavEvents(FoxRequest foxRequest) { + if (this.isTraceOn()) { + this.trace("s:unsubNavEvents"); + } + BNavRoot.INSTANCE.removeNavListener((NavListener)this); + Station.removeRemoteListener((Station.RemoteListener)this); + return null; + } + + public void navEvent(NavEvent navEvent) { + block16: { + try { + String string; + if (this.isTraceOn()) { + this.trace("c:navEvent " + navEvent); + } + if (!(string = navEvent.getParentOrd().toString()).startsWith("local:")) { + return; + } + if (string.startsWith("local:|fox:") || string.startsWith("local:|foxs:")) { + return; + } + if (navEvent.getParent() instanceof BComponent) { + return; + } + int n = string.indexOf(124); + if (n < 0) { + return; + } + String string2 = string.substring(n + 1); + FoxRequest foxRequest = this.makeRequest("navEvent"); + foxRequest.add("ord", string2); + switch (navEvent.getId()) { + case 1: { + foxRequest.add("id", "a"); + foxRequest.add("n", navEvent.getNewChildName()); + break; + } + case 2: { + foxRequest.add("id", "v"); + foxRequest.add("o", navEvent.getOldChildName()); + break; + } + case 3: { + foxRequest.add("id", "r"); + foxRequest.add("o", navEvent.getOldChildName()); + foxRequest.add("n", navEvent.getNewChildName()); + break; + } + case 4: { + StringBuffer stringBuffer = new StringBuffer(); + String[] stringArray = navEvent.getNewOrder(); + int n2 = 0; + while (n2 < stringArray.length) { + stringBuffer.append(stringArray[n2]).append('|'); + ++n2; + } + foxRequest.add("id", "o"); + foxRequest.add("o", stringBuffer.toString()); + break; + } + case 5: { + foxRequest.add("id", "p"); + foxRequest.add("o", navEvent.getOldChildName()); + break; + } + case 6: { + foxRequest.add("id", "c"); + foxRequest.add("o", navEvent.getOldChildName()); + foxRequest.add("n", navEvent.getNewChildName()); + break; + } + default: { + throw new IllegalStateException(navEvent.toString()); + } + } + this.sendAsync(foxRequest); + } + catch (Exception exception) { + if (!this.getConnection().isConnected()) break block16; + exception.printStackTrace(); + } + } + } + + private final FoxResponse navEvent(FoxRequest foxRequest) throws Exception { + String string = foxRequest.getString("ord"); + BOrd bOrd = BOrd.make((BOrd)this.getFoxSession().getAbsoluteOrd(), (String)string); + String string2 = foxRequest.getString("id"); + if (this.isTraceOn()) { + this.trace("s:navEvent " + string2 + ' ' + bOrd); + } + NavEvent navEvent = null; + if (string2.equals("a")) { + String string3 = foxRequest.getString("n"); + navEvent = NavEvent.makeAdded((BOrd)bOrd, (String)string3, null); + } else if (string2.equals("v")) { + String string4 = foxRequest.getString("o"); + navEvent = NavEvent.makeRemoved((BOrd)bOrd, (String)string4, null); + } else if (string2.equals("r")) { + String string5 = foxRequest.getString("o"); + String string6 = foxRequest.getString("n"); + navEvent = NavEvent.makeRenamed((BOrd)bOrd, (String)string5, (String)string6, null); + } else if (string2.equals("o")) { + String string7 = foxRequest.getString("o"); + ArrayList arrayList = new ArrayList(); + StringTokenizer stringTokenizer = new StringTokenizer(string7, "|"); + while (stringTokenizer.hasMoreTokens()) { + arrayList.add(stringTokenizer.nextToken()); + } + String[] stringArray = arrayList.toArray(new String[arrayList.size()]); + navEvent = NavEvent.makeReordered((BOrd)bOrd, (String[])stringArray, null); + } else if (string2.equals("p")) { + String string8 = foxRequest.getString("o"); + navEvent = NavEvent.makeReplaced((BOrd)bOrd, (String)string8, null); + } else if (string2.equals("c")) { + String string9 = foxRequest.getString("o"); + String string10 = foxRequest.getString("n"); + navEvent = NavEvent.makeRecategorized((BOrd)bOrd, (String)string9, (String)string10, null); + } else { + System.out.println("ERROR: Unknown event type: " + string2); + Thread.dumpStack(); + } + if (navEvent != null) { + BNavRoot.INSTANCE.fireNavEvent(navEvent); + } + return null; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.stationMixIns = new Type[0]; + } + + public BSysChannel() { + super("sys"); + this.this(); + } + + static { + Class clazz = class$com$tridium$fox$sys$BSysChannel; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$BSysChannel = BSysChannel.class("[Lcom.tridium.fox.sys.BSysChannel;", false); + } + TYPE = Sys.loadType((Class)clazz); + noPayload = new byte[0]; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/EngageTimeoutException.java b/modules/cfr_output/com/tridium/fox/sys/EngageTimeoutException.java new file mode 100644 index 0000000..366ad0d --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/EngageTimeoutException.java @@ -0,0 +1,20 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BajaRuntimeException + */ +package com.tridium.fox.sys; + +import javax.baja.sys.BajaRuntimeException; + +public class EngageTimeoutException +extends BajaRuntimeException { + public EngageTimeoutException(String string) { + super(string); + } + + public EngageTimeoutException() { + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/FatalAuthenticationException.java b/modules/cfr_output/com/tridium/fox/sys/FatalAuthenticationException.java new file mode 100644 index 0000000..699512e --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/FatalAuthenticationException.java @@ -0,0 +1,17 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.LocalizableRuntimeException + */ +package com.tridium.fox.sys; + +import javax.baja.sys.LocalizableRuntimeException; + +public class FatalAuthenticationException +extends LocalizableRuntimeException { + public FatalAuthenticationException(String string) { + super("fox", "FatalAuthenticationException", new Object[]{string}, null); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/Learn.java b/modules/cfr_output/com/tridium/fox/sys/Learn.java new file mode 100644 index 0000000..ec0b3b2 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/Learn.java @@ -0,0 +1,81 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.sys; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.MulticastServer; +import com.tridium.fox.sys.BLearnStation; +import java.util.HashMap; + +public class Learn { + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public static BLearnStation[] learn(long l, MulticastServer.RollcallCallback rollcallCallback) throws Exception { + MulticastServer multicastServer = null; + try { + multicastServer = new MulticastServer(null); + multicastServer.start(); + } + catch (Exception exception) { + System.err.println("ERROR: Could not create Fox MulticastServer: " + exception); + throw exception; + } + try { + BLearnStation[] bLearnStationArray = Learn.learn(multicastServer, l, rollcallCallback); + Object var5_6 = null; + multicastServer.kill(); + return bLearnStationArray; + } + catch (Throwable throwable) { + Object var5_7 = null; + multicastServer.kill(); + throw throwable; + } + } + + public static BLearnStation[] learn(MulticastServer multicastServer, long l, MulticastServer.RollcallCallback rollcallCallback) throws Exception { + if (multicastServer == null) { + return Learn.learn(l, rollcallCallback); + } + FoxMessage[] foxMessageArray = multicastServer.rollcall(new FoxMessage(), l, rollcallCallback); + HashMap hashMap = new HashMap(); + int n = 0; + while (n < foxMessageArray.length) { + try { + BLearnStation[] bLearnStationArray = BLearnStation.make(foxMessageArray[n]); + int n2 = 0; + while (n2 < bLearnStationArray.length) { + if (hashMap.get(bLearnStationArray[n2].getKey()) == null) { + hashMap.put(bLearnStationArray[n2].getKey(), bLearnStationArray[n2]); + } + ++n2; + } + } + catch (Exception exception) { + exception.printStackTrace(); + try { + foxMessageArray[n].dump(); + } + catch (Exception exception2) {} + } + ++n; + } + return hashMap.values().toArray(new BLearnStation[hashMap.values().size()]); + } + + public static void main(String[] stringArray) throws Exception { + long l = 5000L; + System.out.println("Searching (" + l + "ms)..."); + BLearnStation[] bLearnStationArray = Learn.learn(l, null); + System.out.println("Found " + bLearnStationArray.length + " Stations"); + int n = 0; + while (n < bLearnStationArray.length) { + System.out.println((Object)bLearnStationArray[n]); + ++n; + } + System.exit(0); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/LocalizableExceptionTranslator.java b/modules/cfr_output/com/tridium/fox/sys/LocalizableExceptionTranslator.java new file mode 100644 index 0000000..a1ea78b --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/LocalizableExceptionTranslator.java @@ -0,0 +1,116 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.util.ThrowableUtil + * javax.baja.sys.LocalizableException + * javax.baja.sys.LocalizableRuntimeException + * javax.baja.sys.ModuleNotFoundException + */ +package com.tridium.fox.sys; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.message.FoxString; +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.ServerException; +import com.tridium.fox.sys.LocalizableServerException; +import com.tridium.fox.sys.ModuleNotFoundRemoteException; +import com.tridium.util.ThrowableUtil; +import java.io.IOException; +import javax.baja.sys.LocalizableException; +import javax.baja.sys.LocalizableRuntimeException; +import javax.baja.sys.ModuleNotFoundException; + +public class LocalizableExceptionTranslator +extends Fox.ExceptionTranslator { + public FoxMessage exceptionToMessage(Throwable throwable) { + FoxMessage foxMessage = new FoxMessage(); + foxMessage.add("exception", throwable.toString()); + try { + ModuleNotFoundException moduleNotFoundException = LocalizableExceptionTranslator.getModuleNotFoundException(throwable); + if (moduleNotFoundException != null) { + foxMessage.add("moduleNotFound", moduleNotFoundException.getModuleName()); + return foxMessage; + } + if (throwable instanceof LocalizableException) { + LocalizableException localizableException = (LocalizableException)throwable; + foxMessage.add("lexModule", localizableException.getLexiconModule()); + foxMessage.add("lexKey", localizableException.getLexiconKey()); + Object[] objectArray = localizableException.getLexiconArguments(); + if (objectArray != null && objectArray.length > 0) { + foxMessage.add(this.argsToMessage(objectArray)); + } + } else if (throwable instanceof LocalizableRuntimeException) { + LocalizableRuntimeException localizableRuntimeException = (LocalizableRuntimeException)throwable; + foxMessage.add("lexModule", localizableRuntimeException.getLexiconModule()); + foxMessage.add("lexKey", localizableRuntimeException.getLexiconKey()); + Object[] objectArray = localizableRuntimeException.getLexiconArguments(); + if (objectArray != null && objectArray.length > 0) { + foxMessage.add(this.argsToMessage(objectArray)); + } + } + } + catch (Throwable throwable2) { + throwable2.printStackTrace(); + } + return foxMessage; + } + + public Exception messageToException(FoxMessage foxMessage) throws IOException { + try { + String string = foxMessage.getString("moduleNotFound", null); + if (string != null) { + return new ModuleNotFoundRemoteException(string); + } + String string2 = foxMessage.getString("lexModule", null); + if (string2 != null) { + String string3 = foxMessage.getString("lexKey", null); + Object[] objectArray = this.messageToArgs((FoxMessage)foxMessage.getOptional("lexArgs")); + return new LocalizableServerException(string2, string3, objectArray); + } + } + catch (Throwable throwable) { + throwable.printStackTrace(); + } + if (foxMessage == null) { + return new ServerException("cause unknown"); + } + return new ServerException(foxMessage.getString("exception", "cause unknown")); + } + + FoxMessage argsToMessage(Object[] objectArray) { + FoxMessage foxMessage = new FoxMessage("lexArgs"); + int n = 0; + while (n < objectArray.length) { + foxMessage.add("a", String.valueOf(objectArray[n])); + ++n; + } + return foxMessage; + } + + Object[] messageToArgs(FoxMessage foxMessage) { + if (foxMessage == null) { + return null; + } + FoxTuple[] foxTupleArray = foxMessage.list("a"); + Object[] objectArray = new Object[foxTupleArray.length]; + int n = 0; + while (n < objectArray.length) { + objectArray[n] = ((FoxString)foxTupleArray[n]).value; + ++n; + } + return objectArray; + } + + static ModuleNotFoundException getModuleNotFoundException(Throwable throwable) { + while (throwable != null) { + if (throwable instanceof ModuleNotFoundException) { + return (ModuleNotFoundException)throwable; + } + throwable = ThrowableUtil.getCause((Throwable)throwable); + } + return null; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/LocalizableServerException.java b/modules/cfr_output/com/tridium/fox/sys/LocalizableServerException.java new file mode 100644 index 0000000..9bc624c --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/LocalizableServerException.java @@ -0,0 +1,17 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.LocalizableRuntimeException + */ +package com.tridium.fox.sys; + +import javax.baja.sys.LocalizableRuntimeException; + +public class LocalizableServerException +extends LocalizableRuntimeException { + public LocalizableServerException(String string, String string2, Object[] objectArray) { + super(string, string2, objectArray, null); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/MismatchedStationNamesException.java b/modules/cfr_output/com/tridium/fox/sys/MismatchedStationNamesException.java new file mode 100644 index 0000000..e43e77d --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/MismatchedStationNamesException.java @@ -0,0 +1,21 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BajaRuntimeException + */ +package com.tridium.fox.sys; + +import javax.baja.sys.BajaRuntimeException; + +public class MismatchedStationNamesException +extends BajaRuntimeException { + public String toString() { + return "Mismatched station names: " + this.getMessage(); + } + + public MismatchedStationNamesException(String string, String string2) { + super(string + " != " + string2); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/ModuleNotFoundLocalException.java b/modules/cfr_output/com/tridium/fox/sys/ModuleNotFoundLocalException.java new file mode 100644 index 0000000..d40de71 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/ModuleNotFoundLocalException.java @@ -0,0 +1,17 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.LocalizableRuntimeException + */ +package com.tridium.fox.sys; + +import javax.baja.sys.LocalizableRuntimeException; + +public class ModuleNotFoundLocalException +extends LocalizableRuntimeException { + public ModuleNotFoundLocalException(String string, Throwable throwable) { + super("fox", "ModuleNotFoundLocalException", new Object[]{string}, throwable); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/ModuleNotFoundRemoteException.java b/modules/cfr_output/com/tridium/fox/sys/ModuleNotFoundRemoteException.java new file mode 100644 index 0000000..b86119e --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/ModuleNotFoundRemoteException.java @@ -0,0 +1,17 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.LocalizableRuntimeException + */ +package com.tridium.fox.sys; + +import javax.baja.sys.LocalizableRuntimeException; + +public class ModuleNotFoundRemoteException +extends LocalizableRuntimeException { + public ModuleNotFoundRemoteException(String string) { + super("fox", "ModuleNotFoundRemoteException", new Object[]{string}); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/NiagaraNetwork.java b/modules/cfr_output/com/tridium/fox/sys/NiagaraNetwork.java new file mode 100644 index 0000000..474fced --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/NiagaraNetwork.java @@ -0,0 +1,11 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.fox.sys; + +import com.tridium.fox.sys.NiagaraStation; + +public interface NiagaraNetwork { + public NiagaraStation getStation(String var1); +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/NiagaraStation.java b/modules/cfr_output/com/tridium/fox/sys/NiagaraStation.java new file mode 100644 index 0000000..099e0b6 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/NiagaraStation.java @@ -0,0 +1,39 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.naming.BHost + */ +package com.tridium.fox.sys; + +import com.tridium.fox.message.FoxMessage; +import javax.baja.naming.BHost; + +public interface NiagaraStation { + public String getStationName(); + + public BHost getRemoteHost(); + + public int getFoxPort(); + + public String getScheme(); + + public void clientOpened(); + + public void clientClosed(); + + public void serverOpened(); + + public void serverClosed(); + + public void initHello(FoxMessage var1) throws Exception; + + public void pingOk(); + + public void pingFail(String var1); + + public boolean isFatalFault(); + + public String getFaultCause(); +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/broker/BBrokerChannel.java b/modules/cfr_output/com/tridium/fox/sys/broker/BBrokerChannel.java new file mode 100644 index 0000000..cfb9e62 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/broker/BBrokerChannel.java @@ -0,0 +1,1746 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.space.BIGatewaySpace + * com.tridium.sys.module.Dependency + * com.tridium.sys.module.NModule + * com.tridium.sys.module.SyntheticModuleClassLoader + * com.tridium.sys.schema.ComplexType + * com.tridium.sys.schema.ComponentSlotMap + * com.tridium.sys.schema.EnumType + * com.tridium.sys.schema.NSlot + * com.tridium.sys.schema.SimpleType + * com.tridium.sys.schema.SyntheticCompiler + * com.tridium.sys.schema.SyntheticComplexType + * com.tridium.sys.schema.SyntheticEnumType + * com.tridium.sys.schema.SyntheticSimpleType + * com.tridium.sys.transfer.DeleteOp + * com.tridium.sys.transfer.TransferListener + * com.tridium.sys.transfer.TransferResult + * com.tridium.sys.transfer.TransferStrategy + * javax.baja.io.ValueDocDecoder + * javax.baja.io.ValueDocDecoder$BogTypeResolver + * javax.baja.io.ValueDocDecoder$ITypeResolver + * javax.baja.io.ValueDocEncoder + * javax.baja.log.Log + * javax.baja.naming.BOrd + * javax.baja.naming.SlotPath + * javax.baja.naming.UnresolvedException + * javax.baja.nav.NavEvent + * javax.baja.net.NotConnectedException + * javax.baja.nre.util.Array + * javax.baja.registry.DependencyInfo + * javax.baja.registry.ModuleInfo + * javax.baja.registry.TypeInfo + * javax.baja.security.BIProtected + * javax.baja.security.BPermissions + * javax.baja.space.BComponentSpace + * javax.baja.spy.SpyWriter + * javax.baja.sync.ProxyBroker + * javax.baja.sync.SyncBuffer + * javax.baja.sync.SyncDecoder + * javax.baja.sync.SyncEncoder + * javax.baja.sys.Action + * javax.baja.sys.ActionInvokeException + * javax.baja.sys.BComplex + * javax.baja.sys.BComponent + * javax.baja.sys.BComponentEvent + * javax.baja.sys.BFacets + * javax.baja.sys.BFrozenEnum + * javax.baja.sys.BModule + * javax.baja.sys.BObject + * javax.baja.sys.BSimple + * javax.baja.sys.BValue + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.Clock + * javax.baja.sys.Context + * javax.baja.sys.CopyHints + * javax.baja.sys.ModuleException + * javax.baja.sys.Property + * javax.baja.sys.ServiceNotFoundException + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.sys.TypeException + * javax.baja.user.BUser + * javax.baja.util.BTypeSpec + * javax.baja.util.Version + * javax.baja.virtual.BVirtualComponent + * javax.baja.virtual.BVirtualComponentSpace + * javax.baja.xml.XException + */ +package com.tridium.fox.sys.broker; + +import com.tridium.fox.encoding.BogCodec; +import com.tridium.fox.encoding.DecoderFactory; +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.message.FoxString; +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxCircuit; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.InvalidCommandException; +import com.tridium.fox.sys.BFoxChannel; +import com.tridium.fox.sys.ModuleNotFoundLocalException; +import com.tridium.fox.sys.broker.BFoxComponentSpace; +import com.tridium.fox.sys.broker.BFoxVirtualSpace; +import com.tridium.fox.sys.broker.SyntheticTypeInfo; +import com.tridium.fox.sys.broker.TransferCodec; +import com.tridium.space.BIGatewaySpace; +import com.tridium.sys.module.Dependency; +import com.tridium.sys.module.NModule; +import com.tridium.sys.module.SyntheticModuleClassLoader; +import com.tridium.sys.schema.ComplexType; +import com.tridium.sys.schema.ComponentSlotMap; +import com.tridium.sys.schema.EnumType; +import com.tridium.sys.schema.NSlot; +import com.tridium.sys.schema.SimpleType; +import com.tridium.sys.schema.SyntheticCompiler; +import com.tridium.sys.schema.SyntheticComplexType; +import com.tridium.sys.schema.SyntheticEnumType; +import com.tridium.sys.schema.SyntheticSimpleType; +import com.tridium.sys.transfer.DeleteOp; +import com.tridium.sys.transfer.TransferListener; +import com.tridium.sys.transfer.TransferResult; +import com.tridium.sys.transfer.TransferStrategy; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.StringTokenizer; +import javax.baja.io.ValueDocDecoder; +import javax.baja.io.ValueDocEncoder; +import javax.baja.log.Log; +import javax.baja.naming.BOrd; +import javax.baja.naming.SlotPath; +import javax.baja.naming.UnresolvedException; +import javax.baja.nav.NavEvent; +import javax.baja.net.NotConnectedException; +import javax.baja.nre.util.Array; +import javax.baja.registry.DependencyInfo; +import javax.baja.registry.ModuleInfo; +import javax.baja.registry.TypeInfo; +import javax.baja.security.BIProtected; +import javax.baja.security.BPermissions; +import javax.baja.space.BComponentSpace; +import javax.baja.spy.SpyWriter; +import javax.baja.sync.ProxyBroker; +import javax.baja.sync.SyncBuffer; +import javax.baja.sync.SyncDecoder; +import javax.baja.sync.SyncEncoder; +import javax.baja.sys.Action; +import javax.baja.sys.ActionInvokeException; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BComponentEvent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BFrozenEnum; +import javax.baja.sys.BModule; +import javax.baja.sys.BObject; +import javax.baja.sys.BSimple; +import javax.baja.sys.BValue; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.Clock; +import javax.baja.sys.Context; +import javax.baja.sys.CopyHints; +import javax.baja.sys.ModuleException; +import javax.baja.sys.Property; +import javax.baja.sys.ServiceNotFoundException; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.sys.TypeException; +import javax.baja.user.BUser; +import javax.baja.util.BTypeSpec; +import javax.baja.util.Version; +import javax.baja.virtual.BVirtualComponent; +import javax.baja.virtual.BVirtualComponentSpace; +import javax.baja.xml.XException; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BBrokerChannel +extends BFoxChannel { + public static final Action subscriberGc = BBrokerChannel.newAction((int)16, null); + public static final Type TYPE; + static final Version ver3_2_5; + private static boolean DUMP_BUF; + private static int POLL_RATE; + public static final Log syncLog; + private BrokerTypeResolver typeResolver; + private boolean isClient; + private boolean isServer; + private BComponentSpace space; + private ClientSyncThread clientThread; + private ProxyBroker broker; + private Object syncFromMasterLock; + private long lastSyncFromMaster; + private HashMap syntheticModuleMap; + private List syncBuffers; + private ThreadLocal eventCache; + static /* synthetic */ Class class$com$tridium$fox$sys$broker$BBrokerChannel; + + public void subscriberGc() { + this.invoke(subscriberGc, null, null); + } + + public Type getType() { + return TYPE; + } + + public ProxyBroker getProxyBroker() { + return this.broker; + } + + public FoxResponse process(FoxRequest foxRequest) throws Throwable { + String string = foxRequest.command; + if (string == "loadRoot") { + return this.loadRoot(foxRequest); + } + if (string == "load") { + return this.load(foxRequest); + } + if (string == "loadSlot") { + return this.loadSlot(foxRequest); + } + if (string == "sub") { + return this.subscribe(foxRequest); + } + if (string == "unsub") { + return this.unsubscribe(foxRequest); + } + if (string == "transfer") { + return this.transferReqRes(foxRequest); + } + if (string == "invoke") { + return this.invoke(foxRequest); + } + if (string == "handleToPath") { + return this.handleToPath(foxRequest); + } + if (string == "serviceToPath") { + return this.serviceToPath(foxRequest); + } + if (string == "generateHandles") { + return this.generateHandles(foxRequest); + } + if (string == "rpc") { + return this.rpc(foxRequest); + } + if (string == "touch") { + return this.touch(foxRequest); + } + if (string == "loadType") { + return this.loadType(foxRequest); + } + if (string == "loadModule") { + return this.loadModule(foxRequest); + } + throw new InvalidCommandException(string); + } + + public void circuitOpened(FoxCircuit foxCircuit) throws Exception { + String string = foxCircuit.command; + if (string == "syncToMaster") { + this.syncToMaster(foxCircuit); + return; + } + if (string == "syncFromMaster") { + this.syncFromMaster(foxCircuit); + return; + } + if (string == "transferCircuit") { + this.transferCircuit(foxCircuit); + return; + } + if (string == "copy") { + this.copy(foxCircuit); + return; + } + if (string == "delete") { + this.delete(foxCircuit); + return; + } + throw new InvalidCommandException(string); + } + + public void initClient(BFoxComponentSpace bFoxComponentSpace) throws Exception { + if (this.isTraceOn()) { + this.trace("c:initClient " + bFoxComponentSpace.getNavOrd()); + } + this.isClient = true; + this.isServer = false; + this.space = bFoxComponentSpace; + RootInfo rootInfo = this.loadRoot(); + bFoxComponentSpace.setRootComponent(rootInfo.root); + bFoxComponentSpace.spaceReadonly = rootInfo.spaceReadonly; + bFoxComponentSpace.defaultLeaseTime = rootInfo.defaultLeaseTime; + this.clientThread = new ClientSyncThread("Fox:ClientSync:" + this.getConnection().session().getId()); + this.clientThread.start(); + } + + public void initServer(BComponentSpace bComponentSpace) throws Exception { + if (this.isTraceOn()) { + this.trace("s:initServer " + bComponentSpace.getNavOrd()); + } + this.isClient = false; + this.isServer = true; + this.space = bComponentSpace; + this.broker = new FoxProxyBroker(bComponentSpace); + this.broker.start(); + } + + public void cleanupClient() { + if (this.clientThread != null) { + this.clientThread.kill(); + this.clientThread = null; + try { + if (this.space instanceof BFoxVirtualSpace) { + ((BFoxVirtualSpace)this.space).cleanup(this.getFoxSession()); + } + } + catch (Exception exception) {} + } + } + + public void cleanupServer() { + if (this.broker != null) { + this.broker.stop(); + this.broker = null; + } + } + + public void sessionClosed(Throwable throwable) { + if (this.isClient) { + this.cleanupClient(); + } else { + this.cleanupServer(); + } + } + + NModule loadModule(final ValueDocDecoder valueDocDecoder, final String string, final String string2) { + NModule nModule; + Version version = this.getClientConnection().getRemoteVersion(); + if (version.get(0) < 3 || version.get(1) < 7) { + throw new ModuleNotFoundLocalException(string2, null); + } + if (this.syntheticModuleMap == null || !this.syntheticModuleMap.containsKey(string2)) { + if (this.syntheticModuleMap == null) { + this.syntheticModuleMap = new HashMap(); + } + if (this.isTraceOn()) { + this.trace("Synthesizing module " + string2); + } + try { + FoxRequest foxRequest = this.makeRequest("loadModule"); + foxRequest.add("module", string2); + final FoxResponse foxResponse = this.sendSync(foxRequest); + nModule = new NModule(){ + HashMap syntheticTypeMap; + + public final BModule bmodule() { + if (this.bmodule == null) { + this.bmodule = new BModule((Object)this); + } + return (BModule)this.bmodule; + } + + public final Type getType(String string3) throws TypeException { + BTypeSpec bTypeSpec = BTypeSpec.make((String)string2, (String)string3); + try { + if (this.syntheticTypeMap.containsKey(bTypeSpec)) { + return (Type)this.syntheticTypeMap.get(bTypeSpec); + } + Type type = BBrokerChannel.this.loadType(valueDocDecoder, this, bTypeSpec); + this.syntheticTypeMap.put(bTypeSpec, type); + return type; + } + catch (Exception exception) { + throw new BajaRuntimeException("Unable to synthesize " + bTypeSpec, (Throwable)exception); + } + } + + private final /* synthetic */ void this() { + this.syntheticTypeMap = new HashMap(); + this.classLoader = new SyntheticModuleClassLoader(this){ + + public final Class nfind(String string, boolean bl) { + BTypeSpec bTypeSpec = BTypeSpec.make((String)this.module.getModuleName(), (String)string.substring(string.lastIndexOf(46) + 2)); + if (syntheticTypeMap.containsKey(bTypeSpec)) { + return ((Type)syntheticTypeMap.get(bTypeSpec)).getTypeClass(); + } + if (this.module.getTypeClassName(string.substring(string.lastIndexOf(46) + 2)) != null) { + try { + Type type = BBrokerChannel.this.loadType(valueDocDecoder, this.module, bTypeSpec); + syntheticTypeMap.put(bTypeSpec, type); + return type.getTypeClass(); + } + catch (Exception exception) { + throw new BajaRuntimeException((Throwable)exception); + } + } + return super.nfind(string, bl); + } + }; + this.name = string2; + this.preferredSymbol = string; + this.bajaVersion = new Version(foxResponse.getString("bajaVersion")); + this.vendor = foxResponse.getString("vendor"); + this.description = foxResponse.getString("description"); + this.vendorVersion = new Version(foxResponse.getString("vendorVersion")); + String[] stringArray = foxResponse.listStrings("types"); + int n = 0; + while (n < stringArray.length) { + this.types.put(stringArray[n].substring(stringArray[n].lastIndexOf(46) + 2), stringArray[n]); + ++n; + } + String[] stringArray2 = foxResponse.listStrings("dependency"); + String[] stringArray3 = foxResponse.listStrings("dependency_bajaVersion"); + String[] stringArray4 = foxResponse.listStrings("dependency_vendor"); + String[] stringArray5 = foxResponse.listStrings("dependency_vendorVersion"); + this.depends = new Dependency[stringArray2.length]; + int n2 = 0; + while (n2 < stringArray2.length) { + String string3 = stringArray2[n2]; + BModule bModule = BBrokerChannel.this.typeResolver.loadModule(valueDocDecoder, null, null, string3 + '=' + string3, string3); + this.depends[n2] = new Dependency(string3, new Version(stringArray3[n2]), stringArray4[n2], new Version(stringArray5[n2]), (NModule)bModule.fw(405)); + ++n2; + } + } + { + this.this(); + } + }; + this.syntheticModuleMap.put(string2, nModule); + } + catch (Exception exception) { + throw new BajaRuntimeException((Throwable)exception); + } + } else { + nModule = (NModule)this.syntheticModuleMap.get(string2); + } + return nModule; + } + + private final FoxResponse loadModule(FoxRequest foxRequest) throws Exception { + String string = foxRequest.getString("module"); + if (this.isTraceOn()) { + this.trace("s:loadModule " + string); + } + ModuleInfo moduleInfo = Sys.getRegistry().getModule(string); + FoxResponse foxResponse = new FoxResponse(foxRequest); + foxResponse.add("vendorVersion", moduleInfo.getVendorVersion().toString()); + foxResponse.add("vendor", moduleInfo.getVendor()); + foxResponse.add("bajaVersion", moduleInfo.getBajaVersion().toString()); + foxResponse.add("description", moduleInfo.getDescription()); + TypeInfo[] typeInfoArray = moduleInfo.getTypes(); + int n = 0; + while (n < typeInfoArray.length) { + foxResponse.add("types", typeInfoArray[n].getTypeClassName()); + ++n; + } + DependencyInfo[] dependencyInfoArray = moduleInfo.getDependencies(); + int n2 = 0; + while (n2 < dependencyInfoArray.length) { + foxResponse.add("dependency", dependencyInfoArray[n2].getModuleName()); + if (dependencyInfoArray[n2].getBajaVersion() != null) { + foxResponse.add("dependency_bajaVersion", dependencyInfoArray[n2].getBajaVersion().toString()); + } else { + foxResponse.add("dependency_bajaVersion", "0.0"); + } + if (dependencyInfoArray[n2].getVendorVersion() != null) { + foxResponse.add("dependency_vendorVersion", dependencyInfoArray[n2].getVendorVersion().toString()); + } else { + foxResponse.add("dependency_vendorVersion", "0.0"); + } + if (dependencyInfoArray[n2].getVendor() != null) { + foxResponse.add("dependency_vendor", dependencyInfoArray[n2].getVendor()); + } else { + foxResponse.add("dependency_vendor", ""); + } + ++n2; + } + return foxResponse; + } + + Type loadType(ValueDocDecoder valueDocDecoder, NModule nModule, BTypeSpec bTypeSpec) throws Exception { + if (this.isTraceOn()) { + this.trace("Synthesizing type " + bTypeSpec); + } + FoxRequest foxRequest = this.makeRequest("loadType"); + foxRequest.add("type", bTypeSpec.toString()); + FoxResponse foxResponse = this.sendSync(foxRequest); + String string = foxResponse.getString("classname"); + boolean bl = foxResponse.getBoolean("abstract", false); + BTypeSpec bTypeSpec2 = BTypeSpec.make((String)((FoxMessage)foxResponse.get("superType")).getString("typespec")); + Object object = this.typeResolver.loadModule(valueDocDecoder, null, null, bTypeSpec2.getModuleName() + '=' + bTypeSpec2.getModuleName(), bTypeSpec2.toString()); + TypeInfo typeInfo = object.getType(bTypeSpec2.getTypeName()).getTypeInfo(); + TypeInfo[] typeInfoArray = new TypeInfo[]{}; + boolean bl2 = false; + if (typeInfo.is(BSimple.TYPE) && !bl) { + bl2 = true; + } + bTypeSpec2 = SyntheticCompiler.compile((String)string, (TypeInfo)typeInfo, (TypeInfo[])typeInfoArray, (boolean)bl, (boolean)bl2, (boolean)true, (byte[])foxResponse.getBlob("default", null)); + SyntheticModuleClassLoader syntheticModuleClassLoader = (SyntheticModuleClassLoader)nModule.getClassLoader(); + object = syntheticModuleClassLoader.ndefineClass(string, bTypeSpec2.bytes, 0, bTypeSpec2.count); + nModule.register(string.substring(string.lastIndexOf(46) + 2), string); + Type type = (Type)((Class)object).getField("TYPE").get(null); + if (type instanceof SyntheticEnumType) { + SyntheticEnumType syntheticEnumType = (SyntheticEnumType)type; + syntheticEnumType.setTypeInfo((TypeInfo)new SyntheticTypeInfo(type)); + String[] stringArray = foxResponse.listStrings("enum_ordinal"); + String[] stringArray2 = foxResponse.listStrings("enum_tag"); + int n = 0; + while (n < stringArray.length) { + syntheticEnumType.addEntry(Integer.parseInt(stringArray[n]), stringArray2[n]); + ++n; + } + } else if (type instanceof SyntheticComplexType) { + SyntheticComplexType syntheticComplexType = (SyntheticComplexType)type; + syntheticComplexType.setTypeInfo((TypeInfo)new SyntheticTypeInfo(type)); + String[] stringArray = foxResponse.listStrings("slot"); + String[] stringArray3 = foxResponse.listStrings("slot_name"); + String[] stringArray4 = foxResponse.listStrings("slot_type"); + String[] stringArray5 = foxResponse.listStrings("slot_flag"); + String[] stringArray6 = foxResponse.listStrings("slot_facets"); + String[] stringArray7 = foxResponse.listStrings("slot_value"); + int n = 0; + while (n < stringArray.length) { + ValueDocDecoder valueDocDecoder2; + ValueDocDecoder valueDocDecoder3; + BTypeSpec bTypeSpec3; + BFacets bFacets = (BFacets)BFacets.DEFAULT.decodeFromString(stringArray6[n]); + int n2 = Integer.parseInt(stringArray5[n]); + BTypeSpec bTypeSpec4 = bTypeSpec3 = stringArray4[n].length() == 0 ? null : BTypeSpec.make((String)stringArray4[n]); + if (stringArray[n].equals("p")) { + valueDocDecoder3 = new ValueDocDecoder((InputStream)new ByteArrayInputStream(stringArray7[n].getBytes())); + valueDocDecoder3.setTypeResolver((ValueDocDecoder.ITypeResolver)this.typeResolver); + try { + valueDocDecoder3.next(); + valueDocDecoder2 = valueDocDecoder3.decode(); + } + catch (XException xException) { + throw new BajaRuntimeException("Unable to decode default value for '" + stringArray3[n] + "' from " + stringArray7[n], (Throwable)xException); + } + BModule bModule = this.typeResolver.loadModule(valueDocDecoder, null, null, bTypeSpec3.getModuleName() + '=' + bTypeSpec3.getModuleName(), bTypeSpec3.toString()); + Type type2 = bModule.getType(bTypeSpec3.getTypeName()); + syntheticComplexType.addProperty(stringArray3[n], type2, n2, (BValue)valueDocDecoder2, bFacets); + } else if (stringArray[n].equals("a")) { + valueDocDecoder3 = null; + if (bTypeSpec3 != null) { + valueDocDecoder2 = new ValueDocDecoder((InputStream)new ByteArrayInputStream(stringArray7[n].getBytes())); + valueDocDecoder2.setTypeResolver((ValueDocDecoder.ITypeResolver)this.typeResolver); + valueDocDecoder2.next(); + valueDocDecoder3 = valueDocDecoder2.decode(); + } + syntheticComplexType.addAction(stringArray3[n], n2, (BValue)valueDocDecoder3, bFacets); + } else if (stringArray[n].equals("t")) { + valueDocDecoder3 = this.typeResolver.loadModule(valueDocDecoder, null, null, bTypeSpec3.getModuleName() + '=' + bTypeSpec3.getModuleName(), bTypeSpec3.toString()); + syntheticComplexType.addTopic(stringArray3[n], n2, valueDocDecoder3.getType(bTypeSpec3.getTypeName()), bFacets); + } + ++n; + } + } else if (type instanceof SimpleType) { + SyntheticSimpleType syntheticSimpleType = (SyntheticSimpleType)type; + syntheticSimpleType.setTypeInfo((TypeInfo)new SyntheticTypeInfo(type)); + } else { + throw new IllegalStateException("Invalid type " + type.getClass()); + } + return type; + } + + private final FoxResponse loadType(FoxRequest foxRequest) throws Exception { + Object object; + BTypeSpec bTypeSpec = BTypeSpec.make((String)foxRequest.getString("type")); + if (this.isTraceOn()) { + this.trace("s:loadType " + bTypeSpec.toString()); + } + Object object2 = object = new FoxResponse(foxRequest); + do { + int n; + Object object3; + Object object4; + ((FoxMessage)object2).add("classname", bTypeSpec.getResolvedType().getTypeClass().getName()); + ((FoxMessage)object2).add("typespec", bTypeSpec.toString()); + ((FoxMessage)object2).add("abstract", Modifier.isAbstract(bTypeSpec.getResolvedType().getTypeClass().getModifiers())); + if (bTypeSpec.getResolvedType().is(BSimple.TYPE) && !bTypeSpec.getResolvedType().isAbstract()) { + object4 = new ByteArrayOutputStream(); + object3 = new DataOutputStream((OutputStream)object4); + ((BSimple)bTypeSpec.getInstance()).encode((DataOutput)object3); + ((FoxMessage)object2).add("default", ((ByteArrayOutputStream)object4).toByteArray()); + } + if ((object4 = bTypeSpec.getResolvedType()) instanceof EnumType) { + if (object4 != BFrozenEnum.TYPE && (object3 = (Object)((EnumType)object4).getOrdinals()) != null) { + n = 0; + while (n < ((NSlot[])object3).length) { + ((FoxMessage)object2).add("enum_ordinal", Integer.toString((int)object3[n])); + ((FoxMessage)object2).add("enum_tag", ((EnumType)object4).getTag((int)object3[n])); + ++n; + } + } + } else if (object4 instanceof ComplexType) { + object3 = ((ComplexType)object4).getFrozenSlots(); + n = 0; + while (n < ((NSlot[])object3).length) { + if (object3[n].getDeclaringType().is(bTypeSpec.getResolvedType())) { + ValueDocEncoder valueDocEncoder; + ByteArrayOutputStream byteArrayOutputStream; + Object object5; + ((FoxMessage)object2).add("slot_name", object3[n].getName()); + ((FoxMessage)object2).add("slot_flag", Integer.toString(object3[n].getDefaultFlags())); + ((FoxMessage)object2).add("slot_facets", object3[n].getFacets().encodeToString()); + if (object3[n].isAction()) { + ((FoxMessage)object2).add("slot", "a"); + object5 = object3[n].asAction().getParameterType(); + if (object5 == null) { + ((FoxMessage)object2).add("slot_type", ""); + ((FoxMessage)object2).add("slot_value", ""); + } else { + ((FoxMessage)object2).add("slot_type", object5.toString()); + byteArrayOutputStream = new ByteArrayOutputStream(); + valueDocEncoder = new ValueDocEncoder((OutputStream)byteArrayOutputStream); + valueDocEncoder.encode(object3[n].asAction().getParameterDefault()); + valueDocEncoder.flush(); + ((FoxMessage)object2).add("slot_value", byteArrayOutputStream.toString()); + } + } else if (object3[n].isProperty()) { + ((FoxMessage)object2).add("slot", "p"); + ((FoxMessage)object2).add("slot_type", object3[n].asProperty().getType().toString()); + object5 = new ByteArrayOutputStream(); + byteArrayOutputStream = new ValueDocEncoder((OutputStream)object5); + valueDocEncoder = object3[n].asProperty().getDefaultValue(); + byteArrayOutputStream.encode((BValue)valueDocEncoder); + byteArrayOutputStream.flush(); + ((FoxMessage)object2).add("slot_value", ((ByteArrayOutputStream)object5).toString()); + } else if (object3[n].isTopic()) { + ((FoxMessage)object2).add("slot", "t"); + object5 = object3[n].asTopic().getEventType(); + if (object5 == null) { + ((FoxMessage)object2).add("slot_type", ""); + } else { + ((FoxMessage)object2).add("slot_type", object5.toString()); + } + ((FoxMessage)object2).add("slot_value", ""); + } + } + ++n; + } + } + if (bTypeSpec.getTypeInfo().getSuperType() != null && !bTypeSpec.getModuleName().equals(Sys.getBajaModule().getModuleName())) { + object3 = new FoxMessage("superType"); + ((FoxMessage)object2).add((FoxTuple)object3); + object2 = object3; + bTypeSpec = bTypeSpec.getTypeInfo().getSuperType().getTypeSpec(); + continue; + } + bTypeSpec = null; + } while (bTypeSpec != null); + return object; + } + + RootInfo loadRoot() throws Exception { + FoxRequest foxRequest = this.makeRequest("loadRoot"); + FoxResponse foxResponse = this.sendSync(foxRequest); + String string = foxResponse.getString("handle"); + BTypeSpec bTypeSpec = BTypeSpec.make((String)foxResponse.getString("type")); + boolean bl = foxResponse.getBoolean("spaceReadonly", false); + long l = foxResponse.getTime("defaultLeaseTime", 60000L); + if (this.isTraceOn()) { + this.trace("c:loadRoot " + string + ' ' + bTypeSpec); + } + BComponent bComponent = (BComponent)bTypeSpec.getInstance(); + ((ComponentSlotMap)bComponent.fw(1)).setHandle((Object)string); + return new RootInfo(bComponent, bl, l); + } + + private final FoxResponse loadRoot(FoxRequest foxRequest) throws Exception { + if (this.isTraceOn()) { + this.trace("s:loadRoot"); + } + BComponent bComponent = this.space.getRootComponent(); + FoxResponse foxResponse = new FoxResponse(foxRequest); + foxResponse.add("handle", String.valueOf(bComponent.getHandle())); + foxResponse.add("type", bComponent.getType().toString()); + foxResponse.add("spaceReadonly", this.space.isSpaceReadonly()); + foxResponse.add("defaultLeaseTime", this.space.getDefaultLeaseTime()); + return foxResponse; + } + + public void ensureLoaded(String[] stringArray, int n) throws Exception { + FoxRequest foxRequest = this.space instanceof BFoxVirtualSpace ? this.makeRequest("loadSlot") : this.makeRequest("load"); + foxRequest.add("depth", n); + int n2 = 0; + while (n2 < stringArray.length) { + foxRequest.add("ord", stringArray[n2].toString()); + ++n2; + } + if (this.isTraceOn()) { + this.trace("c:ensureLoaded[" + stringArray.length + "] depth=" + n); + n2 = 0; + while (n2 < stringArray.length) { + this.trace(" " + stringArray[n2]); + ++n2; + } + } + this.sendSync(foxRequest); + this.syncFromMaster(); + } + + public void load(BComponent bComponent, int n) throws Exception { + this.load(bComponent, n, false); + } + + public void load(BComponent bComponent, int n, boolean bl) throws Exception { + String string = this.toOrd(bComponent); + FoxRequest foxRequest = this.makeRequest("load"); + foxRequest.add("ord", string); + foxRequest.add("depth", n); + if (bl) { + foxRequest.add("reload", bl); + } + if (this.isTraceOn()) { + if (bl) { + this.trace("c:load \"" + bComponent.toPathString() + "\" depth=" + n + "\" reload=" + bl); + } else { + this.trace("c:load \"" + bComponent.toPathString() + "\" depth=" + n); + } + } + this.sendSync(foxRequest); + this.syncFromMaster(); + if (bComponent instanceof BVirtualComponent) { + ((ComponentSlotMap)bComponent.fw(1)).setBrokerPropsLoaded(true); + } + } + + private final FoxResponse load(FoxRequest foxRequest) throws Exception { + int n = foxRequest.getInt("depth"); + boolean bl = foxRequest.getBoolean("reload", false); + FoxTuple[] foxTupleArray = foxRequest.list("ord"); + int n2 = 0; + while (n2 < foxTupleArray.length) { + String string = ((FoxString)foxTupleArray[n2]).value; + try { + BComponent bComponent = this.fromOrd(string); + if (this.isTraceOn()) { + if (foxTupleArray.length == 1) { + this.trace("s:load \"" + bComponent.toPathString() + "\" depth=" + n); + } else { + if (n2 == 0) { + this.trace("s:load[" + foxTupleArray.length + "] depth=" + n); + } + this.trace(" \"" + bComponent.toPathString() + '\"'); + } + } + BUser bUser = this.getSessionContext().getUser(); + bUser.check((BIProtected)bComponent, BPermissions.operatorRead); + if (this.space instanceof BVirtualComponentSpace) { + if (bl) { + ((ComponentSlotMap)bComponent.fw(1)).setBrokerPropsLoaded(false); + } + bComponent.loadSlots(); + this.broker.loadOp(bComponent, n, bComponent instanceof BVirtualComponent); + } else { + if (this.space instanceof BIGatewaySpace) { + bComponent.loadSlots(); + } + this.broker.loadOp(bComponent, n); + } + } + catch (Exception exception) {} + ++n2; + } + return null; + } + + public Slot loadSlot(BComponent bComponent, String string, int n) throws Exception { + String string2 = this.toOrd(bComponent); + FoxRequest foxRequest = this.makeRequest("loadSlot"); + foxRequest.add("ord", string2); + foxRequest.add("slotName", string); + foxRequest.add("depth", n); + if (this.isTraceOn()) { + this.trace("c:loadSlot \"" + bComponent.toPathString() + "\" slotName= \"" + string + "\" depth=" + n); + } + this.sendSync(foxRequest); + this.syncFromMaster(); + return bComponent.getSlot(string); + } + + /* + * Exception decompiling + */ + private final FoxResponse loadSlot(FoxRequest var1_1) throws Exception { + /* + * This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. + * + * org.benf.cfr.reader.util.ConfusedCFRException: Back jump on a try block [egrp 3[TRYBLOCK] [3 : 490->493)] java.lang.Throwable + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.insertExceptionBlocks(Op02WithProcessedDataAndRefs.java:2283) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:415) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201) + * at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94) + * at org.benf.cfr.reader.entities.Method.analyse(Method.java:531) + * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055) + * at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942) + * at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257) + * at org.benf.cfr.reader.Driver.doJar(Driver.java:139) + * at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76) + * at org.benf.cfr.reader.Main.main(Main.java:54) + */ + throw new IllegalStateException("Decompilation failed"); + } + + public BValue[] copy(BValue[] bValueArray, CopyHints copyHints) throws Exception { + Object object; + BValue[] bValueArray2 = new BValue[bValueArray.length]; + if (this.isTraceOn()) { + this.trace("c:copy[" + bValueArray.length + ']'); + int n = 0; + while (n < bValueArray.length) { + if (bValueArray[n] instanceof BComponent) { + this.trace(" \"" + ((BComponent)bValueArray[n]).toPathString() + '\"'); + } + ++n; + } + } + FoxRequest foxRequest = this.makeRequest("copy"); + foxRequest.add("defaultOnClone", copyHints.defaultOnClone); + foxRequest.add("swizzleHandles", copyHints.swizzleHandles); + int n = 0; + while (n < bValueArray.length) { + object = bValueArray[n]; + if (object.isComponent()) { + foxRequest.add("ord", this.toOrd((BComponent)object)); + } else { + bValueArray2[n] = object.newCopy(copyHints); + } + ++n; + } + FoxCircuit foxCircuit = this.openCircuit("copy"); + foxCircuit.writeMessage(foxRequest); + object = foxCircuit.readMessage(); + if (((FoxMessage)object).getString("exception", null) != null) { + throw Fox.exceptionTranslator.messageToException((FoxMessage)object); + } + ValueDocDecoder valueDocDecoder = new ValueDocDecoder(foxCircuit.getInputStream()); + int n2 = 0; + while (n2 < bValueArray2.length) { + if (bValueArray2[n2] == null) { + valueDocDecoder.next(); + bValueArray2[n2] = valueDocDecoder.decode(); + } + ++n2; + } + valueDocDecoder.close(); + return bValueArray2; + } + + private final void copy(FoxCircuit foxCircuit) throws Exception { + Object object; + FoxMessage foxMessage = foxCircuit.readMessage(); + CopyHints copyHints = new CopyHints(); + copyHints.defaultOnClone = foxMessage.getBoolean("defaultOnClone", copyHints.defaultOnClone); + copyHints.swizzleHandles = foxMessage.getBoolean("swizzleHandles", copyHints.swizzleHandles); + copyHints.cx = this.getSessionContext(); + FoxTuple[] foxTupleArray = foxMessage.list("ord"); + BValue[] bValueArray = new BValue[foxTupleArray.length]; + int n = 0; + while (n < foxTupleArray.length) { + String string = ((FoxString)foxTupleArray[n]).value; + object = this.fromOrd(string); + bValueArray[n] = object; + if (this.isTraceOn()) { + if (foxTupleArray.length == 1) { + this.trace("s:copy \"" + object.toPathString() + '\"'); + } else { + if (n == 0) { + this.trace("s:copy[" + foxTupleArray.length + ']'); + } + this.trace(" \"" + object.toPathString() + '\"'); + } + } + ++n; + } + try { + bValueArray = BValue.newCopy((BValue[])bValueArray, (CopyHints)copyHints); + } + catch (Exception exception) { + exception.printStackTrace(); + foxCircuit.writeMessage(Fox.exceptionTranslator.exceptionToMessage(exception)); + foxCircuit.close(); + return; + } + foxCircuit.writeMessage(new FoxMessage()); + ValueDocEncoder valueDocEncoder = new ValueDocEncoder(foxCircuit.getOutputStream()); + valueDocEncoder.setEncodeTransients(true); + valueDocEncoder.setEncodeComments(false); + int n2 = 0; + while (n2 < bValueArray.length) { + object = new FoxMessage(); + valueDocEncoder.encode(bValueArray[n2]); + valueDocEncoder.flush(); + ++n2; + } + valueDocEncoder.close(); + } + + public DeleteOp delete(DeleteOp deleteOp, boolean bl) throws Exception { + if (this.isTraceOn()) { + this.trace("c:delete undo=" + bl); + } + FoxRequest foxRequest = this.makeRequest("delete"); + foxRequest.add("undo", bl); + FoxCircuit foxCircuit = this.openCircuit("delete"); + foxCircuit.writeMessage(foxRequest); + OutputStream outputStream = foxCircuit.getOutputStream(); + deleteOp.write(outputStream); + outputStream.flush(); + FoxMessage foxMessage = foxCircuit.readMessage(); + if (foxMessage.getString("exception", null) != null) { + throw Fox.exceptionTranslator.messageToException(foxMessage); + } + InputStream inputStream = foxCircuit.getInputStream(); + deleteOp = DeleteOp.make((BComponentSpace)this.space, null, (InputStream)inputStream); + inputStream.close(); + return deleteOp; + } + + private final void delete(FoxCircuit foxCircuit) throws Exception { + FoxMessage foxMessage = foxCircuit.readMessage(); + boolean bl = foxMessage.getBoolean("undo"); + if (this.isTraceOn()) { + this.trace("s:delete undo=" + bl); + } + InputStream inputStream = foxCircuit.getInputStream(); + DeleteOp deleteOp = DeleteOp.make((BComponentSpace)this.space, (Context)this.getSessionContext(), (InputStream)inputStream); + try { + deleteOp = bl ? deleteOp.undelete() : deleteOp.delete(); + } + catch (Exception exception) { + exception.printStackTrace(); + foxCircuit.writeMessage(Fox.exceptionTranslator.exceptionToMessage(exception)); + foxCircuit.close(); + return; + } + foxCircuit.writeMessage(new FoxMessage()); + OutputStream outputStream = foxCircuit.getOutputStream(); + deleteOp.write(outputStream); + outputStream.close(); + } + + public void subscribe(BComponent[] bComponentArray, int n) throws Exception { + if (this.isTraceOn()) { + if (bComponentArray.length == 1) { + this.trace("c:sub \"" + bComponentArray[0].toPathString() + "\" depth=" + n); + } else { + this.trace("c:sub[" + bComponentArray.length + "] depth=" + n); + int n2 = 0; + while (n2 < bComponentArray.length) { + this.trace(" " + bComponentArray[n2].toPathString()); + ++n2; + } + } + } + FoxRequest foxRequest = this.makeRequest("sub"); + int n3 = 0; + while (n3 < bComponentArray.length) { + foxRequest.add("ord", this.toOrd(bComponentArray[n3])); + ++n3; + } + foxRequest.add("depth", n); + this.sendSync(foxRequest); + this.syncFromMaster(); + } + + private final FoxResponse subscribe(FoxRequest foxRequest) throws Exception { + int n = foxRequest.getInt("depth"); + FoxTuple[] foxTupleArray = foxRequest.list("ord"); + int n2 = 0; + while (n2 < foxTupleArray.length) { + String string = ((FoxString)foxTupleArray[n2]).value; + BComponent bComponent = this.fromOrd(string); + if (this.isTraceOn()) { + if (foxTupleArray.length == 1) { + this.trace("s:sub \"" + bComponent.toPathString() + "\" n = " + bComponent.getName() + " depth=" + n + " ord = " + string); + } else { + if (n2 == 0) { + this.trace("s:sub[" + foxTupleArray.length + "] depth=" + n); + } + this.trace(" " + bComponent.toPathString()); + } + } + BUser bUser = this.getSessionContext().getUser(); + bUser.check((BIProtected)bComponent, BPermissions.operatorRead); + if (this.space instanceof BVirtualComponentSpace) { + this.broker.subscribeOp(bComponent, n, true); + } else { + this.broker.subscribeOp(bComponent, n); + } + ++n2; + } + return null; + } + + public void unsubscribe(BComponent[] bComponentArray) throws Exception { + FoxRequest foxRequest = this.makeRequest("unsub"); + int n = 0; + while (n < bComponentArray.length) { + try { + foxRequest.add("ord", this.toOrd(bComponentArray[n])); + } + catch (Exception exception) {} + ++n; + } + if (this.isTraceOn()) { + if (bComponentArray.length == 1) { + this.trace("c:unsub \"" + bComponentArray[0].toPathString() + '\"'); + } else { + this.trace("c:unsub[" + bComponentArray.length + ']'); + n = 0; + while (n < bComponentArray.length) { + this.trace(" " + bComponentArray[n].toPathString()); + ++n; + } + } + } + try { + this.sendAsync(foxRequest); + } + catch (NotConnectedException notConnectedException) {} + } + + private final FoxResponse unsubscribe(FoxRequest foxRequest) throws Exception { + FoxTuple[] foxTupleArray = foxRequest.list("ord"); + int n = 0; + while (n < foxTupleArray.length) { + String string = ((FoxString)foxTupleArray[n]).value; + try { + BComponent bComponent = this.fromOrd(string); + if (this.isTraceOn()) { + this.trace("s:unsub \"" + bComponent.toPathString() + '\"'); + } + this.broker.unsubscribe(this.fromOrd(string)); + } + catch (UnresolvedException unresolvedException) {} + ++n; + } + return null; + } + + public Object[] generateHandles(int n) throws Exception { + FoxRequest foxRequest = this.makeRequest("generateHandles"); + foxRequest.add("count", n); + if (this.isTraceOn()) { + this.trace("c:generateHandles " + n); + } + FoxResponse foxResponse = this.sendSync(foxRequest); + Object[] objectArray = new Object[n]; + StringTokenizer stringTokenizer = new StringTokenizer(foxResponse.getString("handles"), "|"); + int n2 = 0; + while (stringTokenizer.hasMoreTokens()) { + objectArray[n2] = stringTokenizer.nextToken(); + ++n2; + } + return objectArray; + } + + private final FoxResponse generateHandles(FoxRequest foxRequest) throws Exception { + int n = foxRequest.getInt("count"); + if (this.isTraceOn()) { + this.trace("s:generateHandles " + n); + } + Object[] objectArray = (Object[])this.space.fw(103, (Object)new Integer(n), null, null, null); + StringBuffer stringBuffer = new StringBuffer(objectArray.length * 5); + int n2 = 0; + while (n2 < objectArray.length) { + stringBuffer.append(objectArray[n2]).append('|'); + ++n2; + } + FoxResponse foxResponse = new FoxResponse(foxRequest); + foxResponse.add("handles", stringBuffer.toString()); + return foxResponse; + } + + public SlotPath[] handleToPath(Object[] objectArray) throws Exception { + FoxResponse foxResponse; + FoxTuple[] foxTupleArray; + FoxRequest foxRequest = this.makeRequest("handleToPath"); + int n = 0; + while (n < objectArray.length) { + foxRequest.add("handle", objectArray[n].toString()); + ++n; + } + if (this.isTraceOn()) { + if (objectArray.length == 1) { + this.trace("c:handleToPath \"" + objectArray[0] + '\"'); + } else { + this.trace("c:handleToPath[" + objectArray.length + ']'); + n = 0; + while (n < objectArray.length) { + this.trace(" \"" + objectArray[n] + '\"'); + ++n; + } + } + } + if ((foxTupleArray = (foxResponse = this.sendSync(foxRequest)).list("path")).length != objectArray.length) { + throw new IllegalStateException(); + } + SlotPath[] slotPathArray = new SlotPath[foxTupleArray.length]; + int n2 = 0; + while (n2 < foxTupleArray.length) { + String string = ((FoxString)foxTupleArray[n2]).value; + if (!string.equals("\u0000")) { + slotPathArray[n2] = new SlotPath(string); + } + ++n2; + } + return slotPathArray; + } + + private final FoxResponse handleToPath(FoxRequest foxRequest) throws Throwable { + FoxResponse foxResponse = new FoxResponse(foxRequest); + FoxTuple[] foxTupleArray = foxRequest.list("handle"); + int n = 0; + while (n < foxTupleArray.length) { + SlotPath slotPath; + String string = ((FoxString)foxTupleArray[n]).value; + if (this.isTraceOn()) { + if (foxTupleArray.length == 1) { + this.trace("s:handleToPath \"" + string + '\"'); + } else { + if (n == 0) { + this.trace("s:handleToPath[" + foxTupleArray.length + ']'); + } + this.trace(" \"" + string + '\"'); + } + } + String string2 = (slotPath = this.space.handleToSlotPath((Object)string)) == null ? "\u0000" : slotPath.getBody(); + foxResponse.add("path", string2); + ++n; + } + return foxResponse; + } + + public SlotPath serviceToPath(String string) throws Exception { + FoxResponse foxResponse; + String string2; + FoxRequest foxRequest = this.makeRequest("serviceToPath"); + foxRequest.add("typeSpec", string); + if (this.isTraceOn()) { + this.trace("c:serviceToPath " + string); + } + if ((string2 = (foxResponse = this.sendSync(foxRequest)).getString("path")) == null) { + return null; + } + return new SlotPath(string2); + } + + private final FoxResponse serviceToPath(FoxRequest foxRequest) throws Throwable { + FoxResponse foxResponse; + block3: { + String string = foxRequest.getString("typeSpec"); + if (this.isTraceOn()) { + this.trace("s:serviceToPath " + string); + } + foxResponse = new FoxResponse(foxRequest); + try { + Type type = Sys.getType((String)string); + BComponent bComponent = Sys.getService((Type)type); + SlotPath slotPath = bComponent.getSlotPath(); + foxResponse.add("path", slotPath.getBody()); + } + catch (ServiceNotFoundException serviceNotFoundException) { + if (!this.isTraceOn()) break block3; + this.trace("s:serviceToPath " + string + " - ERROR: not found"); + } + } + return foxResponse; + } + + public BValue invoke(BComponent bComponent, Action action, BValue bValue) throws Exception { + String string = this.toOrd(bComponent); + FoxRequest foxRequest = this.makeRequest("invoke"); + foxRequest.add("ord", string); + foxRequest.add("action", action.getName()); + BogCodec.add(foxRequest, "arg", bValue, null); + if (this.isTraceOn()) { + this.trace("c:invoke " + string + '.' + action.getName()); + } + FoxResponse foxResponse = this.sendSync(foxRequest); + return (BValue)DecoderFactory.decode(foxResponse, "return", null); + } + + private final FoxResponse invoke(FoxRequest foxRequest) throws Throwable { + String string = foxRequest.getString("ord"); + String string2 = foxRequest.getString("action"); + BValue bValue = (BValue)DecoderFactory.decode(foxRequest, "arg", null); + if (this.isTraceOn()) { + this.trace("s:invoke " + string + '.' + string2); + } + BComponent bComponent = this.fromOrd(string); + Action action = bComponent.getAction(string2); + BValue bValue2 = null; + Context context = this.getSessionContext(); + try { + bValue2 = bComponent.invoke(action, bValue, context); + } + catch (ActionInvokeException actionInvokeException) { + this.log.error("Cannot invoke action: " + string + ' ' + string2, actionInvokeException.getCause()); + throw actionInvokeException.getCause(); + } + catch (Exception exception) { + this.log.error("Cannot invoke action: " + string + ' ' + string2, exception); + throw exception; + } + FoxResponse foxResponse = new FoxResponse(foxRequest); + BogCodec.add(foxResponse, "return", bValue2, null); + return foxResponse; + } + + public BValue rpc(BComponent bComponent, String string, BValue bValue) throws Exception { + String string2 = this.toOrd(bComponent); + FoxRequest foxRequest = this.makeRequest("rpc"); + foxRequest.add("ord", string2); + foxRequest.add("id", string); + BogCodec.add(foxRequest, "arg", bValue, null); + if (this.isTraceOn()) { + this.trace("c:rpc " + string2 + '.' + string); + } + FoxResponse foxResponse = this.sendSync(foxRequest); + return (BValue)DecoderFactory.decode(foxResponse, "return", null); + } + + private final FoxResponse rpc(FoxRequest foxRequest) throws Throwable { + String string = foxRequest.getString("ord"); + String string2 = foxRequest.getString("id"); + BValue bValue = (BValue)DecoderFactory.decode(foxRequest, "arg", null); + if (this.isTraceOn()) { + this.trace("s:rpc " + string + '.' + string2); + } + BComponent bComponent = this.fromOrd(string); + BValue bValue2 = null; + Context context = this.getSessionContext(); + try { + bValue2 = (BValue)this.space.fw(109, (Object)bComponent, (Object)string2, (Object)bValue, (Object)context); + } + catch (Exception exception) { + this.log.error("Cannot invoke rpc: " + string + ' ' + string2, exception); + throw exception; + } + FoxResponse foxResponse = new FoxResponse(foxRequest); + BogCodec.add(foxResponse, "return", bValue2, null); + return foxResponse; + } + + public void touch(String[] stringArray) throws Exception { + FoxRequest foxRequest = this.makeRequest("touch"); + int n = 0; + while (n < stringArray.length) { + foxRequest.add("ord", stringArray[n]); + ++n; + } + if (this.isTraceOn()) { + this.trace("c:touch[" + stringArray.length + ']'); + n = 0; + while (n < stringArray.length) { + this.trace(" " + stringArray[n]); + ++n; + } + } + try { + this.sendAsync(foxRequest); + } + catch (NotConnectedException notConnectedException) {} + } + + private final FoxResponse touch(FoxRequest foxRequest) throws Throwable { + FoxTuple[] foxTupleArray = foxRequest.list("ord"); + if (foxTupleArray == null) { + return null; + } + if (this.isTraceOn()) { + this.trace("s:touch[" + foxTupleArray.length + ']'); + } + BOrd[] bOrdArray = new BOrd[foxTupleArray.length]; + int n = 0; + while (n < foxTupleArray.length) { + bOrdArray[n] = (BOrd)BOrd.DEFAULT.decodeFromString(((FoxString)foxTupleArray[n]).value); + if (this.isTraceOn()) { + this.trace(" " + bOrdArray[n]); + } + ++n; + } + this.space.fw(110, (Object)bOrdArray, null, null, null); + return null; + } + + public void syncToMaster(SyncBuffer syncBuffer) throws Exception { + if (this.isTraceOn()) { + this.trace("c:syncToMaster"); + } + BBrokerChannel.dump(syncBuffer, null); + FoxCircuit foxCircuit = this.openCircuit("syncToMaster"); + FoxMessage foxMessage = new FoxMessage(); + foxCircuit.writeMessage(foxMessage); + SyncEncoder syncEncoder = new SyncEncoder(foxCircuit.getOutputStream(), null); + syncBuffer.encode(syncEncoder); + syncEncoder.flush(); + FoxMessage foxMessage2 = foxCircuit.readMessage(); + FoxMessage foxMessage3 = (FoxMessage)foxMessage2.getOptional("error"); + if (foxMessage3 != null) { + throw Fox.exceptionTranslator.messageToException(foxMessage3); + } + this.syncFromMaster(); + } + + public void syncToMaster(FoxCircuit foxCircuit) throws Exception { + if (this.isTraceOn()) { + this.trace("s: --> syncToMaster"); + } + FoxMessage foxMessage = foxCircuit.readMessage(); + FoxMessage foxMessage2 = new FoxMessage(); + try { + SyncDecoder syncDecoder = new SyncDecoder(foxCircuit.getInputStream()); + try { + syncDecoder.setTypeResolver((ValueDocDecoder.ITypeResolver)this.typeResolver); + } + catch (Throwable throwable) {} + SyncBuffer syncBuffer = new SyncBuffer(this.space, false); + syncBuffer.decode(syncDecoder); + BBrokerChannel.dump(syncBuffer, null); + Context context = this.getSessionContext(); + syncBuffer.commit(context); + } + catch (Throwable throwable) { + throwable.printStackTrace(); + foxMessage2.add("error", Fox.exceptionTranslator.exceptionToMessage(throwable)); + } + foxCircuit.writeMessage(foxMessage2); + if (this.isTraceOn()) { + this.trace("s: <--- syncToMaster"); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Unable to fully structure code + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void syncFromMaster() throws Exception { + var1_1 = Clock.ticks(); + if (BBrokerChannel.syncLog.isTraceOn()) { + this.trace("c:doSyncFromMaster " + (var1_1 - this.lastSyncFromMaster) + "ms"); + } + this.lastSyncFromMaster = var1_1; + var3_2 = this.syncFromMasterLock; + synchronized (var3_2) { + var5_3 = this.openCircuit("syncFromMaster"); + var6_4 = new FoxMessage(); + var5_3.writeMessage(var6_4); + var7_5 = new SyncBuffer(this.space, false); + var8_6 = new SyncDecoder(var5_3.getInputStream()); + ** try [egrp 1[TRYBLOCK] [1 : 115->127)] { +lbl14: + // 1 sources + + { + var8_6.setTypeResolver((ValueDocDecoder.ITypeResolver)this.typeResolver); + } +lbl19: + // 1 sources + + catch (Throwable v1) {} + try { + var7_5.decode(var8_6); + var10_11 = null; + } + catch (Throwable var9_9) { + var10_10 = null; + var8_6.close(); + throw var9_9; + } + var8_6.close(); + this.syncBuffers.add(this.syncBuffers.size(), var7_5); + var11_8 = this.syncBuffers.toArray(new SyncBuffer[this.syncBuffers.size()]); + var12_12 = 0; + while (var12_12 < var11_8.length) { + var11_8[var12_12].commit(Context.commit); + ++var12_12; + } + this.syncBuffers.remove(var7_5); + return; + } + } + + public void syncFromMaster(FoxCircuit foxCircuit) throws Exception { + if (syncLog.isTraceOn()) { + this.trace("s:syncFromMaster"); + } + FoxMessage foxMessage = foxCircuit.readMessage(); + SyncBuffer syncBuffer = this.broker.detachBuffer(); + Context context = this.getSessionContext(); + BBrokerChannel.dump(syncBuffer, context); + SyncEncoder syncEncoder = new SyncEncoder(foxCircuit.getOutputStream(), context); + syncBuffer.encode(syncEncoder); + syncEncoder.close(); + } + + public TransferResult transfer(TransferStrategy transferStrategy) throws Exception { + Version version; + if (this.isTraceOn()) { + this.trace("c:transfer"); + transferStrategy.dump(); + } + if ((version = this.getConnection().getRemoteVersion()) == null || version.compareTo((Object)ver3_2_5) < 0) { + return this.transferReqRes(transferStrategy); + } + return this.transferCircuit(transferStrategy); + } + + private final TransferResult transferReqRes(TransferStrategy transferStrategy) throws Exception { + FoxRequest foxRequest = this.makeRequest("transfer"); + TransferCodec.transferToMessage(foxRequest, transferStrategy); + FoxResponse foxResponse = this.sendSync(foxRequest); + if (this.isTraceOn()) { + if (foxResponse == null) { + this.trace(" resp: null"); + } else { + foxResponse.dump(); + } + } + TransferResult transferResult = TransferCodec.messageToResult((BObject)this.space, foxResponse); + this.syncFromMaster(); + return transferResult; + } + + FoxResponse transferReqRes(FoxRequest foxRequest) throws Exception { + Context context = this.getSessionContext(); + TransferStrategy transferStrategy = TransferCodec.messageToTransfer(foxRequest, context); + if (this.isTraceOn()) { + this.trace("s:transfer"); + transferStrategy.dump(); + } + FoxResponse foxResponse = new FoxResponse(foxRequest); + TransferResult transferResult = transferStrategy.transfer(); + if (transferResult == null) { + return null; + } + return TransferCodec.resultToMessage(foxResponse, transferResult); + } + + private final TransferResult transferCircuit(TransferStrategy transferStrategy) throws Exception { + FoxMessage foxMessage; + FoxRequest foxRequest = this.makeRequest("transferCircuit"); + TransferCodec.transferToMessage(foxRequest, transferStrategy); + FoxCircuit foxCircuit = this.openCircuit("transferCircuit"); + foxCircuit.writeMessage(foxRequest); + while (true) { + foxMessage = null; + foxMessage = foxCircuit.readMessage(); + String string = foxMessage.getString("s", null); + if (string == null) break; + transferStrategy.updateStatus(string); + } + if (foxMessage.getString("exception", null) != null) { + throw Fox.exceptionTranslator.messageToException(foxMessage); + } + if (foxMessage.getBoolean("done", false)) { + TransferResult transferResult = TransferCodec.messageToResult((BObject)this.space, foxMessage); + this.syncFromMaster(); + return transferResult; + } + throw new IllegalStateException(); + } + + void transferCircuit(FoxCircuit foxCircuit) throws Exception { + try { + Context context = this.getSessionContext(); + FoxMessage foxMessage = foxCircuit.readMessage(); + TransferStrategy transferStrategy = TransferCodec.messageToTransfer(foxMessage, context); + if (this.isTraceOn()) { + this.trace("s:transfer"); + transferStrategy.dump(); + } + transferStrategy.setListener((TransferListener)new BFoxChannel.TransferStatusPipe(foxCircuit)); + TransferResult transferResult = transferStrategy.transfer(); + FoxResponse foxResponse = TransferCodec.resultToMessage(new FoxResponse(), transferResult); + foxResponse.add("done", true); + foxCircuit.writeMessage(foxResponse); + } + catch (Exception exception) { + exception.printStackTrace(); + foxCircuit.writeMessage(Fox.exceptionTranslator.exceptionToMessage(exception)); + } + foxCircuit.close(); + } + + public void spy(SpyWriter spyWriter) throws Exception { + if (this.broker != null) { + this.broker.spy(spyWriter); + } + super.spy(spyWriter); + } + + public final String toOrd(BComponent bComponent) { + String string = (String)bComponent.getHandle(); + if (string == null) { + throw new IllegalStateException(bComponent.toDebugString()); + } + return "h:" + string; + } + + public final BComponent fromOrd(String string) { + return (BComponent)BOrd.make((String)string).get((BObject)this.space); + } + + public static void dump(SyncBuffer syncBuffer, Context context) throws Exception { + if (DUMP_BUF) { + try { + SyncEncoder syncEncoder = new SyncEncoder((OutputStream)System.out, context); + syncBuffer.encode(syncEncoder); + syncEncoder.flush(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + } + + public void doSubscriberGc() { + ProxyBroker proxyBroker = this.broker; + if (proxyBroker != null) { + proxyBroker.gc(); + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.typeResolver = new BrokerTypeResolver(); + this.syncFromMasterLock = new Object(); + this.syntheticModuleMap = null; + this.syncBuffers = Collections.synchronizedList(new ArrayList()); + this.eventCache = new ThreadLocal(); + } + + public BBrokerChannel() { + super("broker"); + this.this(); + } + + static { + Class clazz = class$com$tridium$fox$sys$broker$BBrokerChannel; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$broker$BBrokerChannel = BBrokerChannel.class("[Lcom.tridium.fox.sys.broker.BBrokerChannel;", false); + } + TYPE = Sys.loadType((Class)clazz); + ver3_2_5 = new Version("3.2.5"); + DUMP_BUF = false; + POLL_RATE = 500; + syncLog = Log.getLog((String)"fox.broker.sync"); + } + + static class RootInfo { + BComponent root; + boolean spaceReadonly; + long defaultLeaseTime; + + RootInfo(BComponent bComponent, boolean bl, long l) { + this.root = bComponent; + this.spaceReadonly = bl; + this.defaultLeaseTime = l; + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + class ClientSyncThread + extends Thread { + boolean isAlive; + int count; + + public void kill() { + this.isAlive = false; + this.interrupt(); + } + + public synchronized void run() { + while (this.isAlive) { + try { + ClientSyncThread.sleep(POLL_RATE); + if (Clock.ticks() - BBrokerChannel.this.lastSyncFromMaster < (long)POLL_RATE) continue; + BBrokerChannel.this.syncFromMaster(); + } + catch (InterruptedException interruptedException) { + } + catch (Exception exception) { + if (!this.isAlive) continue; + exception.printStackTrace(); + } + } + } + + private final /* synthetic */ void this() { + this.isAlive = true; + } + + ClientSyncThread(String string) { + super(Fox.threadGroup, string); + this.this(); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + class FoxProxyBroker + extends ProxyBroker { + public void event(BComponentEvent bComponentEvent) { + Array array = (Array)BBrokerChannel.this.eventCache.get(); + if (array != null) { + array.add((Object)bComponentEvent); + return; + } + super.event(bComponentEvent); + } + + public void navEvent(NavEvent navEvent) { + Array array = (Array)BBrokerChannel.this.eventCache.get(); + if (array != null) { + array.add((Object)navEvent); + return; + } + super.navEvent(navEvent); + if (!(navEvent.getParent() instanceof BComponent)) { + return; + } + switch (navEvent.getId()) { + case 2: + case 5: { + BBrokerChannel.this.subscriberGc(); + break; + } + } + } + + public String toString() { + return "ProxyBroker for FoxServerConnection [" + BBrokerChannel.this.getConnection().session() + ']'; + } + + FoxProxyBroker(BComponentSpace bComponentSpace) { + super(bComponentSpace); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + class BrokerTypeResolver + extends ValueDocDecoder.BogTypeResolver { + public BModule loadModule(ValueDocDecoder valueDocDecoder, BComplex bComplex, String string, String string2, String string3) { + try { + return super.loadModule(valueDocDecoder, bComplex, string, string2, string3); + } + catch (XException xException) { + int n = string2.indexOf(61); + String string4 = string2.substring(0, n).trim(); + String string5 = string2.substring(n + 1).trim(); + Throwable throwable = xException.getCause(); + if (throwable instanceof ModuleException && Fox.appName.equals("Station")) { + try { + this.getModuleMap(valueDocDecoder).put(string4, null); + } + catch (Exception exception) { + throw xException; + } + if (syncLog.isTraceOn()) { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("Skipping property '").append(string); + stringBuffer.append("', type='").append(string3); + stringBuffer.append("' on parent '"); + if (bComplex == null) { + stringBuffer.append("null"); + } else { + stringBuffer.append(bComplex.getType().getDisplayName(null)); + } + stringBuffer.append("': ").append(xException.getMessage()); + stringBuffer.append(" [").append(valueDocDecoder.line()).append(":").append(valueDocDecoder.column()).append("]"); + syncLog.trace(stringBuffer.toString()); + } + return null; + } + NModule nModule = BBrokerChannel.this.loadModule(valueDocDecoder, string4, string5); + this.getModuleMap(valueDocDecoder).put(string4, nModule); + return nModule.bmodule(); + } + } + + NModule getModule(ValueDocDecoder valueDocDecoder, String string) { + return (NModule)this.getModuleMap(valueDocDecoder).get(string); + } + + public BValue newInstance(ValueDocDecoder valueDocDecoder, BComplex bComplex, String string, Property property, String string2) { + try { + return super.newInstance(valueDocDecoder, bComplex, string, property, string2); + } + catch (RuntimeException runtimeException) { + Throwable throwable = runtimeException.getCause(); + if (throwable instanceof ModuleException && Fox.appName.equals("Station")) { + if (syncLog.isTraceOn()) { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("Skipping property '").append(string); + stringBuffer.append("', type='").append(string2); + stringBuffer.append("' on parent '"); + if (bComplex == null) { + stringBuffer.append("null"); + } else { + stringBuffer.append(bComplex.getType().getDisplayName(null)); + } + stringBuffer.append("': ").append(runtimeException.getMessage()); + stringBuffer.append(" [").append(valueDocDecoder.line()).append(":").append(valueDocDecoder.column()).append("]"); + syncLog.trace(stringBuffer.toString()); + } + try { + valueDocDecoder.skip(); + } + catch (XException xException) { + throw xException; + } + catch (Exception exception) { + throw new XException((Throwable)exception); + } + return null; + } + throw runtimeException; + } + } + + BrokerTypeResolver() { + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/broker/BFoxComponentSpace.java b/modules/cfr_output/com/tridium/fox/sys/broker/BFoxComponentSpace.java new file mode 100644 index 0000000..d3c1b5c --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/broker/BFoxComponentSpace.java @@ -0,0 +1,563 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.schema.ComponentSlotMap + * com.tridium.sys.transfer.DeleteOp + * com.tridium.sys.transfer.RemoteTransferSpace + * com.tridium.sys.transfer.TransferResult + * com.tridium.sys.transfer.TransferStrategy + * javax.baja.log.Log + * javax.baja.naming.BOrd + * javax.baja.naming.OrdQuery + * javax.baja.naming.SlotPath + * javax.baja.naming.UnresolvedException + * javax.baja.net.NotConnectedException + * javax.baja.nre.util.Array + * javax.baja.space.BComponentSpace + * javax.baja.space.LoadCallbacks + * javax.baja.space.SubscribeCallbacks + * javax.baja.space.TrapCallbacks + * javax.baja.spy.SpyWriter + * javax.baja.sync.BProxyComponentSpace + * javax.baja.sync.SyncBuffer + * javax.baja.sync.SyncOp + * javax.baja.sync.Transaction + * javax.baja.sync.TrapToSyncBuffer + * javax.baja.sys.Action + * javax.baja.sys.ActionInvokeException + * javax.baja.sys.BAbsTime + * javax.baja.sys.BComplex + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.Clock + * javax.baja.sys.Context + * javax.baja.sys.CopyHints + * javax.baja.sys.Property + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.LexiconText + * javax.baja.virtual.BVirtualComponent + * javax.baja.virtual.VirtualPath + */ +package com.tridium.fox.sys.broker; + +import com.tridium.fox.sys.BFoxChannelRegistry; +import com.tridium.fox.sys.BFoxSession; +import com.tridium.fox.sys.BIFoxProxySpace; +import com.tridium.fox.sys.broker.BBrokerChannel; +import com.tridium.sys.schema.ComponentSlotMap; +import com.tridium.sys.transfer.DeleteOp; +import com.tridium.sys.transfer.RemoteTransferSpace; +import com.tridium.sys.transfer.TransferResult; +import com.tridium.sys.transfer.TransferStrategy; +import java.util.HashMap; +import java.util.Iterator; +import javax.baja.log.Log; +import javax.baja.naming.BOrd; +import javax.baja.naming.OrdQuery; +import javax.baja.naming.SlotPath; +import javax.baja.naming.UnresolvedException; +import javax.baja.net.NotConnectedException; +import javax.baja.nre.util.Array; +import javax.baja.space.BComponentSpace; +import javax.baja.space.LoadCallbacks; +import javax.baja.space.SubscribeCallbacks; +import javax.baja.space.TrapCallbacks; +import javax.baja.spy.SpyWriter; +import javax.baja.sync.BProxyComponentSpace; +import javax.baja.sync.SyncBuffer; +import javax.baja.sync.SyncOp; +import javax.baja.sync.Transaction; +import javax.baja.sync.TrapToSyncBuffer; +import javax.baja.sys.Action; +import javax.baja.sys.ActionInvokeException; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Clock; +import javax.baja.sys.Context; +import javax.baja.sys.CopyHints; +import javax.baja.sys.Property; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.LexiconText; +import javax.baja.virtual.BVirtualComponent; +import javax.baja.virtual.VirtualPath; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BFoxComponentSpace +extends BProxyComponentSpace +implements RemoteTransferSpace, +BIFoxProxySpace { + public static final Type TYPE; + public static final Log log; + BBrokerChannel channel; + HashMap subscribed; + boolean spaceReadonly; + long defaultLeaseTime; + static /* synthetic */ Class class$com$tridium$fox$sys$broker$BFoxComponentSpace; + static /* synthetic */ Class class$java$lang$String; + static /* synthetic */ Class class$javax$baja$sys$BComponent; + + public Type getType() { + return TYPE; + } + + public void init(BFoxSession bFoxSession) throws Exception { + BFoxChannelRegistry bFoxChannelRegistry = bFoxSession.getConnection().getChannels(); + this.channel = bFoxChannelRegistry.getSysChannel().makeBrokerChannel(this); + } + + public void cleanup(BFoxSession bFoxSession) throws Exception { + BFoxChannelRegistry bFoxChannelRegistry = bFoxSession.getConnection().getChannels(); + this.channel.cleanupClient(); + bFoxChannelRegistry.remove(this.channel.getPropertyInParent()); + this.channel = null; + } + + public boolean isSpaceReadonly() { + return this.spaceReadonly; + } + + public long getDefaultLeaseTime() { + return this.defaultLeaseTime; + } + + protected BComponent loadByHandle(Object object) { + SlotPath slotPath = this.handleToSlotPath(object); + if (slotPath == null) { + throw new UnresolvedException(String.valueOf(object)); + } + try { + return (BComponent)BOrd.make((OrdQuery)slotPath).get((BObject)this); + } + catch (Throwable throwable) { + log.error("loadByHandle(" + object + "): " + throwable); + throw BFoxSession.toException(throwable); + } + } + + public SlotPath handleToSlotPath(Object object) { + SlotPath slotPath = super.handleToSlotPath(object); + if (slotPath != null) { + return slotPath; + } + try { + return this.channel().handleToPath(new Object[]{object})[0]; + } + catch (Throwable throwable) { + log.error("handleToSlotPath(" + object + "): " + throwable); + throw BFoxSession.toException(throwable); + } + } + + public SlotPath[] handlesToSlotPaths(Object[] objectArray) { + boolean bl = true; + SlotPath[] slotPathArray = new SlotPath[objectArray.length]; + int n = 0; + while (n < slotPathArray.length) { + slotPathArray[n] = super.handleToSlotPath(objectArray[n]); + if (slotPathArray[n] == null) { + bl = false; + break; + } + ++n; + } + if (bl) { + return slotPathArray; + } + try { + return this.channel().handleToPath(objectArray); + } + catch (Throwable throwable) { + log.error("handlesToSlotPaths(" + objectArray.length + "): " + throwable); + throw BFoxSession.toException(throwable); + } + } + + public Object fw(int n, Object object, Object object2, Object object3, Object object4) { + switch (n) { + case 103: { + return this.generateHandles((Integer)object); + } + case 104: { + this.ensureLoaded((SlotPath[])object); + return null; + } + case 106: { + return this.delete((DeleteOp)object, false); + } + case 107: { + return this.delete((DeleteOp)object, true); + } + case 109: { + return this.rpc((BComponent)object, (String)object2, (BValue)object3); + } + } + return super.fw(n, object, object2, object3, object4); + } + + private final Object[] generateHandles(int n) { + try { + return this.channel().generateHandles(n); + } + catch (Throwable throwable) { + log.error("generateHandles(): " + throwable); + throw BFoxSession.toException(throwable); + } + } + + private final DeleteOp delete(DeleteOp deleteOp, boolean bl) { + try { + deleteOp = this.channel().delete(deleteOp, bl); + this.sync(); + return deleteOp; + } + catch (Throwable throwable) { + log.error("deleteOp(): " + throwable); + throw BFoxSession.toException(throwable); + } + } + + private final BValue rpc(BComponent bComponent, String string, BValue bValue) { + try { + return this.channel().rpc(bComponent, string, bValue); + } + catch (Throwable throwable) { + log.error("rpc(): " + throwable); + throw BFoxSession.toException(throwable); + } + } + + public final BBrokerChannel channel() throws Exception { + if (this.channel == null) { + throw new NotConnectedException(); + } + return this.channel; + } + + public void ensureLoaded(SlotPath[] slotPathArray) { + try { + Class clazz = class$java$lang$String; + if (clazz == null) { + clazz = class$java$lang$String = BFoxComponentSpace.class("[Ljava.lang.String;", false); + } + Array array = new Array(clazz); + HashMap hashMap = new HashMap(); + StringBuffer stringBuffer = new StringBuffer(); + int n = 0; + while (n < slotPathArray.length) { + SlotPath slotPath = slotPathArray[n]; + boolean bl = slotPath instanceof VirtualPath; + stringBuffer.setLength(0); + if (bl) { + stringBuffer.append("virtual:"); + } else { + stringBuffer.append("slot:"); + } + BComponent bComponent = this.getRootComponent(); + int n2 = 0; + while (n2 < slotPath.depth()) { + Object object; + String string = slotPath.nameAt(n2); + stringBuffer.append('/').append(string); + if (bl) { + string = SlotPath.escape((String)string); + } + if (bComponent instanceof BComplex) { + ComponentSlotMap componentSlotMap; + object = ((BComplex)bComponent).getSlot(string); + if (object instanceof Property) { + bComponent = ((BComplex)bComponent).get((Property)object); + } else if (object == null) { + bComponent = null; + } + if (bComponent instanceof BComponent && !(componentSlotMap = (ComponentSlotMap)bComponent.fw(1)).isBrokerPropsLoaded() && !(bComponent instanceof BVirtualComponent)) { + bComponent = null; + } + } + if (bComponent == null && hashMap.get(object = stringBuffer.toString()) == null) { + hashMap.put((Slot)object, (Slot)object); + array.add(object); + } + ++n2; + } + ++n; + } + if (array.size() == 0) { + return; + } + this.channel().ensureLoaded((String[])array.trim(), 0); + } + catch (Throwable throwable) { + log.error("ensureLoaded(): " + throwable); + throw BFoxSession.toException(throwable); + } + } + + public Transaction newTransaction(Context context) { + return new Transaction((BComponentSpace)this, context){ + + public final void commit(Context context) throws Exception { + BFoxComponentSpace.this.channel().syncToMaster((SyncBuffer)this); + } + }; + } + + public void sync() throws Exception { + this.channel().syncFromMaster(); + } + + public boolean fireDirectCallbacks() { + return false; + } + + public TransferResult transfer(TransferStrategy transferStrategy) throws Exception { + try { + return this.channel().transfer(transferStrategy); + } + catch (Exception exception) { + throw BFoxSession.toException(exception); + } + } + + public void spy(SpyWriter spyWriter) throws Exception { + super.spy(spyWriter); + spyWriter.startProps("Subscribed"); + Iterator iterator = this.subscribed.keySet().iterator(); + while (iterator.hasNext()) { + BComponent bComponent = (BComponent)iterator.next(); + BAbsTime bAbsTime = (BAbsTime)this.subscribed.get(bComponent); + spyWriter.tr((Object)bComponent.toPathString(), (Object)bAbsTime); + } + spyWriter.endProps(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.subscribed = new HashMap(); + this.spaceReadonly = false; + this.defaultLeaseTime = 60000L; + } + + public BFoxComponentSpace(String string, LexiconText lexiconText, BOrd bOrd) { + super(string, lexiconText, bOrd); + this.this(); + this.setLoadCallbacks(new FoxLoadCallbacks()); + this.setTrapCallbacks((TrapCallbacks)new FoxTrapCallbacks()); + this.setSubscribeCallbacks(new FoxSubscribeCallbacks()); + } + + static { + Class clazz = class$com$tridium$fox$sys$broker$BFoxComponentSpace; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$broker$BFoxComponentSpace = BFoxComponentSpace.class("[Lcom.tridium.fox.sys.broker.BFoxComponentSpace;", false); + } + TYPE = Sys.loadType((Class)clazz); + log = Log.getLog((String)"FoxSpace"); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + class FoxLoadCallbacks + extends LoadCallbacks { + public boolean isLazyLoad() { + return true; + } + + public void loadSlots(BComponent bComponent) { + try { + BFoxComponentSpace.this.channel().load(bComponent, 0); + } + catch (Throwable throwable) { + log.error("loadSlots(" + bComponent.toPathString() + "): " + throwable); + throw BFoxSession.toException(throwable); + } + } + + public BValue[] newCopy(BValue[] bValueArray, CopyHints copyHints) { + try { + return BFoxComponentSpace.this.channel().copy(bValueArray, copyHints); + } + catch (Throwable throwable) { + log.error("newCopy():" + throwable); + throw BFoxSession.toException(throwable); + } + } + + FoxLoadCallbacks() { + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + class FoxTrapCallbacks + extends TrapToSyncBuffer { + public SyncBuffer getBuffer() { + return new AutoCommitSyncBuffer((BComponentSpace)BFoxComponentSpace.this); + } + + public BValue invoke(BComponent bComponent, Action action, BValue bValue, Context context) { + try { + return BFoxComponentSpace.this.channel().invoke(bComponent, action, bValue); + } + catch (Exception exception) { + log.error("Cannot invoke: " + bComponent.toPathString() + '.' + action); + throw new ActionInvokeException((Throwable)exception); + } + } + + FoxTrapCallbacks() { + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + class FoxSubscribeCallbacks + extends SubscribeCallbacks { + public void update(BComponent bComponent, int n) { + try { + BFoxComponentSpace.this.channel().load(bComponent, n); + } + catch (Throwable throwable) { + log.error("update(" + bComponent.toPathString() + "): " + throwable); + throw BFoxSession.toException(throwable); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void subscribe(BComponent[] bComponentArray, int n) { + HashMap hashMap; + if (n == 0) { + hashMap = BFoxComponentSpace.this.subscribed; + synchronized (hashMap) { + Class clazz = class$javax$baja$sys$BComponent; + if (clazz == null) { + clazz = class$javax$baja$sys$BComponent = BFoxComponentSpace.class("[Ljavax.baja.sys.BComponent;", false); + } + Array array = new Array(clazz); + int n2 = 0; + while (true) { + if (n2 >= bComponentArray.length) { + if (array.size() != 0) break; + return; + } + if (BFoxComponentSpace.this.subscribed.get(bComponentArray[n2]) == null) { + array.add((Object)bComponentArray[n2]); + } + ++n2; + } + bComponentArray = (BComponent[])array.trim(); + } + } + try { + BFoxComponentSpace.this.channel().subscribe(bComponentArray, n); + } + catch (Throwable throwable) { + log.error("subscribe(" + bComponentArray[0].toPathString() + "): " + throwable); + throw BFoxSession.toException(throwable); + } + hashMap = BFoxComponentSpace.this.subscribed; + synchronized (hashMap) { + int n3 = 0; + while (n3 < bComponentArray.length) { + this.addToSubscribed(bComponentArray[n3], n); + ++n3; + } + return; + } + } + + void addToSubscribed(BComponent bComponent, int n) { + BFoxComponentSpace.this.subscribed.put(bComponent, Clock.time()); + if (n > 0) { + BComponent[] bComponentArray = bComponent.getChildComponents(); + int n2 = 0; + while (n2 < bComponentArray.length) { + this.addToSubscribed(bComponentArray[n2], n - 1); + ++n2; + } + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void unsubscribe(BComponent[] bComponentArray) { + HashMap hashMap = BFoxComponentSpace.this.subscribed; + synchronized (hashMap) { + int n = 0; + while (n < bComponentArray.length) { + BFoxComponentSpace.this.subscribed.remove(bComponentArray[n]); + ++n; + } + } + try { + BFoxComponentSpace.this.channel().unsubscribe(bComponentArray); + return; + } + catch (NotConnectedException notConnectedException) { + return; + } + catch (Exception exception) { + log.error("Cannot unsubscribe: " + bComponentArray[0].toPathString(), (Throwable)exception); + } + } + + FoxSubscribeCallbacks() { + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + class AutoCommitSyncBuffer + extends SyncBuffer { + public void add(SyncOp syncOp) { + super.add(syncOp); + try { + BFoxComponentSpace.this.channel().syncToMaster(this); + } + catch (Throwable throwable) { + log.error("AutoCommitSyncBuffer: " + throwable); + throw BFoxSession.toException(throwable); + } + } + + AutoCommitSyncBuffer(BComponentSpace bComponentSpace) { + super(bComponentSpace, false); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/broker/BFoxGatewaySpace.java b/modules/cfr_output/com/tridium/fox/sys/broker/BFoxGatewaySpace.java new file mode 100644 index 0000000..7282886 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/broker/BFoxGatewaySpace.java @@ -0,0 +1,196 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.space.BGateway + * com.tridium.space.BIGatewaySpace + * javax.baja.naming.BHost + * javax.baja.naming.BISession + * javax.baja.naming.BOrd + * javax.baja.nav.BINavNode + * javax.baja.nre.util.Array + * javax.baja.sys.BComponent + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.LexiconText + */ +package com.tridium.fox.sys.broker; + +import com.tridium.fox.sys.BFoxSession; +import com.tridium.fox.sys.broker.BFoxComponentSpace; +import com.tridium.space.BGateway; +import com.tridium.space.BIGatewaySpace; +import java.util.HashMap; +import javax.baja.naming.BHost; +import javax.baja.naming.BISession; +import javax.baja.naming.BOrd; +import javax.baja.nav.BINavNode; +import javax.baja.nre.util.Array; +import javax.baja.sys.BComponent; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.LexiconText; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxGatewaySpace +extends BFoxComponentSpace +implements BIGatewaySpace { + public static final Type TYPE; + protected final BGateway gateway; + private boolean touchEnabled; + static /* synthetic */ Class class$com$tridium$fox$sys$broker$BFoxGatewaySpace; + static /* synthetic */ Class class$java$lang$String; + + public Type getType() { + return TYPE; + } + + public BGateway getGateway() { + return this.gateway; + } + + public BFoxSession getFoxSession() { + return ((BFoxComponentSpace)this.gateway.getSpace()).channel.getFoxSession(); + } + + public BComponent getRootComponent() { + BComponent bComponent = super.getRootComponent(); + if (bComponent == null) { + try { + BFoxSession bFoxSession = this.getFoxSession(); + this.init(bFoxSession); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + return super.getRootComponent(); + } + + public void setTouchEnabled(boolean bl) { + this.touchEnabled = bl; + } + + public BHost getHost() { + return this.gateway.getSpace().getHost(); + } + + public BISession getSession() { + return this.gateway.getSpace().getSession(); + } + + public BOrd getOrdInSession() { + return BOrd.make((BOrd)this.gateway.getOrdInSession(), (BOrd)this.gateway.getGatewaySchemeOrd()); + } + + public BOrd getAbsoluteOrd() { + return BOrd.make((BOrd)this.gateway.getAbsoluteOrd(), (BOrd)this.gateway.getGatewaySchemeOrd()); + } + + public BOrd getOrdInHost() { + return BOrd.make((BOrd)this.gateway.getOrdInHost(), (BOrd)this.gateway.getGatewaySchemeOrd()); + } + + public BOrd getNavOrd() { + return this.gateway.getNavOrd(); + } + + public BINavNode getNavParent() { + return this.gateway; + } + + public boolean hasNavChildren() { + boolean bl = false; + if (this.getRootComponent() != null) { + bl = true; + } + return bl; + } + + public BINavNode getNavChild(String string) { + return this.getRootComponent().getNavChild(string); + } + + public BINavNode resolveNavChild(String string) { + return this.getRootComponent().resolveNavChild(string); + } + + public BINavNode[] getNavChildren() { + return this.getRootComponent().getNavChildren(); + } + + public Object fw(int n, Object object, Object object2, Object object3, Object object4) { + if (n == 110 && this.touchEnabled) { + this.touch((BOrd[])object); + } + return super.fw(n, object, object2, object3, object4); + } + + protected void touch(BOrd[] bOrdArray) { + try { + Class clazz = class$java$lang$String; + if (clazz == null) { + clazz = class$java$lang$String = BFoxGatewaySpace.class("[Ljava.lang.String;", false); + } + Array array = new Array(clazz); + HashMap hashMap = new HashMap(); + int n = 0; + while (n < bOrdArray.length) { + String string = bOrdArray[n].encodeToString(); + if (hashMap.get(string) == null) { + hashMap.put(string, string); + array.add((Object)string); + } + ++n; + } + if (array.size() == 0) { + return; + } + this.channel().touch((String[])array.trim()); + } + catch (Throwable throwable) { + log.error("touch(): " + throwable); + throw BFoxSession.toException(throwable); + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.touchEnabled = false; + } + + public BFoxGatewaySpace() { + super("foxgatewayspace", null, BOrd.NULL); + this.this(); + this.gateway = null; + } + + public BFoxGatewaySpace(BGateway bGateway, LexiconText lexiconText) { + super(bGateway.getGatewaySchemeId(), lexiconText, bGateway.getGatewaySchemeOrd()); + this.this(); + this.gateway = bGateway; + } + + static { + Class clazz = class$com$tridium$fox$sys$broker$BFoxGatewaySpace; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$broker$BFoxGatewaySpace = BFoxGatewaySpace.class("[Lcom.tridium.fox.sys.broker.BFoxGatewaySpace;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/broker/BFoxStationSpace.java b/modules/cfr_output/com/tridium/fox/sys/broker/BFoxStationSpace.java new file mode 100644 index 0000000..68ae8de --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/broker/BFoxStationSpace.java @@ -0,0 +1,106 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.space.BGateway + * com.tridium.sys.schema.ComponentSlotMap + * javax.baja.agent.AgentFilter + * javax.baja.agent.AgentList + * javax.baja.naming.BOrd + * javax.baja.space.BSpace + * javax.baja.sys.BComponent + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.LexiconText + * javax.baja.virtual.BVirtualGateway + */ +package com.tridium.fox.sys.broker; + +import com.tridium.fox.sys.BIFoxGatewayProxyFactory; +import com.tridium.fox.sys.BIFoxProxySpace; +import com.tridium.fox.sys.broker.BFoxComponentSpace; +import com.tridium.fox.sys.broker.BFoxVirtualSpace; +import com.tridium.space.BGateway; +import com.tridium.sys.schema.ComponentSlotMap; +import javax.baja.agent.AgentFilter; +import javax.baja.agent.AgentList; +import javax.baja.naming.BOrd; +import javax.baja.space.BSpace; +import javax.baja.sys.BComponent; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.LexiconText; +import javax.baja.virtual.BVirtualGateway; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxStationSpace +extends BFoxComponentSpace { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$fox$sys$broker$BFoxStationSpace; + + public Type getType() { + return TYPE; + } + + public Type[] getEnabledMixIns() { + return this.channel.getConnection().getChannels().getSysChannel().getStationMixIns(); + } + + public Object fw(int n, Object object, Object object2, Object object3, Object object4) { + if (n == 101) { + super.fw(n, object, object2, object3, object4); + this.fwMount((ComponentSlotMap)object); + return null; + } + return super.fw(n, object, object2, object3, object4); + } + + private final void fwMount(ComponentSlotMap componentSlotMap) { + BComponent bComponent = (BComponent)componentSlotMap.getInstance(); + if (bComponent instanceof BVirtualGateway) { + BVirtualGateway bVirtualGateway = (BVirtualGateway)bComponent; + bVirtualGateway.fw(108, (Object)new BFoxVirtualSpace(bVirtualGateway), null, null, null); + } else if (bComponent instanceof BGateway) { + BSpace bSpace = null; + BGateway bGateway = (BGateway)bComponent; + AgentList agentList = bGateway.getAgents(); + if ((agentList = agentList.filter(AgentFilter.is((Type)BIFoxGatewayProxyFactory.TYPE))).size() != 0) { + bSpace = ((BIFoxGatewayProxyFactory)agentList.getDefault().getInstance()).makeFoxGatewayProxySpace(bGateway); + if (!(bSpace instanceof BIFoxProxySpace)) { + throw new IllegalStateException("Fox gateway proxy space must implement BIFoxProxySpace"); + } + bGateway.fw(108, (Object)bSpace, null, null, null); + } else { + throw new IllegalStateException("Could not find BIFoxGatewayProxyFactory for " + bComponent.getType()); + } + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BFoxStationSpace() { + super("station", LexiconText.make((String)"baja", (String)"nav.station"), BOrd.make((String)"station:")); + } + + static { + Class clazz = class$com$tridium$fox$sys$broker$BFoxStationSpace; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$broker$BFoxStationSpace = BFoxStationSpace.class("[Lcom.tridium.fox.sys.broker.BFoxStationSpace;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/broker/BFoxVirtualSpace.java b/modules/cfr_output/com/tridium/fox/sys/broker/BFoxVirtualSpace.java new file mode 100644 index 0000000..5e5032a --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/broker/BFoxVirtualSpace.java @@ -0,0 +1,256 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.schema.ComponentSlotMap + * javax.baja.naming.BHost + * javax.baja.naming.BISession + * javax.baja.naming.BOrd + * javax.baja.nav.BINavNode + * javax.baja.nre.util.Array + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.LexiconText + * javax.baja.virtual.BVirtualComponent + * javax.baja.virtual.BVirtualGateway + */ +package com.tridium.fox.sys.broker; + +import com.tridium.fox.sys.BFoxSession; +import com.tridium.fox.sys.broker.BFoxComponentSpace; +import com.tridium.sys.schema.ComponentSlotMap; +import java.util.HashMap; +import javax.baja.naming.BHost; +import javax.baja.naming.BISession; +import javax.baja.naming.BOrd; +import javax.baja.nav.BINavNode; +import javax.baja.nre.util.Array; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.LexiconText; +import javax.baja.virtual.BVirtualComponent; +import javax.baja.virtual.BVirtualGateway; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxVirtualSpace +extends BFoxComponentSpace { + public static final Type TYPE; + BVirtualGateway gateway; + static /* synthetic */ Class class$com$tridium$fox$sys$broker$BFoxVirtualSpace; + static /* synthetic */ Class class$java$lang$String; + + public Type getType() { + return TYPE; + } + + public BVirtualGateway getVirtualGateway() { + return this.gateway; + } + + public BFoxSession getFoxSession() { + return ((BFoxComponentSpace)this.gateway.getSpace()).channel.getFoxSession(); + } + + public BComponent getRootComponent() { + BComponent bComponent = super.getRootComponent(); + if (bComponent == null) { + try { + BFoxSession bFoxSession = this.getFoxSession(); + this.init(bFoxSession); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + return super.getRootComponent(); + } + + public void childUnparented(BComponent bComponent, Property property, BValue bValue, Context context) { + super.childUnparented(bComponent, property, bValue, context); + if (bComponent instanceof BVirtualComponent) { + ((ComponentSlotMap)bComponent.fw(1)).setBrokerPropsLoaded(false); + } + } + + public BHost getHost() { + return this.gateway.getSpace().getHost(); + } + + public BISession getSession() { + return this.gateway.getSpace().getSession(); + } + + public BOrd getOrdInSession() { + return BOrd.make((BOrd)this.gateway.getOrdInSession(), (String)"virtual:"); + } + + public BOrd getAbsoluteOrd() { + return BOrd.make((BOrd)this.gateway.getAbsoluteOrd(), (String)"virtual:"); + } + + public BOrd getOrdInHost() { + return BOrd.make((BOrd)this.gateway.getOrdInHost(), (String)"virtual:"); + } + + public final BOrd getNavOrd() { + return this.gateway.getNavOrd(); + } + + public final BINavNode getNavParent() { + return this.gateway; + } + + public boolean hasNavChildren() { + return true; + } + + public BINavNode getNavChild(String string) { + this.getRootComponent(); + return super.getNavChild(string); + } + + public BINavNode resolveNavChild(String string) { + this.getRootComponent(); + return super.resolveNavChild(string); + } + + public BINavNode[] getNavChildren() { + this.getRootComponent(); + return super.getNavChildren(); + } + + public Object fw(int n, Object object, Object object2, Object object3, Object object4) { + if (n == 110) { + this.touch((BOrd[])object); + } + return super.fw(n, object, object2, object3, object4); + } + + void touch(BOrd[] bOrdArray) { + try { + Class clazz = class$java$lang$String; + if (clazz == null) { + clazz = class$java$lang$String = BFoxVirtualSpace.class("[Ljava.lang.String;", false); + } + Array array = new Array(clazz); + HashMap hashMap = new HashMap(); + int n = 0; + while (n < bOrdArray.length) { + String string = bOrdArray[n].encodeToString(); + if (hashMap.get(string) == null) { + hashMap.put(string, string); + array.add((Object)string); + } + ++n; + } + if (array.size() == 0) { + return; + } + this.channel().touch((String[])array.trim()); + } + catch (Throwable throwable) { + log.error("touch(): " + throwable); + throw BFoxSession.toException(throwable); + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BFoxVirtualSpace(BVirtualGateway bVirtualGateway) { + super("virtual", LexiconText.make((String)"baja", (String)"nav.virtual"), BOrd.make((String)"virtual:")); + this.setLoadCallbacks(new FoxVirtualLoadCallbacks()); + this.setSubscribeCallbacks(new FoxVirtualSubscribeCallbacks()); + this.gateway = bVirtualGateway; + } + + public BFoxVirtualSpace() { + this(null); + } + + static { + Class clazz = class$com$tridium$fox$sys$broker$BFoxVirtualSpace; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$broker$BFoxVirtualSpace = BFoxVirtualSpace.class("[Lcom.tridium.fox.sys.broker.BFoxVirtualSpace;", false); + } + TYPE = Sys.loadType((Class)clazz); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + class FoxVirtualLoadCallbacks + extends BFoxComponentSpace.FoxLoadCallbacks { + /* + * Enabled force condition propagation + * Lifted jumps to return sites + */ + public Slot loadSlot(BComponent bComponent, String string) { + block7: { + Slot slot = bComponent.getSlot(string); + if (slot == null) break block7; + if (!slot.isProperty()) return slot; + BValue bValue = bComponent.get(slot.asProperty()); + if (!bValue.isComponent()) return slot; + if (bValue.asComponent().getComponentSpace() != null) { + return slot; + } + try { + } + catch (Throwable throwable) {} + } + try { + return BFoxVirtualSpace.this.channel().loadSlot(bComponent, string, 0); + } + catch (Throwable throwable) { + log.error("loadSlot(" + bComponent.toPathString() + ", " + string + "): " + throwable); + throw BFoxSession.toException(throwable); + } + } + + FoxVirtualLoadCallbacks() { + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + class FoxVirtualSubscribeCallbacks + extends BFoxComponentSpace.FoxSubscribeCallbacks { + public void update(BComponent bComponent, int n) { + try { + BFoxVirtualSpace.this.channel().load(bComponent, n, true); + } + catch (Throwable throwable) { + log.error("update(" + bComponent.toPathString() + "): " + throwable); + throw BFoxSession.toException(throwable); + } + } + + FoxVirtualSubscribeCallbacks() { + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/broker/SyntheticTypeInfo.java b/modules/cfr_output/com/tridium/fox/sys/broker/SyntheticTypeInfo.java new file mode 100644 index 0000000..28eb8b7 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/broker/SyntheticTypeInfo.java @@ -0,0 +1,119 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.agent.AgentInfo + * javax.baja.agent.AgentList + * javax.baja.registry.TypeInfo + * javax.baja.sys.BComponent + * javax.baja.sys.BIcon + * javax.baja.sys.BObject + * javax.baja.sys.Context + * javax.baja.sys.Type + * javax.baja.util.BTypeSpec + * javax.baja.util.Lexicon + */ +package com.tridium.fox.sys.broker; + +import javax.baja.agent.AgentInfo; +import javax.baja.agent.AgentList; +import javax.baja.registry.TypeInfo; +import javax.baja.sys.BComponent; +import javax.baja.sys.BIcon; +import javax.baja.sys.BObject; +import javax.baja.sys.Context; +import javax.baja.sys.Type; +import javax.baja.util.BTypeSpec; +import javax.baja.util.Lexicon; + +public class SyntheticTypeInfo +implements TypeInfo { + private Type type; + Lexicon lexicon; + + public AgentInfo getAgentInfo() { + return null; + } + + public String getDisplayName(Context context) { + return this.type.getTypeSpec().getTypeName(); + } + + public BIcon getIcon(Context context) { + return null; + } + + public BObject getInstance() { + return this.type.getInstance(); + } + + public TypeInfo[] getInterfaces() { + return new TypeInfo[0]; + } + + public Lexicon getLexicon(Context context) { + return this.lexicon; + } + + public String getModuleName() { + return this.type.getTypeSpec().getModuleName(); + } + + public TypeInfo getSuperType() { + return this.type.getSuperType().getTypeInfo(); + } + + public String getTypeClassName() { + return this.type.getTypeSpec().getResolvedType().getTypeClass().getName(); + } + + public String getTypeName() { + return this.type.getTypeName(); + } + + public BTypeSpec getTypeSpec() { + return this.type.getTypeSpec(); + } + + public boolean is(TypeInfo typeInfo) { + boolean bl = false; + if (typeInfo == this || this.type.getSuperType().is(typeInfo)) { + bl = true; + } + return bl; + } + + public boolean is(Type type) { + boolean bl = false; + if (type.getTypeInfo() == this || this.type.getSuperType().is(type)) { + bl = true; + } + return bl; + } + + public boolean isAbstract() { + return false; + } + + public boolean isFinal() { + return false; + } + + public boolean isInterface() { + return false; + } + + public boolean isTransient() { + return true; + } + + public AgentList getAgents() { + return BComponent.TYPE.getTypeInfo().getAgents(); + } + + public SyntheticTypeInfo(Type type) { + this.type = type; + this.lexicon = Lexicon.make((String)"baja"); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/broker/TransferCodec.java b/modules/cfr_output/com/tridium/fox/sys/broker/TransferCodec.java new file mode 100644 index 0000000..c6dfbf6 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/broker/TransferCodec.java @@ -0,0 +1,110 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.transfer.CompTransferResult + * com.tridium.sys.transfer.TransferResult + * com.tridium.sys.transfer.TransferStrategy + * javax.baja.naming.BLocalHost + * javax.baja.naming.BOrd + * javax.baja.space.BISpaceNode + * javax.baja.space.Mark + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.Context + */ +package com.tridium.fox.sys.broker; + +import com.tridium.fox.encoding.BogCodec; +import com.tridium.fox.encoding.DecoderFactory; +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.sys.transfer.CompTransferResult; +import com.tridium.sys.transfer.TransferResult; +import com.tridium.sys.transfer.TransferStrategy; +import javax.baja.naming.BLocalHost; +import javax.baja.naming.BOrd; +import javax.baja.space.BISpaceNode; +import javax.baja.space.Mark; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; + +public class TransferCodec { + public static FoxRequest transferToMessage(FoxRequest foxRequest, TransferStrategy transferStrategy) throws Exception { + foxRequest.add("target", ((BISpaceNode)transferStrategy.getTarget()).getOrdInSession().toString()); + Mark mark = transferStrategy.getMark(); + BObject[] bObjectArray = mark.getValues(); + String[] stringArray = mark.getNames(); + int n = 0; + while (n < bObjectArray.length) { + FoxMessage foxMessage = new FoxMessage("mark"); + foxMessage.add("ord", ((BISpaceNode)bObjectArray[n]).getOrdInSession().toString()); + foxMessage.add("name", stringArray[n]); + foxRequest.add(foxMessage); + ++n; + } + foxRequest.add("action", transferStrategy.getAction()); + BogCodec.add(foxRequest, "params", (BValue)transferStrategy.getParameters(), null); + return foxRequest; + } + + public static TransferStrategy messageToTransfer(FoxMessage foxMessage, Context context) throws Exception { + BObject bObject = BOrd.make((String)foxMessage.getString("target")).get((BObject)BLocalHost.INSTANCE, context); + FoxTuple[] foxTupleArray = foxMessage.list("mark"); + BObject[] bObjectArray = new BObject[foxTupleArray.length]; + String[] stringArray = new String[foxTupleArray.length]; + int n = 0; + while (n < foxTupleArray.length) { + FoxMessage foxMessage2 = (FoxMessage)foxTupleArray[n]; + bObjectArray[n] = BOrd.make((String)foxMessage2.getString("ord")).get((BObject)BLocalHost.INSTANCE, context); + stringArray[n] = foxMessage2.getString("name"); + ++n; + } + Mark mark = new Mark(bObjectArray, stringArray); + int n2 = foxMessage.getInt("action"); + BComponent bComponent = (BComponent)DecoderFactory.decode(foxMessage, "params", null); + return TransferStrategy.make((int)n2, (Mark)mark, (BObject)bObject, (BComponent)bComponent, (Context)context); + } + + public static FoxResponse resultToMessage(FoxResponse foxResponse, TransferResult transferResult) throws Exception { + if (!(transferResult instanceof CompTransferResult)) { + return null; + } + CompTransferResult compTransferResult = (CompTransferResult)transferResult; + foxResponse.add("class", compTransferResult.getClass().getName()); + foxResponse.add("action", compTransferResult.action); + foxResponse.add("origParent", compTransferResult.origParent.getOrdInSession().toString()); + int n = 0; + while (n < compTransferResult.origNames.length) { + foxResponse.add("origName", compTransferResult.origNames[n]); + ++n; + } + foxResponse.add("target", compTransferResult.target.getOrdInSession().toString()); + n = 0; + while (n < compTransferResult.insertNames.length) { + foxResponse.add("insertName", compTransferResult.insertNames[n]); + ++n; + } + return foxResponse; + } + + public static TransferResult messageToResult(BObject bObject, FoxMessage foxMessage) throws Exception { + if (foxMessage == null) { + return null; + } + int n = foxMessage.getInt("action"); + BOrd bOrd = BOrd.make((String)foxMessage.getString("origParent")); + String[] stringArray = foxMessage.listStrings("origName"); + BOrd bOrd2 = BOrd.make((String)foxMessage.getString("target")); + String[] stringArray2 = foxMessage.listStrings("insertName"); + BComponent bComponent = (BComponent)bOrd.get(bObject); + BComponent bComponent2 = (BComponent)bOrd2.get(bObject); + return new CompTransferResult(n, bComponent, stringArray, bComponent2, stringArray2); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/data/BDataChannel.java b/modules/cfr_output/com/tridium/fox/sys/data/BDataChannel.java new file mode 100644 index 0000000..5ced6dd --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/data/BDataChannel.java @@ -0,0 +1,184 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.data.BToDataTable + * com.tridium.data.DataTableDecoder + * com.tridium.data.DataTableEncoder + * javax.baja.collection.BICollection + * javax.baja.collection.BITable + * javax.baja.data.BIDataTable + * javax.baja.data.BIDataValue + * javax.baja.naming.BOrd + * javax.baja.naming.UnresolvedException + * javax.baja.sys.BObject + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.BTypeSpec + */ +package com.tridium.fox.sys.data; + +import com.tridium.data.BToDataTable; +import com.tridium.data.DataTableDecoder; +import com.tridium.data.DataTableEncoder; +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxCircuit; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.InvalidCommandException; +import com.tridium.fox.sys.BFoxChannel; +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.FilterOutputStream; +import javax.baja.collection.BICollection; +import javax.baja.collection.BITable; +import javax.baja.data.BIDataTable; +import javax.baja.data.BIDataValue; +import javax.baja.naming.BOrd; +import javax.baja.naming.UnresolvedException; +import javax.baja.sys.BObject; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.BTypeSpec; + +public class BDataChannel +extends BFoxChannel { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$fox$sys$data$BDataChannel == null ? (class$com$tridium$fox$sys$data$BDataChannel = BDataChannel.class$("com.tridium.fox.sys.data.BDataChannel")) : class$com$tridium$fox$sys$data$BDataChannel)); + static /* synthetic */ Class class$com$tridium$fox$sys$data$BDataChannel; + + public Type getType() { + return TYPE; + } + + public BDataChannel() { + super("data"); + } + + public FoxResponse process(FoxRequest foxRequest) throws Exception { + String string = foxRequest.command; + throw new InvalidCommandException(string); + } + + public void circuitOpened(FoxCircuit foxCircuit) throws Exception { + String string = foxCircuit.command; + if (string == "resolve") { + this.resolve(foxCircuit); + return; + } + throw new InvalidCommandException(string); + } + + public BObject resolve(BOrd bOrd) throws Exception { + FoxMessage foxMessage = new FoxMessage(); + foxMessage.add("ord", bOrd.toString()); + FoxCircuit foxCircuit = this.openCircuit("resolve"); + foxCircuit.writeMessage(foxMessage); + foxCircuit.flush(); + FoxMessage foxMessage2 = foxCircuit.readMessage(); + if (foxMessage2.getString("exception", null) != null) { + throw Fox.exceptionTranslator.messageToException(foxMessage2); + } + boolean bl = foxMessage2.getBoolean("resolved", false); + if (!bl) { + throw new UnresolvedException(bOrd.toString()); + } + String string = foxMessage2.getString("targetType"); + if (string.equals("table")) { + BIDataTable bIDataTable = DataTableDecoder.decode((DataInput)new DataInputStream(foxCircuit.getInputStream())); + foxCircuit.close(); + return (BObject)bIDataTable; + } + if (string.equals("value")) { + String string2 = foxMessage2.getString("valueType"); + Type type = BTypeSpec.make((String)string2).getResolvedType(); + BObject bObject = type.getInstance(); + BObject bObject2 = ((BIDataValue)bObject).decode((DataInput)new DataInputStream(foxCircuit.getInputStream())); + foxCircuit.close(); + return bObject2; + } + throw new UnresolvedException("Unsupported result type (" + string + ") for " + bOrd.toString()); + } + + public void resolve(FoxCircuit foxCircuit) throws Exception { + Object object; + Object object2; + FoxMessage foxMessage = foxCircuit.readMessage(); + String string = foxMessage.getString("ord", null); + if (string == null) { + foxCircuit.writeMessage(BDataChannel.unresolved()); + foxCircuit.flush(); + return; + } + BObject bObject = null; + try { + object2 = BOrd.make((String)("local:|" + string)); + bObject = object2.resolve(null, this.getSessionContext()).get(); + } + catch (UnresolvedException unresolvedException) { + unresolvedException.printStackTrace(); + foxCircuit.writeMessage(BDataChannel.unresolved()); + foxCircuit.flush(); + return; + } + catch (Exception exception) { + exception.printStackTrace(); + foxCircuit.writeMessage(Fox.exceptionTranslator.exceptionToMessage(exception)); + foxCircuit.flush(); + return; + } + object2 = new FoxMessage(); + ((FoxMessage)object2).add("resolved", true); + BObject bObject2 = null; + if (bObject instanceof BICollection) { + ((FoxMessage)object2).add("targetType", "table"); + if (bObject instanceof BIDataTable) { + bObject2 = bObject; + } else { + object = ((BICollection)bObject).toTable(); + bObject2 = (BObject)BToDataTable.toDataTable((BITable)object); + } + } else { + ((FoxMessage)object2).add("targetType", "value"); + bObject2 = (BObject)bObject.toDataValue(); + ((FoxMessage)object2).add("valueType", bObject2.getType().getTypeSpec().toString()); + } + foxCircuit.writeMessage((FoxMessage)object2); + foxCircuit.flush(); + object = new DataOutputStream(foxCircuit.getOutputStream()); + if (bObject2 instanceof BIDataTable) { + DataTableEncoder.encode((BIDataTable)((BIDataTable)bObject2), (DataOutput)object, (Context)this.getSessionContext()); + } else { + ((BIDataValue)bObject2).encode((DataOutput)object); + } + ((DataOutputStream)object).flush(); + ((FilterOutputStream)object).close(); + } + + private static FoxMessage unresolved() { + return BDataChannel.unresolved(null, null); + } + + private static FoxMessage unresolved(String string, String string2) { + FoxMessage foxMessage = new FoxMessage(); + foxMessage.add("resolved", false); + if (string2 != null) { + foxMessage.add("msg", string2); + } + return foxMessage; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/file/BFileChannel.java b/modules/cfr_output/com/tridium/fox/sys/file/BFileChannel.java new file mode 100644 index 0000000..01c62c7 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/file/BFileChannel.java @@ -0,0 +1,703 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.transfer.TransferListener + * com.tridium.sys.transfer.TransferResult + * com.tridium.sys.transfer.TransferStrategy + * com.tridium.util.BRestrictedFileSpace + * javax.baja.file.BAbstractFileStore + * javax.baja.file.BDirectory + * javax.baja.file.BFileSpace + * javax.baja.file.BFileSystem + * javax.baja.file.BIDirectory + * javax.baja.file.BIFile + * javax.baja.file.BIFileStore + * javax.baja.file.FilePath + * javax.baja.file.FileUtil + * javax.baja.nre.util.Array + * javax.baja.security.BPermissions + * javax.baja.security.PermissionException + * javax.baja.sys.BAbsTime + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys.file; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.message.FoxTuple; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxCircuit; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.InvalidCommandException; +import com.tridium.fox.sys.BFoxChannel; +import com.tridium.fox.sys.BFoxClientConnection; +import com.tridium.fox.sys.broker.TransferCodec; +import com.tridium.fox.sys.file.BFoxFileSpace; +import com.tridium.fox.sys.file.BFoxFileStore; +import com.tridium.sys.transfer.TransferListener; +import com.tridium.sys.transfer.TransferResult; +import com.tridium.sys.transfer.TransferStrategy; +import com.tridium.util.BRestrictedFileSpace; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import javax.baja.file.BAbstractFileStore; +import javax.baja.file.BDirectory; +import javax.baja.file.BFileSpace; +import javax.baja.file.BFileSystem; +import javax.baja.file.BIDirectory; +import javax.baja.file.BIFile; +import javax.baja.file.BIFileStore; +import javax.baja.file.FilePath; +import javax.baja.file.FileUtil; +import javax.baja.nre.util.Array; +import javax.baja.security.BPermissions; +import javax.baja.security.PermissionException; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public class BFileChannel +extends BFoxChannel { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$fox$sys$file$BFileChannel == null ? (class$com$tridium$fox$sys$file$BFileChannel = BFileChannel.class$("com.tridium.fox.sys.file.BFileChannel")) : class$com$tridium$fox$sys$file$BFileChannel)); + public static int CHUNK_SIZE = 16384; + private Array unrestrictedFilePaths = new Array(class$java$lang$String == null ? (class$java$lang$String = BFileChannel.class$("java.lang.String")) : class$java$lang$String); + static /* synthetic */ Class class$com$tridium$fox$sys$file$BFileChannel; + static /* synthetic */ Class class$java$lang$String; + + public Type getType() { + return TYPE; + } + + public BFileChannel() { + super("file"); + } + + public FoxResponse process(FoxRequest foxRequest) throws Exception { + String string = foxRequest.command; + if (string == "head") { + return this.head(foxRequest); + } + if (string == "list") { + return this.list(foxRequest); + } + if (string == "delete") { + return this.delete(foxRequest); + } + if (string == "makeFile") { + return this.makeFile(foxRequest); + } + if (string == "makeDir") { + return this.makeDir(foxRequest); + } + if (string == "move") { + return this.move(foxRequest); + } + if (string == "setLastModified") { + return this.setLastModified(foxRequest); + } + if (string == "getCrc") { + return this.getCrc(foxRequest); + } + throw new InvalidCommandException(string); + } + + public void circuitOpened(FoxCircuit foxCircuit) throws Exception { + String string = foxCircuit.command; + if (string == "read") { + this.read(foxCircuit); + return; + } + if (string == "write") { + this.write(foxCircuit); + return; + } + if (string == "transfer") { + this.transfer(foxCircuit); + return; + } + throw new InvalidCommandException(string); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void sessionClosed(Throwable throwable) throws Exception { + Array array = this.unrestrictedFilePaths; + synchronized (array) { + this.unrestrictedFilePaths.clear(); + } + } + + public BFoxFileStore head(BFoxFileSpace bFoxFileSpace, FilePath filePath) throws Exception { + FoxResponse foxResponse; + FoxRequest foxRequest = this.makeRequest("head"); + foxRequest.add("path", filePath.getBody()); + if (this.isTraceOn()) { + this.trace("c:head \"" + filePath.getBody() + "\""); + } + if ((foxResponse = this.sendSync(foxRequest)) == null) { + return null; + } + return BFileChannel.msgToStore(bFoxFileSpace, filePath, foxResponse); + } + + public FoxResponse head(FoxRequest foxRequest) throws Exception { + BIFile bIFile; + FilePath filePath = new FilePath(foxRequest.getString("path")); + if (this.isTraceOn()) { + this.trace("s:head \"" + filePath.getBody() + "\""); + } + if ((bIFile = this.getFileSpaceForPath(filePath).findFile(filePath)) == null) { + return null; + } + BPermissions bPermissions = this.getPermissionsFor(bIFile); + if (!bPermissions.has(BPermissions.operatorRead)) { + throw new PermissionException(); + } + FoxResponse foxResponse = new FoxResponse(foxRequest); + BFileChannel.storeToMsg(bIFile.getStore(), bPermissions, foxResponse); + return foxResponse; + } + + public BFoxFileStore[] list(BFoxFileSpace bFoxFileSpace, FilePath filePath) throws Exception { + if (this.isTraceOn()) { + this.trace("c:list \"" + filePath.getBody() + "\""); + } + FoxRequest foxRequest = this.makeRequest("list"); + foxRequest.add("path", filePath.getBody()); + FoxResponse foxResponse = this.sendSync(foxRequest); + FoxTuple[] foxTupleArray = foxResponse.list("file"); + BFoxFileStore[] bFoxFileStoreArray = new BFoxFileStore[foxTupleArray.length]; + for (int i = 0; i < bFoxFileStoreArray.length; ++i) { + FoxMessage foxMessage = (FoxMessage)foxTupleArray[i]; + String string = foxMessage.getString("name"); + bFoxFileStoreArray[i] = BFileChannel.msgToStore(bFoxFileSpace, filePath.merge(string), foxMessage); + } + return bFoxFileStoreArray; + } + + public FoxResponse list(FoxRequest foxRequest) throws Exception { + FilePath filePath = new FilePath(foxRequest.getString("path")); + if (this.isTraceOn()) { + this.trace("s:list \"" + filePath + "\""); + } + FoxResponse foxResponse = new FoxResponse(foxRequest); + BIFile bIFile = this.getFileSpaceForPath(filePath).resolveFile(filePath); + if (!this.getPermissionsFor(bIFile).has(BPermissions.operatorRead)) { + throw new PermissionException(); + } + if (bIFile instanceof BIDirectory) { + BIDirectory bIDirectory = (BIDirectory)bIFile; + BIFile[] bIFileArray = bIDirectory.listFiles(); + for (int i = 0; i < bIFileArray.length; ++i) { + BPermissions bPermissions = this.getPermissionsFor(bIFileArray[i]); + if (!bPermissions.has(BPermissions.operatorRead) || BRestrictedFileSpace.INSTANCE.isBlacklisted(bIFileArray[i])) continue; + FoxMessage foxMessage = new FoxMessage("file"); + BFileChannel.storeToMsg(bIFileArray[i].getStore(), bPermissions, foxMessage); + foxResponse.add(foxMessage); + } + } + return foxResponse; + } + + public void move(BFoxFileSpace bFoxFileSpace, FilePath filePath, FilePath filePath2) throws Exception { + FoxRequest foxRequest = this.makeRequest("move"); + foxRequest.add("from", filePath.getBody()); + foxRequest.add("to", filePath2.getBody()); + if (this.isTraceOn()) { + this.trace("c:move \"" + filePath + "\" -> \"" + filePath2 + "\""); + } + this.sendSync(foxRequest); + } + + public FoxResponse move(FoxRequest foxRequest) throws Exception { + FilePath filePath = new FilePath(foxRequest.getString("from")); + FilePath filePath2 = new FilePath(foxRequest.getString("to")); + if (this.isTraceOn()) { + this.trace("c:move \"" + filePath + "\" -> \"" + filePath2 + "\""); + } + BRestrictedFileSpace.INSTANCE.move(filePath, filePath2, this.getSessionContext()); + return null; + } + + public void delete(BFoxFileSpace bFoxFileSpace, FilePath filePath) throws Exception { + FoxRequest foxRequest = this.makeRequest("delete"); + foxRequest.add("path", filePath.getBody()); + if (this.isTraceOn()) { + this.trace("c:delete \"" + filePath.getBody() + "\""); + } + this.sendSync(foxRequest); + } + + public FoxResponse delete(FoxRequest foxRequest) throws Exception { + FilePath filePath = new FilePath(foxRequest.getString("path")); + if (this.isTraceOn()) { + this.trace("s:delete \"" + filePath.getBody() + "\""); + } + BRestrictedFileSpace.INSTANCE.delete(filePath, this.getSessionContext()); + return null; + } + + public BFoxFileStore makeFile(BFoxFileSpace bFoxFileSpace, FilePath filePath) throws Exception { + FoxRequest foxRequest = this.makeRequest("makeFile"); + foxRequest.add("path", filePath.getBody()); + if (this.isTraceOn()) { + this.trace("c:makeFile \"" + filePath.getBody() + "\""); + } + FoxResponse foxResponse = this.sendSync(foxRequest); + return BFileChannel.msgToStore(bFoxFileSpace, filePath, foxResponse); + } + + public FoxResponse makeFile(FoxRequest foxRequest) throws Exception { + Context context; + FilePath filePath = new FilePath(foxRequest.getString("path")); + if (this.isTraceOn()) { + this.trace("s:makeFile \"" + filePath.getBody() + "\""); + } + try { + context = this.getSessionContext(); + } + catch (Exception exception) { + context = null; + } + BIFile bIFile = this.getFileSpaceForPath(filePath).makeFile(filePath, context); + BPermissions bPermissions = context != null ? this.getPermissionsFor(bIFile) : BPermissions.all; + FoxResponse foxResponse = new FoxResponse(foxRequest); + BFileChannel.storeToMsg(bIFile.getStore(), bPermissions, foxResponse); + return foxResponse; + } + + public BFoxFileStore makeDir(BFoxFileSpace bFoxFileSpace, FilePath filePath) throws Exception { + FoxRequest foxRequest = this.makeRequest("makeDir"); + foxRequest.add("path", filePath.getBody()); + if (this.isTraceOn()) { + this.trace("c:makeDir \"" + filePath.getBody() + "\""); + } + FoxResponse foxResponse = this.sendSync(foxRequest); + return BFileChannel.msgToStore(bFoxFileSpace, filePath, foxResponse); + } + + public FoxResponse makeDir(FoxRequest foxRequest) throws Exception { + FilePath filePath = new FilePath(foxRequest.getString("path")); + if (this.isTraceOn()) { + this.trace("s:makeDir \"" + filePath.getBody() + "\""); + } + BDirectory bDirectory = this.getFileSpaceForPath(filePath).makeDir(filePath, this.getSessionContext()); + BPermissions bPermissions = this.getPermissionsFor(bDirectory); + FoxResponse foxResponse = new FoxResponse(foxRequest); + BFileChannel.storeToMsg(bDirectory.getStore(), bPermissions, foxResponse); + return foxResponse; + } + + public TransferResult transfer(TransferStrategy transferStrategy) throws Exception { + if (this.isTraceOn()) { + this.trace("c:transfer"); + transferStrategy.dump(); + } + FoxRequest foxRequest = this.makeRequest("transfer"); + TransferCodec.transferToMessage(foxRequest, transferStrategy); + FoxCircuit foxCircuit = this.openCircuit("transfer"); + foxCircuit.writeMessage(foxRequest); + while (true) { + FoxMessage foxMessage = null; + foxMessage = foxCircuit.readMessage(); + String string = foxMessage.getString("s", null); + if (string != null) { + transferStrategy.updateStatus(string); + continue; + } + if (foxMessage.getString("exception", null) != null) { + throw Fox.exceptionTranslator.messageToException(foxMessage); + } + if (foxMessage.getBoolean("done", false)) break; + } + return null; + } + + void transfer(FoxCircuit foxCircuit) throws Exception { + try { + Context context = this.getSessionContext(); + FoxMessage foxMessage = foxCircuit.readMessage(); + TransferStrategy transferStrategy = TransferCodec.messageToTransfer(foxMessage, context); + if (this.isTraceOn()) { + this.trace("s:transfer"); + transferStrategy.dump(); + } + transferStrategy.setListener((TransferListener)new BFoxChannel.TransferStatusPipe(foxCircuit)); + transferStrategy.transfer(); + FoxMessage foxMessage2 = new FoxMessage(); + foxMessage2.add("done", true); + foxCircuit.writeMessage(foxMessage2); + } + catch (Exception exception) { + exception.printStackTrace(); + foxCircuit.writeMessage(Fox.exceptionTranslator.exceptionToMessage(exception)); + } + foxCircuit.close(); + } + + public InputStream read(BFoxFileStore bFoxFileStore) throws Exception { + FilePath filePath = bFoxFileStore.getFilePath(); + if (this.isTraceOn()) { + this.trace("c:read \"" + filePath.getBody() + "\""); + } + FoxCircuit foxCircuit = this.openCircuit("read"); + FoxMessage foxMessage = new FoxMessage(); + foxMessage.add("path", bFoxFileStore.getFilePath().getBody()); + foxCircuit.writeMessage(foxMessage); + foxCircuit.flush(); + FoxMessage foxMessage2 = foxCircuit.readMessage(); + long l = Long.parseLong(foxMessage2.getString("size", "-1")); + if (l > -1L && l != bFoxFileStore.size) { + bFoxFileStore.size = l; + } + return foxCircuit.getInputStream(); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void read(FoxCircuit foxCircuit) throws Exception { + BIFile bIFile; + FoxMessage foxMessage = foxCircuit.readMessage(); + FilePath filePath = new FilePath(foxMessage.getString("path")); + if (this.isTraceOn()) { + this.trace("s:read \"" + filePath.getBody() + "\""); + } + if (!this.getPermissionsFor(bIFile = this.getFileSpaceForPath(filePath).resolveFile(filePath)).has(BPermissions.operatorRead)) { + throw new PermissionException(); + } + long l = bIFile.getSize(); + FoxMessage foxMessage2 = new FoxMessage(); + foxMessage2.add("size", String.valueOf(l)); + foxCircuit.writeMessage(foxMessage2); + InputStream inputStream = bIFile.getInputStream(); + OutputStream outputStream = foxCircuit.getOutputStream(); + try { + FileUtil.pipe((InputStream)inputStream, (long)l, (OutputStream)outputStream); + } + finally { + inputStream.close(); + foxCircuit.close(); + } + } + + public OutputStream write(BFoxFileStore bFoxFileStore) throws Exception { + FilePath filePath = bFoxFileStore.getFilePath(); + if (this.isTraceOn()) { + this.trace("c:write \"" + filePath.getBody() + "\""); + } + FoxCircuit foxCircuit = this.openCircuit("write"); + FoxMessage foxMessage = new FoxMessage(); + foxMessage.add("path", bFoxFileStore.getFilePath().getBody()); + foxCircuit.writeMessage(foxMessage); + foxCircuit.flush(); + return new ChunckedOutputStream(this, bFoxFileStore, foxCircuit); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public void write(FoxCircuit foxCircuit) throws Exception { + FoxMessage foxMessage = foxCircuit.readMessage(); + FilePath filePath = new FilePath(foxMessage.getString("path")); + if (this.isTraceOn()) { + this.trace("s:write \"" + filePath.getBody() + "\""); + } + BIFile bIFile = this.getFileSpaceForPath(filePath).resolveFile(filePath); + FoxMessage foxMessage2 = new FoxMessage(); + if (!this.getPermissionsFor(bIFile, false).has(BPermissions.operatorWrite)) { + foxMessage2.add("error", "No Permission"); + foxCircuit.writeMessage(foxMessage2); + return; + } + OutputStream outputStream = bIFile.getOutputStream(); + boolean bl = true; + try { + FoxMessage foxMessage3; + byte[] byArray; + while ((byArray = (foxMessage3 = foxCircuit.readMessage()).getBlob("chunk")).length != 0) { + outputStream.write(byArray); + } + bl = false; + outputStream.close(); + foxMessage2.add("size", String.valueOf(bIFile.getSize())); + foxMessage2.add("modified", bIFile.getLastModified().getMillis()); + foxCircuit.writeMessage(foxMessage2); + } + finally { + if (bl) { + outputStream.close(); + } + foxCircuit.close(); + } + } + + public boolean setLastModified(FilePath filePath, BAbsTime bAbsTime) throws Exception { + Object object; + FoxRequest foxRequest = this.makeRequest("setLastModified"); + foxRequest.add("path", filePath.getBody()); + foxRequest.add("lastModified", bAbsTime.getMillis()); + if (this.isTraceOn()) { + object = new StringBuffer(); + ((StringBuffer)object).append("c:setLastModified \""); + ((StringBuffer)object).append(filePath.getBody()); + ((StringBuffer)object).append("\" ("); + ((StringBuffer)object).append(bAbsTime); + ((StringBuffer)object).append(")"); + this.trace(((StringBuffer)object).toString()); + } + object = this.sendSync(foxRequest); + return ((FoxMessage)object).getBoolean("done"); + } + + public FoxResponse setLastModified(FoxRequest foxRequest) throws IOException { + StringBuffer stringBuffer; + FilePath filePath = new FilePath(foxRequest.getString("path")); + BAbsTime bAbsTime = BAbsTime.make((long)foxRequest.getTime("lastModified")); + if (this.isTraceOn()) { + stringBuffer = new StringBuffer(); + stringBuffer.append("s:setLastModified \""); + stringBuffer.append(filePath.getBody()); + stringBuffer.append("\" ("); + stringBuffer.append(bAbsTime); + stringBuffer.append(")"); + this.trace(stringBuffer.toString()); + } + if ((stringBuffer = this.getFileSpaceForPath(filePath).resolveFile(filePath)).getStore().isReadonly()) { + throw new IOException("File Store is readonly"); + } + if (!this.getPermissionsFor(stringBuffer).hasOperatorWrite()) { + throw new PermissionException(); + } + boolean bl = false; + if (!(stringBuffer.getStore() instanceof BAbstractFileStore)) { + throw new IOException("Unsupported File Store"); + } + Object object = (BAbstractFileStore)stringBuffer.getStore(); + bl = object.setLastModified(bAbsTime); + object = new FoxResponse(foxRequest); + ((FoxMessage)object).add("done", bl); + return object; + } + + public long getCrc(FilePath filePath) throws Exception { + Object object; + FoxRequest foxRequest = this.makeRequest("getCrc"); + foxRequest.add("path", filePath.getBody()); + if (this.isTraceOn()) { + object = new StringBuffer(); + ((StringBuffer)object).append("c:getCrc \""); + ((StringBuffer)object).append(filePath.getBody()); + ((StringBuffer)object).append("\""); + this.trace(((StringBuffer)object).toString()); + } + object = this.sendSync(foxRequest); + return ((FoxMessage)object).getTime("crc"); + } + + public FoxResponse getCrc(FoxRequest foxRequest) throws IOException { + StringBuffer stringBuffer; + FilePath filePath = new FilePath(foxRequest.getString("path")); + if (this.isTraceOn()) { + stringBuffer = new StringBuffer(); + stringBuffer.append("s:getCrc \""); + stringBuffer.append(filePath.getBody()); + stringBuffer.append("\""); + this.trace(stringBuffer.toString()); + } + if (!this.getPermissionsFor(stringBuffer = this.getFileSpaceForPath(filePath).resolveFile(filePath)).hasOperatorRead()) { + throw new PermissionException(); + } + long l = -1L; + if (!(stringBuffer.getStore() instanceof BAbstractFileStore)) { + throw new IOException("Unsupported File Store"); + } + Object object = (BAbstractFileStore)stringBuffer.getStore(); + l = object.getCrc(); + object = new FoxResponse(foxRequest); + ((FoxMessage)object).add("crc", l); + return object; + } + + public static BFoxFileStore msgToStore(BFoxFileSpace bFoxFileSpace, FilePath filePath, FoxMessage foxMessage) throws IOException { + BFoxFileStore bFoxFileStore = new BFoxFileStore(bFoxFileSpace, filePath); + bFoxFileStore.isDirectory = foxMessage.getBoolean("dir"); + bFoxFileStore.isReadonly = foxMessage.getBoolean("readonly"); + bFoxFileStore.modified = BAbsTime.make((long)foxMessage.getTime("modified")); + bFoxFileStore.size = Long.parseLong(foxMessage.getString("size")); + bFoxFileStore.permissions = BPermissions.make((String)foxMessage.getString("permissions", "rw")); + return bFoxFileStore; + } + + public static void storeToMsg(BIFileStore bIFileStore, BPermissions bPermissions, FoxMessage foxMessage) { + foxMessage.add("name", bIFileStore.getFileName()); + foxMessage.add("dir", bIFileStore.isDirectory()); + foxMessage.add("readonly", bIFileStore.isReadonly() || !bPermissions.has(BPermissions.operatorWrite)); + foxMessage.add("modified", bIFileStore.getLastModified().getMillis()); + foxMessage.add("size", String.valueOf(bIFileStore.getSize())); + foxMessage.add("permissions", bPermissions.encodeToString()); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public final Object fw(int n, Object object, Object object2, Object object3, Object object4) { + if (n == 901) { + String string = null; + FilePath filePath = null; + if (object instanceof String) { + string = (String)object; + filePath = new FilePath(string); + } else if (object instanceof FilePath) { + filePath = (FilePath)object; + string = filePath.getBody(); + } + if (string != null && !BRestrictedFileSpace.INSTANCE.inScope(filePath)) { + Array array = this.unrestrictedFilePaths; + synchronized (array) { + if (!this.unrestrictedFilePaths.contains((Object)string) && this.getConnection().isConnected()) { + this.unrestrictedFilePaths.add((Object)string); + } + } + } + } else if (n == 902) { + String string = null; + if (object instanceof String) { + string = (String)object; + } else if (object instanceof FilePath) { + string = ((FilePath)object).getBody(); + } + if (string != null) { + Array array = this.unrestrictedFilePaths; + synchronized (array) { + this.unrestrictedFilePaths.remove((Object)string); + } + } + } + return super.fw(n, object, object2, object3, object4); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + private BFileSpace getFileSpaceForPath(FilePath filePath) { + Array array = this.unrestrictedFilePaths; + synchronized (array) { + if (this.unrestrictedFilePaths.contains((Object)filePath.getBody())) { + return BFileSystem.INSTANCE; + } + if (this.getConnection() instanceof BFoxClientConnection) { + throw new PermissionException("Illegal file operation (server cannot make file request to client)"); + } + return BRestrictedFileSpace.INSTANCE; + } + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static class ChunckedOutputStream + extends OutputStream { + BFileChannel channel; + BFoxFileStore store; + FoxCircuit circuit; + byte[] buf = new byte[Fox.circuitChunkSize - 256]; + int n; + + ChunckedOutputStream(BFileChannel bFileChannel, BFoxFileStore bFoxFileStore, FoxCircuit foxCircuit) { + this.channel = bFileChannel; + this.store = bFoxFileStore; + this.circuit = foxCircuit; + } + + public void write(int n) throws IOException { + this.buf[this.n++] = (byte)(0xFF & n); + if (this.n >= this.buf.length) { + this.flush(); + } + } + + public void flush() throws IOException { + if (this.n > 0) { + FoxMessage foxMessage = new FoxMessage(); + foxMessage.add("chunk", this.buf, this.n); + this.writeMessage(foxMessage); + this.n = 0; + } + } + + public void close() throws IOException { + block7: { + this.flush(); + FoxMessage foxMessage = new FoxMessage(); + foxMessage.add("chunk", this.buf, 0); + this.writeMessage(foxMessage); + FoxMessage foxMessage2 = this.readMessage(); + this.circuit.close(); + String string = foxMessage2.getString("error", null); + if (string != null) { + throw new IOException(string); + } + String string2 = foxMessage2.getString("size", null); + if (string2 != null) { + this.store.size = Long.parseLong(string2); + this.store.modified = BAbsTime.make((long)foxMessage2.getTime("modified")); + } else { + try { + FoxResponse foxResponse; + FoxRequest foxRequest = this.channel.makeRequest("head"); + foxRequest.add("path", this.store.getFilePath().getBody()); + if (this.channel.isTraceOn()) { + this.channel.trace("c:head \"" + this.store.getFilePath().getBody() + "\""); + } + if ((foxResponse = this.channel.sendSync(foxRequest)) != null && (string2 = foxResponse.getString("size", null)) != null) { + this.store.size = Long.parseLong(string2); + this.store.modified = BAbsTime.make((long)foxResponse.getTime("modified")); + } + } + catch (Exception exception) { + if (!this.channel.isTraceOn()) break block7; + this.channel.trace("Error retrieving file info for \"" + this.store.getFilePath().getBody() + "\" " + exception.getMessage()); + } + } + } + } + + private FoxMessage readMessage() throws IOException { + try { + return this.circuit.readMessage(); + } + catch (IOException iOException) { + throw iOException; + } + catch (Exception exception) { + throw new IOException(exception.toString()); + } + } + + private void writeMessage(FoxMessage foxMessage) throws IOException { + try { + this.circuit.writeMessage(foxMessage); + } + catch (IOException iOException) { + throw iOException; + } + catch (Exception exception) { + throw new IOException(exception.toString()); + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/file/BFoxFileSpace.java b/modules/cfr_output/com/tridium/fox/sys/file/BFoxFileSpace.java new file mode 100644 index 0000000..e84a6ea --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/file/BFoxFileSpace.java @@ -0,0 +1,236 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.transfer.RemoteTransferSpace + * com.tridium.sys.transfer.TransferResult + * com.tridium.sys.transfer.TransferStrategy + * javax.baja.file.BDirectory + * javax.baja.file.BFileSpace + * javax.baja.file.BIDirectory + * javax.baja.file.BIFile + * javax.baja.file.BIFileStore + * javax.baja.file.FilePath + * javax.baja.naming.BOrd + * javax.baja.nav.BINavNode + * javax.baja.sys.BIcon + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.LexiconText + */ +package com.tridium.fox.sys.file; + +import com.tridium.fox.sys.BFoxSession; +import com.tridium.fox.sys.BIFoxProxySpace; +import com.tridium.fox.sys.file.BFileChannel; +import com.tridium.fox.sys.file.BFoxFileStore; +import com.tridium.fox.sys.file.FoxFileException; +import com.tridium.sys.transfer.RemoteTransferSpace; +import com.tridium.sys.transfer.TransferResult; +import com.tridium.sys.transfer.TransferStrategy; +import java.io.IOException; +import java.util.ArrayList; +import javax.baja.file.BDirectory; +import javax.baja.file.BFileSpace; +import javax.baja.file.BIDirectory; +import javax.baja.file.BIFile; +import javax.baja.file.BIFileStore; +import javax.baja.file.FilePath; +import javax.baja.naming.BOrd; +import javax.baja.nav.BINavNode; +import javax.baja.sys.BIcon; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.LexiconText; + +public class BFoxFileSpace +extends BFileSpace +implements BIDirectory, +BIFoxProxySpace, +RemoteTransferSpace { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$fox$sys$file$BFoxFileSpace == null ? (class$com$tridium$fox$sys$file$BFoxFileSpace = BFoxFileSpace.class$("com.tridium.fox.sys.file.BFoxFileSpace")) : class$com$tridium$fox$sys$file$BFoxFileSpace)); + private BOrd ordInSession = BOrd.make((String)"file:"); + private BIFile[] roots; + private BIFile stationHome; + private BFileChannel channel; + static /* synthetic */ Class class$com$tridium$fox$sys$file$BFoxFileSpace; + + public Type getType() { + return TYPE; + } + + public BFoxFileSpace() { + super("file", LexiconText.make((String)"fox", (String)"nav.fileSystem")); + } + + public BFoxFileSpace(BFileChannel bFileChannel) { + this(); + this.channel = bFileChannel; + } + + public void init(BFoxSession bFoxSession) { + } + + public void cleanup(BFoxSession bFoxSession) { + } + + public BDirectory makeDir(FilePath filePath, Context context) throws IOException { + try { + BFoxFileStore bFoxFileStore = this.channel().makeDir(this, filePath); + return new BDirectory((BIFileStore)bFoxFileStore); + } + catch (Exception exception) { + exception.printStackTrace(); + throw new FoxFileException(filePath.toString(), exception); + } + } + + public BIFile makeFile(FilePath filePath, Context context) throws IOException { + try { + BFoxFileStore bFoxFileStore = this.channel().makeFile(this, filePath); + return this.makeFile((BIFileStore)bFoxFileStore); + } + catch (Exception exception) { + exception.printStackTrace(); + throw new FoxFileException(filePath.toString(), exception); + } + } + + public void move(FilePath filePath, FilePath filePath2, Context context) throws IOException { + try { + this.channel().move(this, filePath, filePath2); + } + catch (Exception exception) { + exception.printStackTrace(); + throw new FoxFileException("" + filePath + "->" + filePath2, exception); + } + } + + public void delete(FilePath filePath, Context context) throws IOException { + try { + this.channel().delete(this, filePath); + } + catch (Exception exception) { + exception.printStackTrace(); + throw new FoxFileException(filePath.toString(), exception); + } + } + + public BIFile[] listFiles() { + if (this.roots == null) { + BFoxFileStore bFoxFileStore = new BFoxFileStore(this, new FilePath("!")); + BDirectory bDirectory = new BDirectory((BIFileStore)bFoxFileStore, LexiconText.make((String)"baja", (String)"nav.sysHome")); + bDirectory.setIcon(BIcon.std((String)"home.png")); + BFoxFileStore bFoxFileStore2 = new BFoxFileStore(this, new FilePath("^")); + BDirectory bDirectory2 = new BDirectory((BIFileStore)bFoxFileStore2, LexiconText.make((String)"baja", (String)"nav.stationHome")); + bDirectory2.setIcon(BIcon.std((String)"database.png")); + ArrayList arrayList = new ArrayList(); + this.addRoot(arrayList, "!", "nav.sysHome", "home.png"); + this.addRoot(arrayList, "^", "nav.stationHome", "database.png"); + return arrayList.toArray(new BIFile[arrayList.size()]); + } + return this.roots; + } + + private void addRoot(ArrayList arrayList, String string, String string2, String string3) { + try { + FilePath filePath = new FilePath(string); + BFoxFileStore bFoxFileStore = this.channel().head(this, filePath); + BDirectory bDirectory = new BDirectory((BIFileStore)bFoxFileStore, LexiconText.make((String)"baja", (String)string2)); + bDirectory.setIcon(BIcon.std((String)string3)); + arrayList.add(bDirectory); + } + catch (Exception exception) { + System.out.println("FoxFileSpace \"" + string + "\" unsupported"); + } + } + + public BOrd getOrdInSession() { + return this.ordInSession; + } + + public BIFileStore findStore(FilePath filePath) { + try { + return this.channel().head(this, filePath); + } + catch (Exception exception) { + exception.printStackTrace(); + throw new FoxFileException(filePath.toString(), exception); + } + } + + public BIFile getChild(BIFile bIFile, String string) { + return this.findFile(bIFile.getFilePath().merge(string)); + } + + public BIFile[] getChildren(BIFile bIFile) { + return this.list(bIFile.getFilePath()); + } + + private BIFile[] list(FilePath filePath) { + try { + BFoxFileStore[] bFoxFileStoreArray = this.channel().list(this, filePath); + BIFile[] bIFileArray = new BIFile[bFoxFileStoreArray.length]; + for (int i = 0; i < bIFileArray.length; ++i) { + bIFileArray[i] = this.makeFile((BIFileStore)bFoxFileStoreArray[i]); + } + return bIFileArray; + } + catch (Exception exception) { + throw new FoxFileException(filePath.toString(), exception); + } + } + + public TransferResult transfer(TransferStrategy transferStrategy) throws Exception { + return this.channel().transfer(transferStrategy); + } + + public boolean hasNavChildren() { + return true; + } + + public BOrd getNavOrd() { + return BOrd.make((String)(super.getNavOrd().toString() + "^")); + } + + public BINavNode getNavChild(String string) { + return this.getStationHome().getNavChild(string); + } + + public BINavNode[] getNavChildren() { + return this.getStationHome().getNavChildren(); + } + + public BIFile getStationHome() { + if (this.stationHome == null) { + this.stationHome = this.findFile(new FilePath("^")); + } + return this.stationHome; + } + + public BFoxSession getFoxSession() { + if (this.channel != null) { + return null; + } + return (BFoxSession)this.getNavParent(); + } + + public BFileChannel channel() { + if (this.channel != null) { + return this.channel; + } + return (BFileChannel)this.getFoxSession().getConnection().getChannels().get("file"); + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/file/BFoxFileStore.java b/modules/cfr_output/com/tridium/fox/sys/file/BFoxFileStore.java new file mode 100644 index 0000000..f4b5a66 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/file/BFoxFileStore.java @@ -0,0 +1,148 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BAbstractFileStore + * javax.baja.file.BFileSpace + * javax.baja.file.BIFile + * javax.baja.file.FilePath + * javax.baja.io.BajaIOException + * javax.baja.security.BPermissions + * javax.baja.sys.BAbsTime + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys.file; + +import com.tridium.fox.sys.file.BFileChannel; +import com.tridium.fox.sys.file.BFoxFileSpace; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import javax.baja.file.BAbstractFileStore; +import javax.baja.file.BFileSpace; +import javax.baja.file.BIFile; +import javax.baja.file.FilePath; +import javax.baja.io.BajaIOException; +import javax.baja.security.BPermissions; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public class BFoxFileStore +extends BAbstractFileStore { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$fox$sys$file$BFoxFileStore == null ? (class$com$tridium$fox$sys$file$BFoxFileStore = BFoxFileStore.class$("com.tridium.fox.sys.file.BFoxFileStore")) : class$com$tridium$fox$sys$file$BFoxFileStore)); + BAbsTime modified; + boolean isDirectory; + boolean isReadonly; + long size; + int hashCode; + BPermissions permissions; + long crc = -1L; + static /* synthetic */ Class class$com$tridium$fox$sys$file$BFoxFileStore; + + public BFoxFileStore(BFoxFileSpace bFoxFileSpace, FilePath filePath) { + super((BFileSpace)bFoxFileSpace, filePath); + } + + public boolean isDirectory() { + return this.isDirectory; + } + + public boolean isReadonly() { + return this.isReadonly; + } + + public long getSize() { + return this.size; + } + + public BAbsTime getLastModified() { + return this.modified; + } + + protected boolean doSetLastModified(BAbsTime bAbsTime) throws IOException { + try { + if (this.channel().setLastModified(this.getFilePath(), bAbsTime)) { + this.modified = bAbsTime; + return true; + } + return false; + } + catch (Exception exception) { + throw new IOException("Cannot update setLastModified: " + this.getFilePath()); + } + } + + public BPermissions getPermissions(BIFile bIFile, Context context) { + return this.permissions; + } + + public int hashCode() { + return this.hashCode; + } + + public boolean equals(Object object) { + if (object instanceof BFoxFileStore) { + BFoxFileStore bFoxFileStore = (BFoxFileStore)((Object)object); + return this.getFileSpace() == bFoxFileStore.getFileSpace() && this.getFilePath().equals((Object)bFoxFileStore.getFilePath()); + } + return false; + } + + public InputStream getInputStream() throws IOException { + try { + return this.channel().read(this); + } + catch (IOException iOException) { + throw iOException; + } + catch (Exception exception) { + throw new BajaIOException((Throwable)exception); + } + } + + public OutputStream getOutputStream() throws IOException { + try { + return this.channel().write(this); + } + catch (IOException iOException) { + throw iOException; + } + catch (Exception exception) { + throw new BajaIOException((Throwable)exception); + } + } + + public long getCrc() throws IOException { + if (this.crc == -1L && !this.isDirectory()) { + try { + this.crc = this.channel().getCrc(this.getFilePath()); + } + catch (Exception exception) { + throw new IOException("Cannot get CRC: " + this.getFilePath()); + } + } + return this.crc; + } + + public BFileChannel channel() { + return ((BFoxFileSpace)this.getFileSpace()).channel(); + } + + public Type getType() { + return TYPE; + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/file/FoxFileException.java b/modules/cfr_output/com/tridium/fox/sys/file/FoxFileException.java new file mode 100644 index 0000000..b32f121 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/file/FoxFileException.java @@ -0,0 +1,21 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BajaRuntimeException + */ +package com.tridium.fox.sys.file; + +import javax.baja.sys.BajaRuntimeException; + +public class FoxFileException +extends BajaRuntimeException { + public FoxFileException(String string, Throwable throwable) { + super(string, throwable); + } + + public FoxFileException(String string) { + super(string); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/spy/BFoxSpySpace.java b/modules/cfr_output/com/tridium/fox/sys/spy/BFoxSpySpace.java new file mode 100644 index 0000000..f4e4fa6 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/spy/BFoxSpySpace.java @@ -0,0 +1,88 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.FilePath + * javax.baja.naming.UnresolvedException + * javax.baja.spy.BSpy + * javax.baja.spy.BSpySpace + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.LexiconText + */ +package com.tridium.fox.sys.spy; + +import com.tridium.fox.sys.BFoxSession; +import com.tridium.fox.sys.BIFoxProxySpace; +import com.tridium.fox.sys.spy.BSpyChannel; +import javax.baja.file.FilePath; +import javax.baja.naming.UnresolvedException; +import javax.baja.spy.BSpy; +import javax.baja.spy.BSpySpace; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.LexiconText; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxSpySpace +extends BSpySpace +implements BIFoxProxySpace { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$fox$sys$spy$BFoxSpySpace; + + public Type getType() { + return TYPE; + } + + public void init(BFoxSession bFoxSession) { + } + + public void cleanup(BFoxSession bFoxSession) { + } + + public BSpy resolveSpy(FilePath filePath) { + try { + return this.channel().get(filePath); + } + catch (Exception exception) { + exception.printStackTrace(); + throw new UnresolvedException(filePath.toString(), (Throwable)exception); + } + } + + public BFoxSession getFoxSession() { + return (BFoxSession)this.getNavParent(); + } + + public BSpyChannel channel() { + return (BSpyChannel)this.getFoxSession().getConnection().getChannels().get("spy"); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BFoxSpySpace() { + super("spy", LexiconText.make((String)"fox", (String)"nav.spy")); + } + + static { + Class clazz = class$com$tridium$fox$sys$spy$BFoxSpySpace; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$spy$BFoxSpySpace = BFoxSpySpace.class("[Lcom.tridium.fox.sys.spy.BFoxSpySpace;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/spy/BSpyChannel.java b/modules/cfr_output/com/tridium/fox/sys/spy/BSpyChannel.java new file mode 100644 index 0000000..f9e98b0 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/spy/BSpyChannel.java @@ -0,0 +1,110 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.FilePath + * javax.baja.security.PermissionException + * javax.baja.spy.BSpy + * javax.baja.spy.BSpySpace + * javax.baja.spy.Spy + * javax.baja.spy.SpyWriter + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.fox.sys.spy; + +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.InvalidCommandException; +import com.tridium.fox.sys.BFoxChannel; +import com.tridium.fox.sys.spy.FoxSpy; +import java.io.ByteArrayOutputStream; +import java.io.OutputStream; +import javax.baja.file.FilePath; +import javax.baja.security.PermissionException; +import javax.baja.spy.BSpy; +import javax.baja.spy.BSpySpace; +import javax.baja.spy.Spy; +import javax.baja.spy.SpyWriter; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BSpyChannel +extends BFoxChannel { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$fox$sys$spy$BSpyChannel; + + public Type getType() { + return TYPE; + } + + public FoxResponse process(FoxRequest foxRequest) throws Exception { + String string = foxRequest.command; + if (string == "get") { + return this.get(foxRequest); + } + throw new InvalidCommandException(string); + } + + public BSpy get(FilePath filePath) throws Exception { + FoxRequest foxRequest = this.makeRequest("get"); + foxRequest.add("path", filePath.getBody()); + if (this.isTraceOn()) { + this.trace("c:get \"" + filePath.getBody() + '\"'); + } + FoxResponse foxResponse = this.sendSync(foxRequest); + String string = foxResponse.getString("title"); + byte[] byArray = foxResponse.getBlob("content"); + return BSpy.make((FilePath)filePath, (Spy)new FoxSpy(string, new String(byArray))); + } + + public FoxResponse get(FoxRequest foxRequest) throws Exception { + BSpy bSpy; + FilePath filePath = new FilePath(foxRequest.getString("path")); + if (this.isTraceOn()) { + this.trace("s:get \"" + filePath.getBody() + '\"'); + } + if (!this.getPermissionsFor(bSpy = BSpySpace.INSTANCE.resolveSpy(filePath)).hasOperatorRead()) { + throw new PermissionException(); + } + Spy spy = bSpy.get(); + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + SpyWriter spyWriter = new SpyWriter((OutputStream)byteArrayOutputStream, filePath, this.getSessionContext()); + spy.write(spyWriter); + spyWriter.flush(); + byte[] byArray = byteArrayOutputStream.toByteArray(); + FoxResponse foxResponse = new FoxResponse(foxRequest); + foxResponse.add("title", spy.getTitle()); + foxResponse.add("content", byArray); + return foxResponse; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BSpyChannel() { + super("spy"); + } + + static { + Class clazz = class$com$tridium$fox$sys$spy$BSpyChannel; + if (clazz == null) { + clazz = class$com$tridium$fox$sys$spy$BSpyChannel = BSpyChannel.class("[Lcom.tridium.fox.sys.spy.BSpyChannel;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/spy/FoxIndexSpy.java b/modules/cfr_output/com/tridium/fox/sys/spy/FoxIndexSpy.java new file mode 100644 index 0000000..fed3798 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/spy/FoxIndexSpy.java @@ -0,0 +1,92 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.spy.Spy + * javax.baja.spy.SpyDir + * javax.baja.spy.SpyWriter + * javax.baja.sys.BObject + */ +package com.tridium.fox.sys.spy; + +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxConnection; +import com.tridium.fox.session.FoxSession; +import com.tridium.fox.sys.Acceptor; +import com.tridium.fox.sys.BFoxClientConnection; +import com.tridium.fox.sys.spy.FoxLog; +import com.tridium.fox.sys.spy.FoxSessionSpy; +import javax.baja.spy.Spy; +import javax.baja.spy.SpyDir; +import javax.baja.spy.SpyWriter; +import javax.baja.sys.BObject; + +public class FoxIndexSpy +extends SpyDir { + public Spy find(String string) { + if (string.equals("log")) { + return new FoxLog.Index(); + } + int n = Integer.parseInt(string.substring("session-".length())); + FoxSession foxSession = Fox.getSession(n); + return new FoxSessionSpy(foxSession); + } + + public void write(SpyWriter spyWriter) { + FoxSession[] foxSessionArray = Fox.getSessions(); + spyWriter.startProps(); + spyWriter.trTitle((Object)"Fox", 2); + spyWriter.prop((Object)"requestTimeout", Fox.requestTimeout); + spyWriter.prop((Object)"keepAliveInterval", Fox.keepAliveInterval); + spyWriter.prop((Object)"soTimeout", Fox.soTimeout); + spyWriter.prop((Object)"tcpNoDelay", Fox.tcpNoDelay); + spyWriter.prop((Object)"failsafeTimeouts", Fox.failsafeTimeouts); + spyWriter.prop((Object)"foxDeadlocks", Fox.deadlocks); + spyWriter.prop((Object)"maxServerSessions", Fox.maxServerSessions); + spyWriter.prop((Object)"maxQueueSize", Fox.maxQueueSize); + spyWriter.prop((Object)"circuitChunkSize", Fox.circuitChunkSize); + spyWriter.prop((Object)"circuitMaxReceiveBuffer", Fox.circuitMaxReceiveBuffer); + spyWriter.prop((Object)"hostName", (Object)Fox.hostName); + spyWriter.prop((Object)"hostAddress", (Object)Fox.hostAddress); + spyWriter.prop((Object)"app", (Object)(Fox.appName + ' ' + Fox.appVersion)); + spyWriter.prop((Object)"vm", (Object)(Fox.vmName + ' ' + Fox.vmVersion)); + spyWriter.prop((Object)"os", (Object)(Fox.osName + ' ' + Fox.osVersion)); + spyWriter.prop((Object)"exceptionTranslator", (Object)Fox.exceptionTranslator.getClass().getName()); + spyWriter.prop((Object)"engageLinger", (Object)("" + BFoxClientConnection.engageLinger)); + spyWriter.prop((Object)"license.tunneling.fox", Acceptor.foxTunnelingLicensed()); + spyWriter.trTitle((Object)"Fox Log", 2); + spyWriter.prop((Object)"Fox Log Index", (Object)("size=" + FoxLog.size)); + spyWriter.trTitle((Object)"Client Sessions", 2); + int n = 0; + while (n < foxSessionArray.length) { + if (!foxSessionArray[n].isServer()) { + this.prop(spyWriter, foxSessionArray[n]); + } + ++n; + } + spyWriter.trTitle((Object)("Server Sessions [cached count=" + Fox.getServerSessionCount() + ']'), 2); + n = 0; + while (n < foxSessionArray.length) { + if (foxSessionArray[n].isServer()) { + this.prop(spyWriter, foxSessionArray[n]); + } + ++n; + } + spyWriter.trTitle((Object)"Fox Thread Pool Worker", 2); + spyWriter.endProps(); + BFoxClientConnection.spyThreadPoolWorker(spyWriter); + } + + private final void prop(SpyWriter spyWriter, FoxSession foxSession) { + Object object; + String string = "session-" + foxSession.getId(); + FoxConnection foxConnection = foxSession.conn(); + int n = -1; + if (foxConnection instanceof BObject && (object = ((BObject)foxConnection).fw(803, null, null, null, null)) instanceof Integer) { + n = (Integer)object; + } + object = n != -1 ? string + "-fw" : string; + spyWriter.prop((Object)("" + (String)object + ""), (Object)foxSession); + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/spy/FoxLog.java b/modules/cfr_output/com/tridium/fox/sys/spy/FoxLog.java new file mode 100644 index 0000000..dc1f976 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/spy/FoxLog.java @@ -0,0 +1,618 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.util.ThrowableUtil + * javax.baja.log.Log + * javax.baja.nre.util.IntHashMap + * javax.baja.nre.util.SortUtil + * javax.baja.spy.Spy + * javax.baja.spy.SpyDir + * javax.baja.spy.SpyWriter + * javax.baja.sys.BRelTime + * javax.baja.sys.Clock + * javax.baja.sys.Sys + */ +package com.tridium.fox.sys.spy; + +import com.tridium.fox.message.FoxMessage; +import com.tridium.fox.session.Fox; +import com.tridium.fox.session.FoxSession; +import com.tridium.util.ThrowableUtil; +import java.io.Writer; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import javax.baja.log.Log; +import javax.baja.nre.util.IntHashMap; +import javax.baja.nre.util.SortUtil; +import javax.baja.spy.Spy; +import javax.baja.spy.SpyDir; +import javax.baja.spy.SpyWriter; +import javax.baja.sys.BRelTime; +import javax.baja.sys.Clock; +import javax.baja.sys.Sys; + +public class FoxLog { + static int nextWhoId = 0; + static final int SERVER = 1; + static final int ERROR = 3; + static final int WARNING = 2; + static final int MESSAGE = 1; + static final int TRACE = 0; + static final int OPENED = 10; + static final int CLOSED = 11; + static final int REJECTED = 12; + static DateFormat format = new SimpleDateFormat("HH:mm:ss dd-MMM-yy z"); + static Object lock = new Object(); + static final int max; + static int size; + static Rec head; + static Rec tail; + static HashMap whoHistory; + Log log; + String logName; + FoxSession session; + + public static FoxLog make(String string) { + return new FoxLog(Log.getLog((String)string)); + } + + public Log log() { + return this.log; + } + + public String getLogName() { + return this.logName; + } + + public boolean isTraceOn() { + return this.log.isTraceOn(); + } + + public void error(String string) { + this.log(3, string, null); + } + + public void error(String string, Throwable throwable) { + this.log(3, string, throwable); + } + + public void warning(String string) { + this.log(2, string, null); + } + + public void warning(String string, Throwable throwable) { + this.log(2, string, throwable); + } + + public void message(String string) { + this.log(1, string, null); + } + + public void message(String string, Throwable throwable) { + this.log(1, string, throwable); + } + + public void trace(String string) { + this.log(0, string, null); + } + + public void trace(String string, Throwable throwable) { + this.log(0, string, throwable); + } + + public void log(int n, String string, Throwable throwable) { + if (this.log.isLoggable(n)) { + this.log.log(n, string, throwable); + FoxLog.add(new Rec(n, this.session, this.logName, string, throwable)); + } + } + + public void logRecOnly(int n, String string) { + if (this.log.isLoggable(n)) { + FoxLog.add(new Rec(n, this.session, this.logName, string, null)); + } + } + + public FoxSession session() { + return this.session; + } + + public void setSession(FoxSession foxSession) { + this.session = foxSession; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void opened(FoxSession foxSession) { + this.session = foxSession; + String string = "Opened: " + FoxLog.toString(foxSession); + if (!FoxLog.stationToStationConnection(foxSession)) { + this.log.message(string); + } else if (this.log.isTraceOn()) { + this.log.trace(string); + } + FoxLog.add(new Rec(10, foxSession, this.logName, string, null)); + String string2 = FoxLog.toWho(foxSession); + Object object = lock; + synchronized (object) { + Who who = (Who)whoHistory.get(string2); + if (who == null) { + who = new Who(string2); + whoHistory.put(string2, who); + } + who.opened(foxSession); + return; + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void closed(FoxSession foxSession, Throwable throwable) { + block10: { + String string; + int n; + if (this.session == foxSession) { + n = 11; + string = "Closed: " + FoxLog.toString(foxSession); + } else { + n = 12; + string = "Rejected: " + FoxLog.toString(foxSession); + } + if (!FoxLog.stationToStationConnection(foxSession)) { + this.log.message(string); + } else if (this.log.isTraceOn()) { + this.log.trace(string); + } + FoxLog.add(new Rec(n, foxSession, this.logName, string, throwable)); + String string2 = FoxLog.toWho(foxSession); + Object object = lock; + synchronized (object) { + Who who; + block9: { + who = (Who)whoHistory.get(string2); + if (who == null) { + who = new Who(string2); + whoHistory.put(string2, who); + } + if (n != 11) break block9; + who.closed(foxSession); + break block10; + } + who.rejected(foxSession); + } + } + this.session = null; + } + + public static String toWho(FoxSession foxSession) { + if (foxSession == null) { + return "null"; + } + try { + String string; + FoxMessage foxMessage = foxSession.getRemoteHello(); + if (foxMessage == null) { + foxMessage = new FoxMessage(); + try { + string = foxSession.getSocket().getInetAddress().toString(); + } + catch (NullPointerException nullPointerException) { + string = "unknown"; + } + } else { + string = foxMessage.getString("hostName", "unknown"); + } + String string2 = foxMessage.getString("app.name", "unknown"); + String string3 = foxMessage.getString("station.name", null); + String string4 = foxMessage.getString("user", null); + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(string2); + if (string3 != null) { + stringBuffer.append(" [").append(string3).append("]"); + } else if (string4 != null) { + stringBuffer.append(" [").append(string4).append("]"); + } + stringBuffer.append(" @ ").append(string); + return stringBuffer.toString(); + } + catch (Exception exception) { + exception.printStackTrace(); + return "err"; + } + } + + public static String toString(FoxSession foxSession) { + if (foxSession == null) { + return "null"; + } + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(foxSession.getId()); + stringBuffer.append(foxSession.isServer() ? " <- " : " -> "); + stringBuffer.append(foxSession.getRemoteId()); + stringBuffer.append(" :: "); + stringBuffer.append(FoxLog.toWho(foxSession)); + return stringBuffer.toString(); + } + + static String toTime(long l) { + if (l <= 0L) { + return "null"; + } + return format.format(new Date(Clock.millis() - Clock.ticks() + l)); + } + + static String toAge(long l) { + return BRelTime.toString((long)(Clock.ticks() - l)); + } + + static String toDuration(long l) { + return BRelTime.toString((long)l); + } + + static boolean stationToStationConnection(FoxSession foxSession) { + try { + String string = foxSession.getRemoteHello().getString("app.name", ""); + boolean bl = false; + if (string.equals("Station") && string.equals(Fox.appName)) { + bl = true; + } + return bl; + } + catch (Exception exception) { + return false; + } + } + + static void header(SpyWriter spyWriter) { + spyWriter.w((Object)"\n"); + spyWriter.w((Object)Fox.appName).w((Object)" ").w((Object)Fox.appVersion); + if (Sys.getStation() != null) { + spyWriter.w((Object)(" [" + Sys.getStation().getStationName() + ']')); + } + spyWriter.w((Object)(" | " + FoxLog.toTime(Clock.ticks()))); + spyWriter.w((Object)" | Log Index"); + spyWriter.w((Object)(" | All Records [" + size + "]")); + spyWriter.w((Object)"
\n"); + } + + static Who findWho(int n) { + Iterator iterator = whoHistory.values().iterator(); + while (iterator.hasNext()) { + Who who = (Who)iterator.next(); + if (who.id != n) continue; + return who; + } + return null; + } + + static Rec findRec(int n) { + Rec rec = head; + while (rec != null) { + if (rec.id == n) { + return rec; + } + rec = rec.next; + } + return null; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + static void add(Rec rec) { + Object object = lock; + synchronized (object) { + block5: { + while (true) { + if (size < max) { + if (head != null) break; + head = tail = rec; + break block5; + } + head = FoxLog.head.next; + --size; + } + rec.id = FoxLog.tail.id + 1; + FoxLog.tail.next = rec; + tail = rec; + } + ++size; + return; + } + } + + static String typeToString(int n) { + switch (n) { + case 3: { + return "Error"; + } + case 2: { + return "Warning"; + } + case 1: { + return "Message"; + } + case 0: { + return "Trace"; + } + case 10: { + return "Opened"; + } + case 11: { + return "Closed"; + } + case 12: { + return "Rejected"; + } + } + return "?" + n + '?'; + } + + private FoxLog(Log log) { + this.log = log; + this.logName = log.getLogName(); + } + + static { + int n = 1000; + try { + n = Integer.parseInt(System.getProperty("niagara.fox.logMax", "" + n)); + } + catch (Exception exception) {} + max = n; + whoHistory = new HashMap(); + FoxLog.add(new Rec(1, null, "fox", "Booted", null)); + } + + static class Rec + extends Spy { + Rec next; + int id; + long ticks = Clock.ticks(); + int sessionId; + int type; + String logName; + String msg; + Throwable ex; + + public void write(SpyWriter spyWriter) throws Exception { + FoxLog.header(spyWriter); + spyWriter.startProps("Fox Log Record"); + spyWriter.prop((Object)"Id", (Object)("" + this.id)); + spyWriter.prop((Object)"Time", (Object)FoxLog.toTime(this.ticks)); + spyWriter.prop((Object)"Age", (Object)FoxLog.toAge(this.ticks)); + spyWriter.prop((Object)"Session", this.sessionId); + spyWriter.prop((Object)"Type", (Object)FoxLog.typeToString(this.type)); + spyWriter.prop((Object)"LogName", (Object)this.logName); + spyWriter.prop((Object)"Message", (Object)this.msg); + spyWriter.endProps(); + if (this.ex != null) { + spyWriter.w((Object)"
");
+                ThrowableUtil.dump((Writer)spyWriter, (Throwable)this.ex);
+                spyWriter.w((Object)"
"); + } + } + + Rec(int n, FoxSession foxSession, String string, String string2, Throwable throwable) { + this.type = n; + this.sessionId = foxSession == null ? -1 : foxSession.getId(); + this.logName = string; + this.msg = string2; + this.ex = throwable; + } + } + + static class Who { + int id = nextWhoId++; + String key; + int[] sessionIds; + int[] remoteIds; + long[] openTicks; + long[] closeTicks; + byte[] flags; + + void opened(FoxSession foxSession) { + System.arraycopy(this.sessionIds, 0, this.sessionIds, 1, this.sessionIds.length - 1); + System.arraycopy(this.remoteIds, 0, this.remoteIds, 1, this.remoteIds.length - 1); + System.arraycopy(this.openTicks, 0, this.openTicks, 1, this.openTicks.length - 1); + System.arraycopy(this.closeTicks, 0, this.closeTicks, 1, this.closeTicks.length - 1); + System.arraycopy(this.flags, 0, this.flags, 1, this.flags.length - 1); + this.sessionIds[0] = foxSession.getId(); + this.remoteIds[0] = foxSession.getRemoteId(); + this.openTicks[0] = Clock.ticks(); + this.closeTicks[0] = -1; + this.flags[0] = (byte)(foxSession.isServer() ? 1 : 0); + } + + void closed(FoxSession foxSession) { + int n = foxSession.getId(); + int n2 = 0; + while (n2 < this.sessionIds.length) { + if (this.sessionIds[n2] == n) { + this.closeTicks[n2] = Clock.ticks(); + break; + } + ++n2; + } + } + + void rejected(FoxSession foxSession) { + this.opened(foxSession); + this.closeTicks[0] = Long.MAX_VALUE; + } + + IntHashMap sessionsToIntHashMap() { + IntHashMap intHashMap = new IntHashMap(); + int n = 0; + while (n < this.sessionIds.length) { + int n2 = this.sessionIds[n]; + if (n2 >= 0) { + intHashMap.put(n2, (Object)this); + } + ++n; + } + return intHashMap; + } + + public String toString() { + return this.key; + } + + Who(String string) { + this.key = string; + this.sessionIds = new int[20]; + this.remoteIds = new int[20]; + this.openTicks = new long[20]; + this.closeTicks = new long[20]; + this.flags = new byte[20]; + int n = 0; + while (n < 20) { + this.sessionIds[n] = -1; + ++n; + } + } + } + + static class SpyRecs + extends SpyDir { + String title; + IntHashMap sessions; + + public Spy find(String string) { + return FoxLog.findRec(Integer.parseInt(string)); + } + + public void write(SpyWriter spyWriter) throws Exception { + FoxLog.header(spyWriter); + spyWriter.startTable(true); + spyWriter.trTitle((Object)this.title, 6); + spyWriter.w((Object)"TimeAgeSidLogMessageException\n"); + Rec rec = head; + while (rec != null) { + if (this.include(rec)) { + spyWriter.w((Object)"").td((Object)("" + FoxLog.toTime(rec.ticks) + "")).td((Object)FoxLog.toAge(rec.ticks)).td((Object)("" + rec.sessionId)).td((Object)rec.logName).w((Object)"").safe(rec.msg).w((Object)"").td((Object)(rec.ex == null ? "" : rec.ex.toString())); + spyWriter.w((Object)"\n"); + } + rec = rec.next; + } + spyWriter.endTable(); + } + + boolean include(Rec rec) { + if (this.sessions == null) { + return true; + } + boolean bl = false; + if (this.sessions.get(rec.sessionId) != null) { + bl = true; + } + return bl; + } + + SpyRecs(String string, IntHashMap intHashMap) { + this.title = string; + this.sessions = intHashMap; + } + } + + static class Index + extends SpyDir { + public Spy find(String string) { + IntHashMap intHashMap; + String string2; + if (string.equals("all")) { + string2 = "All Records"; + intHashMap = null; + } else if (string.startsWith("byWho-")) { + Who who = FoxLog.findWho(Integer.parseInt(string.substring(6))); + string2 = "Records for " + who.key; + intHashMap = who.sessionsToIntHashMap(); + } else if (string.startsWith("bySession-")) { + int n = Integer.parseInt(string.substring(10)); + string2 = "Records for FoxSession " + n; + intHashMap = new IntHashMap(); + intHashMap.put(n, (Object)this); + } else { + throw new IllegalStateException(); + } + return new SpyRecs(string2, intHashMap); + } + + public void write(SpyWriter spyWriter) throws Exception { + FoxLog.header(spyWriter); + Object[] objectArray = whoHistory.values().toArray(new Who[whoHistory.size()]); + SortUtil.sort((Object[])objectArray); + spyWriter.startTable(true); + spyWriter.trTitle((Object)("Log of who has made fox connections [" + objectArray.length + ']'), 4); + spyWriter.w((Object)"SessionOpenedClosedDuration\n"); + int n = 0; + while (n < objectArray.length) { + Object object = objectArray[n]; + spyWriter.trTitle((Object)("" + object), 4); + int n2 = ((Who)object).sessionIds.length - 1; + while (n2 >= 0) { + int n3 = ((Who)object).sessionIds[n2]; + if (n3 >= 0) { + String string; + String string2; + int n4 = ((Who)object).remoteIds[n2]; + long l = ((Who)object).openTicks[n2]; + long l2 = ((Who)object).closeTicks[n2]; + boolean bl = false; + if ((((Who)object).flags[n2] & 1) != 0) { + bl = true; + } + boolean bl2 = bl; + String string3 = n3 + (bl2 ? " <- " : " -> ") + n4; + boolean bl3 = false; + if (l2 <= 0L) { + string2 = "Open"; + string = FoxLog.toDuration(Clock.ticks() - l); + bl3 = true; + } else if (l2 == Long.MAX_VALUE) { + string2 = "Rejected"; + string = "-"; + } else { + string2 = FoxLog.toTime(l2); + string = FoxLog.toDuration(l2 - l); + } + spyWriter.w((Object)"").td((Object)("" + string3 + "")).td((Object)FoxLog.toTime(l)).td((Object)string2).td((Object)string).w((Object)"\n"); + } + --n2; + } + ++n; + } + spyWriter.endTable(); + } + + Index() { + } + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/spy/FoxSessionSpy.java b/modules/cfr_output/com/tridium/fox/sys/spy/FoxSessionSpy.java new file mode 100644 index 0000000..1eb6c35 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/spy/FoxSessionSpy.java @@ -0,0 +1,41 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.spy.ObjectSpy + * javax.baja.spy.Spy + * javax.baja.spy.SpyDir + * javax.baja.spy.SpyWriter + * javax.baja.sys.BObject + */ +package com.tridium.fox.sys.spy; + +import com.tridium.fox.session.FoxSession; +import java.io.PrintWriter; +import javax.baja.spy.ObjectSpy; +import javax.baja.spy.Spy; +import javax.baja.spy.SpyDir; +import javax.baja.spy.SpyWriter; +import javax.baja.sys.BObject; + +public class FoxSessionSpy +extends SpyDir { + private FoxSession session; + + public void write(SpyWriter spyWriter) throws Exception { + spyWriter.a("connection", "Session Connection Info"); + this.session.spy((PrintWriter)spyWriter); + } + + public Spy find(String string) { + if (string.equals("connection") && this.session != null && this.session.conn() instanceof BObject) { + return new ObjectSpy((BObject)this.session.conn()); + } + return null; + } + + public FoxSessionSpy(FoxSession foxSession) { + this.session = foxSession; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/spy/FoxSpy.java b/modules/cfr_output/com/tridium/fox/sys/spy/FoxSpy.java new file mode 100644 index 0000000..87a14f0 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/spy/FoxSpy.java @@ -0,0 +1,31 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.spy.Spy + * javax.baja.spy.SpyWriter + */ +package com.tridium.fox.sys.spy; + +import javax.baja.spy.Spy; +import javax.baja.spy.SpyWriter; + +public class FoxSpy +extends Spy { + String title; + String content; + + public String getTitle() { + return this.title; + } + + public void write(SpyWriter spyWriter) { + spyWriter.write(this.content); + } + + public FoxSpy(String string, String string2) { + this.title = string; + this.content = string2; + } +} + diff --git a/modules/cfr_output/com/tridium/fox/sys/user/BUserChannel.java b/modules/cfr_output/com/tridium/fox/sys/user/BUserChannel.java new file mode 100644 index 0000000..ef70ff2 --- /dev/null +++ b/modules/cfr_output/com/tridium/fox/sys/user/BUserChannel.java @@ -0,0 +1,146 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.user.BUserPasswordConfiguration + * javax.baja.naming.BOrd + * javax.baja.security.BPassword + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.LocalizableException + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.user.BPasswordStrength + * javax.baja.user.BUser + * javax.baja.user.BUserService + * javax.baja.util.Lexicon + */ +package com.tridium.fox.sys.user; + +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.InvalidCommandException; +import com.tridium.fox.sys.BFoxChannel; +import com.tridium.user.BUserPasswordConfiguration; +import javax.baja.naming.BOrd; +import javax.baja.security.BPassword; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.LocalizableException; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.user.BPasswordStrength; +import javax.baja.user.BUser; +import javax.baja.user.BUserService; +import javax.baja.util.Lexicon; + +public class BUserChannel +extends BFoxChannel { + public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$fox$sys$user$BUserChannel == null ? (class$com$tridium$fox$sys$user$BUserChannel = BUserChannel.class$("com.tridium.fox.sys.user.BUserChannel")) : class$com$tridium$fox$sys$user$BUserChannel)); + private BOrd homePage; + private BOrd navFile; + private BPasswordStrength passwordStrength; + static /* synthetic */ Class class$com$tridium$fox$sys$user$BUserChannel; + + public Type getType() { + return TYPE; + } + + public BUserChannel() { + super("user"); + } + + public FoxResponse process(FoxRequest foxRequest) throws Exception { + String string = foxRequest.command; + if (string == "fetchPrefs") { + return this.fetchPrefs(foxRequest); + } + if (string == "setPassword") { + return this.setPassword(foxRequest); + } + throw new InvalidCommandException(string); + } + + public BOrd getHomePage() { + return this.homePage; + } + + public BOrd getNavFile() { + return this.navFile; + } + + public BPasswordStrength getPasswordStrength() { + return this.passwordStrength; + } + + public void fetchPrefs() throws Exception { + FoxResponse foxResponse = this.sendSync(this.makeRequest("fetchPrefs")); + this.homePage = BOrd.make((String)foxResponse.getString("homePage")); + this.navFile = BOrd.make((String)foxResponse.getString("navFile")); + this.passwordStrength = new BPasswordStrength(foxResponse.getInt("minLength", 8), foxResponse.getInt("minLowerCase", 0), foxResponse.getInt("minUpperCase", 0), foxResponse.getInt("minDigits", 1), foxResponse.getInt("minSpecial", 0)); + } + + private FoxResponse fetchPrefs(FoxRequest foxRequest) throws Exception { + BUser bUser = this.getServerConnection().getUser(); + FoxResponse foxResponse = new FoxResponse(foxRequest); + foxResponse.add("homePage", bUser.getHomePage().toString()); + foxResponse.add("navFile", bUser.getNavFile().toString()); + BUserService bUserService = (BUserService)Sys.getService((Type)BUserService.TYPE); + BPasswordStrength bPasswordStrength = bUserService.getPasswordStrength(); + foxResponse.add("minLength", bPasswordStrength.getMinimumLength()); + foxResponse.add("minDigits", bPasswordStrength.getMinimumDigits()); + foxResponse.add("minUpperCase", bPasswordStrength.getMinimumUpperCase()); + foxResponse.add("minLowerCase", bPasswordStrength.getMinimumLowerCase()); + foxResponse.add("minSpecial", bPasswordStrength.getMinimumSpecial()); + return foxResponse; + } + + public void setPassword(BPassword bPassword) throws Exception { + this.setPassword(bPassword, false); + } + + public void setPassword(BPassword bPassword, boolean bl) throws Exception { + FoxRequest foxRequest = this.makeRequest("setPassword"); + foxRequest.add("password", bPassword.encodeToString()); + foxRequest.add("forceChange", bl); + FoxResponse foxResponse = this.sendSync(foxRequest); + String string = foxResponse.getString("err", null); + if (string != null) { + throw new BajaRuntimeException(string); + } + } + + private FoxResponse setPassword(FoxRequest foxRequest) throws Exception { + try { + BUserPasswordConfiguration bUserPasswordConfiguration; + BUser bUser = this.getServerConnection().getUser(); + BPassword bPassword = (BPassword)BPassword.DEFAULT.decodeFromString(foxRequest.getString("password")); + if (bUser.getPassword().validate(bPassword.getValue()) && foxRequest.getBoolean("forceChange", false)) { + throw new LocalizableException(Lexicon.make((String)"baja"), "user.strongPassword.alreadyUsed"); + } + BUserService bUserService = (BUserService)Sys.getService((Type)BUserService.TYPE); + bUserService.checkPassword(bPassword.getValue()); + if (bUserService.canUsePasswordFeatures(bUser) && (bUserPasswordConfiguration = bUserService.getUserPasswordConfig(bUser)) != null) { + if (bUserService.isDuplicatePassword(bPassword.getValue(), bUser)) { + throw new LocalizableException(Lexicon.make((String)"baja"), "user.strongPassword.alreadyUsed"); + } + bUserPasswordConfiguration.setForceResetAtNextLogin(false); + } + bUser.setPassword(bPassword); + return new FoxResponse(foxRequest); + } + catch (Exception exception) { + FoxResponse foxResponse = new FoxResponse(foxRequest); + foxResponse.add("err", exception.getMessage()); + return foxResponse; + } + } + + static /* synthetic */ Class class$(String string) { + try { + return Class.forName(string); + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/install/Attrib.java b/modules/cfr_output/com/tridium/install/Attrib.java new file mode 100644 index 0000000..1ed56d4 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/Attrib.java @@ -0,0 +1,26 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.install; + +import java.io.DataInputStream; +import java.io.IOException; + +class Attrib { + int nameIndex; + String name; + int len; + byte[] info; + + Attrib(DataInputStream dataInputStream, String[] stringArray) throws IOException { + this.nameIndex = dataInputStream.readUnsignedShort(); + this.name = stringArray[this.nameIndex]; + if (this.name == null) { + throw new IOException("Could not look up attribute."); + } + this.len = dataInputStream.readInt(); + this.info = new byte[this.len]; + dataInputStream.readFully(this.info, 0, this.len); + } +} + diff --git a/modules/cfr_output/com/tridium/install/BDaemonPlatform.java b/modules/cfr_output/com/tridium/install/BDaemonPlatform.java new file mode 100644 index 0000000..ce85bbf --- /dev/null +++ b/modules/cfr_output/com/tridium/install/BDaemonPlatform.java @@ -0,0 +1,587 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.FilePath + * javax.baja.naming.SlotPath + * javax.baja.security.AuthenticationException + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BIcon + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.timezone.BTimeZone + * javax.baja.util.BTypeSpec + * javax.baja.xml.XElem + */ +package com.tridium.install; + +import com.tridium.install.BDependency; +import com.tridium.install.BModuleList; +import com.tridium.install.BRemoteModuleList; +import com.tridium.install.BVersion; +import com.tridium.install.part.BArchPart; +import com.tridium.install.part.BBrandPart; +import com.tridium.install.part.BModelPart; +import com.tridium.install.part.BModulePart; +import com.tridium.install.part.BNrePart; +import com.tridium.install.part.BOsPart; +import com.tridium.install.part.BPart; +import com.tridium.install.part.BVmPart; +import com.tridium.platform.BPlatformSSLSettings; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.daemon.BModuleContent; +import com.tridium.platform.daemon.DaemonTimeUtil; +import com.tridium.platform.daemon.file.BDaemonDirectoryStore; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import java.net.ConnectException; +import javax.baja.file.FilePath; +import javax.baja.naming.SlotPath; +import javax.baja.security.AuthenticationException; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BIcon; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.timezone.BTimeZone; +import javax.baja.util.BTypeSpec; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BDaemonPlatform +extends BComponent { + public static final Property hostId = BDaemonPlatform.newProperty((int)1, (String)"", null); + public static final Property hostName = BDaemonPlatform.newProperty((int)1, (String)"", null); + public static final Property port = BDaemonPlatform.newProperty((int)1, (int)-1, null); + public static final Property archPart = BDaemonPlatform.newProperty((int)1, (BValue)BArchPart.makeNull(), null); + public static final Property osPart = BDaemonPlatform.newProperty((int)1, (BValue)BOsPart.makeNull(), null); + public static final Property nrePart = BDaemonPlatform.newProperty((int)1, (BValue)BNrePart.makeNull(), null); + public static final Property brandPart = BDaemonPlatform.newProperty((int)1, (BValue)BBrandPart.makeNull(), null); + public static final Property vmPart = BDaemonPlatform.newProperty((int)1, (BValue)BVmPart.makeNull(), null); + public static final Property modelPart = BDaemonPlatform.newProperty((int)1, (BValue)BModelPart.makeNull(), null); + public static final Property moduleList = BDaemonPlatform.newProperty((int)1, (BValue)new BModuleList(), null); + public static final Property otherParts = BDaemonPlatform.newProperty((int)1, (BValue)new BVector(), null); + public static final Property moduleContent = BDaemonPlatform.newProperty((int)1, (BValue)BModuleContent.doc, null); + public static final Property stripLineNumbers = BDaemonPlatform.newProperty((int)1, (boolean)false, null); + public static final Property maxStations = BDaemonPlatform.newProperty((int)1, (int)1, null); + public static final Property maxSedonaApps = BDaemonPlatform.newProperty((int)1, (int)1, null); + public static final Property osTimeZone = BDaemonPlatform.newProperty((int)1, (BValue)BTimeZone.NULL, null); + public static final Property allowStationRestart = BDaemonPlatform.newProperty((int)1, (boolean)true, null); + public static final Property configDistFileName = BDaemonPlatform.newProperty((int)1, (String)"nre-config-*.dist", null); + public static final Property isNpsdk = BDaemonPlatform.newProperty((int)3, (boolean)false, null); + public static final Property sedonaSupported = BDaemonPlatform.newProperty((int)3, (boolean)false, null); + public static final Property sedonaEnabled = BDaemonPlatform.newProperty((int)3, (boolean)false, null); + public static final Property niagaraStationsEnabled = BDaemonPlatform.newProperty((int)3, (boolean)true, null); + public static final Property niagaraR2Supported = BDaemonPlatform.newProperty((int)3, (boolean)false, null); + public static final Property niagaraR2Enabled = BDaemonPlatform.newProperty((int)3, (boolean)false, null); + public static final Property platformSSLSupported = BDaemonPlatform.newProperty((int)3, (boolean)false, null); + public static final Property platformSSLSettings = BDaemonPlatform.newProperty((int)3, (BValue)new BPlatformSSLSettings(), null); + public static final Action checkSession = BDaemonPlatform.newAction((int)4, null); + public static final Type TYPE; + private static BIcon icon; + private boolean sessionInvalid; + private String daemonTimestamp; + private BDaemonSession session; + protected boolean localInstance; + static /* synthetic */ Class class$com$tridium$install$BDaemonPlatform; + + public String getHostId() { + return this.getString(hostId); + } + + public void setHostId(String string) { + this.setString(hostId, string, null); + } + + public String getHostName() { + return this.getString(hostName); + } + + public void setHostName(String string) { + this.setString(hostName, string, null); + } + + public int getPort() { + return this.getInt(port); + } + + public void setPort(int n) { + this.setInt(port, n, null); + } + + public BArchPart getArchPart() { + return (BArchPart)this.get(archPart); + } + + public void setArchPart(BArchPart bArchPart) { + this.set(archPart, (BValue)bArchPart, null); + } + + public BOsPart getOsPart() { + return (BOsPart)this.get(osPart); + } + + public void setOsPart(BOsPart bOsPart) { + this.set(osPart, (BValue)bOsPart, null); + } + + public BNrePart getNrePart() { + return (BNrePart)this.get(nrePart); + } + + public void setNrePart(BNrePart bNrePart) { + this.set(nrePart, (BValue)bNrePart, null); + } + + public BBrandPart getBrandPart() { + return (BBrandPart)this.get(brandPart); + } + + public void setBrandPart(BBrandPart bBrandPart) { + this.set(brandPart, (BValue)bBrandPart, null); + } + + public BVmPart getVmPart() { + return (BVmPart)this.get(vmPart); + } + + public void setVmPart(BVmPart bVmPart) { + this.set(vmPart, (BValue)bVmPart, null); + } + + public BModelPart getModelPart() { + return (BModelPart)this.get(modelPart); + } + + public void setModelPart(BModelPart bModelPart) { + this.set(modelPart, (BValue)bModelPart, null); + } + + public BModuleList getModuleList() { + return (BModuleList)this.get(moduleList); + } + + public void setModuleList(BModuleList bModuleList) { + this.set(moduleList, (BValue)bModuleList, null); + } + + public BVector getOtherParts() { + return (BVector)this.get(otherParts); + } + + public void setOtherParts(BVector bVector) { + this.set(otherParts, (BValue)bVector, null); + } + + public BModuleContent getModuleContent() { + return (BModuleContent)this.get(moduleContent); + } + + public void setModuleContent(BModuleContent bModuleContent) { + this.set(moduleContent, (BValue)bModuleContent, null); + } + + public boolean getStripLineNumbers() { + return this.getBoolean(stripLineNumbers); + } + + public void setStripLineNumbers(boolean bl) { + this.setBoolean(stripLineNumbers, bl, null); + } + + public int getMaxStations() { + return this.getInt(maxStations); + } + + public void setMaxStations(int n) { + this.setInt(maxStations, n, null); + } + + public int getMaxSedonaApps() { + return this.getInt(maxSedonaApps); + } + + public void setMaxSedonaApps(int n) { + this.setInt(maxSedonaApps, n, null); + } + + public BTimeZone getOsTimeZone() { + return (BTimeZone)this.get(osTimeZone); + } + + public void setOsTimeZone(BTimeZone bTimeZone) { + this.set(osTimeZone, (BValue)bTimeZone, null); + } + + public boolean getAllowStationRestart() { + return this.getBoolean(allowStationRestart); + } + + public void setAllowStationRestart(boolean bl) { + this.setBoolean(allowStationRestart, bl, null); + } + + public String getConfigDistFileName() { + return this.getString(configDistFileName); + } + + public void setConfigDistFileName(String string) { + this.setString(configDistFileName, string, null); + } + + public boolean getIsNpsdk() { + return this.getBoolean(isNpsdk); + } + + public void setIsNpsdk(boolean bl) { + this.setBoolean(isNpsdk, bl, null); + } + + public boolean getSedonaSupported() { + return this.getBoolean(sedonaSupported); + } + + public void setSedonaSupported(boolean bl) { + this.setBoolean(sedonaSupported, bl, null); + } + + public boolean getSedonaEnabled() { + return this.getBoolean(sedonaEnabled); + } + + public void setSedonaEnabled(boolean bl) { + this.setBoolean(sedonaEnabled, bl, null); + } + + public boolean getNiagaraStationsEnabled() { + return this.getBoolean(niagaraStationsEnabled); + } + + public void setNiagaraStationsEnabled(boolean bl) { + this.setBoolean(niagaraStationsEnabled, bl, null); + } + + public boolean getNiagaraR2Supported() { + return this.getBoolean(niagaraR2Supported); + } + + public void setNiagaraR2Supported(boolean bl) { + this.setBoolean(niagaraR2Supported, bl, null); + } + + public boolean getNiagaraR2Enabled() { + return this.getBoolean(niagaraR2Enabled); + } + + public void setNiagaraR2Enabled(boolean bl) { + this.setBoolean(niagaraR2Enabled, bl, null); + } + + public boolean getPlatformSSLSupported() { + return this.getBoolean(platformSSLSupported); + } + + public void setPlatformSSLSupported(boolean bl) { + this.setBoolean(platformSSLSupported, bl, null); + } + + public BPlatformSSLSettings getPlatformSSLSettings() { + return (BPlatformSSLSettings)this.get(platformSSLSettings); + } + + public void setPlatformSSLSettings(BPlatformSSLSettings bPlatformSSLSettings) { + this.set(platformSSLSettings, (BValue)bPlatformSSLSettings, null); + } + + public void checkSession() { + this.invoke(checkSession, null, null); + } + + public Type getType() { + return TYPE; + } + + public final BPart getPart(String string, BTypeSpec bTypeSpec) { + try { + return this.getPart(string, bTypeSpec, null); + } + catch (RuntimeException runtimeException) { + throw runtimeException; + } + catch (Exception exception) { + throw new BajaRuntimeException((Throwable)exception); + } + } + + public final BPart getPart(BPart bPart) { + return this.getPart(bPart.getPartName(), bPart.getType().getTypeSpec()); + } + + public final BPart getPart(BDependency bDependency) { + return this.getPart(bDependency.getPartName(), bDependency.getPartTypeSpec()); + } + + public final BDaemonSession getDaemonSession() { + if (!this.localInstance) { + throw new IllegalStateException("illegal call on proxy instance of BDaemonPlatform"); + } + return this.session; + } + + public boolean meets(BDependency bDependency) { + BPart bPart = this.getPart(bDependency); + boolean bl = false; + if (bPart != null) { + bl = bPart.meets(bDependency); + } + return bl; + } + + protected final void init() throws ConnectException, AuthenticationException { + this.init(null); + } + + protected void init(DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException { + BPlatformSSLSettings bPlatformSSLSettings; + BDaemonSession bDaemonSession = this.getDaemonSession(); + if (bDaemonSession == null) { + return; + } + if (bDaemonSession.getHostProperties().getHostId().trim().length() == 0) { + bDaemonSession.reloadHostProperties(); + } + try { + BTimeZone bTimeZone = DaemonTimeUtil.getOsTimeZone(bDaemonSession); + if (bTimeZone != null) { + this.setOsTimeZone(bTimeZone); + } + } + catch (ConnectException connectException) { + throw connectException; + } + catch (AuthenticationException authenticationException) { + throw authenticationException; + } + catch (RuntimeException runtimeException) { + throw runtimeException; + } + catch (Exception exception) { + throw new BajaRuntimeException((Throwable)exception); + } + this.daemonTimestamp = bDaemonSession.getHostProperties().getSessionTimestamp(); + this.setModuleContent(bDaemonSession.getHostProperties().getModuleContent()); + this.setStripLineNumbers(bDaemonSession.getHostProperties().getStripLineNumbers()); + this.setMaxStations(bDaemonSession.getHostProperties().getMaxStations()); + this.setMaxSedonaApps(bDaemonSession.getHostProperties().getMaxSedonaApps()); + this.setSedonaSupported(bDaemonSession.getHostProperties().getSedonaSupported()); + this.setSedonaEnabled(bDaemonSession.getHostProperties().getSedonaEnabled()); + this.setNiagaraStationsEnabled(bDaemonSession.getHostProperties().getNiagaraStationsEnabled()); + this.setAllowStationRestart(bDaemonSession.getHostProperties().getAllowStationRestart()); + this.setNiagaraR2Supported(bDaemonSession.getHostProperties().getNiagaraR2Supported()); + boolean bl = false; + if (bDaemonSession.getHostProperties().getNiagaraR2Supported() && BDaemonDirectoryStore.make(bDaemonSession.getFileSpace(), new FilePath("/niagara/niagaraR2")) != null && bDaemonSession.getHostProperties().getNiagaraR2Enabled()) { + bl = true; + } + this.setNiagaraR2Enabled(bl); + this.setPlatformSSLSupported(bDaemonSession.getHostProperties().getSslSupported()); + if (bDaemonSession.getHostProperties().getSslSupported()) { + bPlatformSSLSettings = bDaemonSession.getHostProperties().getSslSettings(); + this.setPlatformSSLSettings(new BPlatformSSLSettings(bPlatformSSLSettings)); + } + this.setHostName(bDaemonSession.getRemoteHost().getHostname()); + if (bDaemonSession.getHostProperties().getHttpPort() != -1) { + this.setPort(bDaemonSession.getHostProperties().getHttpPort()); + } else { + this.setPort(bDaemonSession.getRemotePort()); + } + this.setHostId(bDaemonSession.getHostProperties().getHostId()); + this.setArchPart(new BArchPart(bDaemonSession.getHostProperties().getHostArch(), null)); + if (bDaemonSession.getHostProperties().getIsVmUnspecified()) { + this.setVmPart(new BVmPart()); + } else if (bDaemonSession.getHostProperties().getVmName().equals("unknown")) { + this.setVmPart(BVmPart.makeNull()); + } else { + this.setVmPart(new BVmPart(bDaemonSession.getHostProperties().getVmName(), new BVersion(bDaemonSession.getHostProperties().getVmVendor(), bDaemonSession.getHostProperties().getVmVersion()), null)); + } + this.setModelPart(new BModelPart(bDaemonSession.getHostProperties().getModelName(), null)); + this.setOsPart(new BOsPart(bDaemonSession.getHostProperties().getOsName(), bDaemonSession.getHostProperties().getOsDesc(), new BVersion(null, bDaemonSession.getHostProperties().getOsVersion()), null, bDaemonSession.getHostProperties().getOsInstallable())); + if (bDaemonSession.getHostProperties().getNrePartDesc().equals("unknown") || bDaemonSession.getHostProperties().getNrePartName().indexOf("-???") != -1) { + this.setNrePart(BNrePart.makeNull()); + } else { + this.setNrePart(new BNrePart(bDaemonSession.getHostProperties().getNrePartName(), bDaemonSession.getHostProperties().getNrePartDesc(), new BVersion(null, bDaemonSession.getHostProperties().getNrePartVersion()), null)); + } + this.setBrandPart(new BBrandPart(bDaemonSession.getHostProperties().getBrandId(), null)); + this.getOtherParts().removeAll(); + bPlatformSSLSettings = bDaemonSession.getHostProperties().getParts().getProperties(); + while (bPlatformSSLSettings.next()) { + this.getOtherParts().add(bPlatformSSLSettings.property().getName(), (BValue)((BPart)((BPart)bPlatformSSLSettings.get()).newCopy())); + } + this.setConfigDistFileName(bDaemonSession.getHostProperties().getConfigDistFileName()); + this.setIsNpsdk(bDaemonSession.getHostProperties().getIsNpsdk()); + this.sessionInvalid = false; + } + + public final void checkSession(DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException { + this.doCheckSession(daemonSessionTaskListener); + } + + public final void doCheckSession() throws ConnectException, AuthenticationException { + this.doCheckSession(null); + } + + public void doCheckSession(DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException { + if (!this.localInstance) { + return; + } + if (this.getDaemonSession() == null || !this.getDaemonSession().getHostProperties().getSessionTimestamp().equals(this.daemonTimestamp) || this.sessionInvalid) { + this.init(daemonSessionTaskListener); + } + } + + public void requestReload() { + this.sessionInvalid = true; + } + + public BPart getPart(String string, BTypeSpec bTypeSpec, DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException { + this.checkSession(daemonSessionTaskListener); + if (bTypeSpec == null) { + return this.getPartCompat(string, daemonSessionTaskListener); + } + BPart bPart = null; + if (bTypeSpec.equals((Object)BArchPart.TYPE.getTypeSpec())) { + bPart = this.getArchPart(); + } else if (bTypeSpec.equals((Object)BOsPart.TYPE.getTypeSpec())) { + bPart = this.getOsPart(); + } else if (bTypeSpec.equals((Object)BBrandPart.TYPE.getTypeSpec())) { + bPart = this.getBrandPart(); + } else if (bTypeSpec.equals((Object)BModelPart.TYPE.getTypeSpec())) { + bPart = this.getModelPart(); + } else if (bTypeSpec.equals((Object)BNrePart.TYPE.getTypeSpec())) { + bPart = this.getNrePart(); + } else if (bTypeSpec.equals((Object)BVmPart.TYPE.getTypeSpec())) { + bPart = this.getVmPart(); + } else { + if (bTypeSpec.equals((Object)BModulePart.TYPE.getTypeSpec())) { + BModuleList bModuleList = this.getModuleList(); + bModuleList.init(daemonSessionTaskListener); + return bModuleList.getPart(string); + } + bPart = (BPart)this.getOtherParts().get(SlotPath.escape((String)string)); + } + if (bPart != null && bPart.matchesName(string)) { + return bPart; + } + return null; + } + + public BPart getSingleModulePart(String string, DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException { + BModuleList bModuleList = this.getModuleList(); + if (string != null && string.equalsIgnoreCase("baja") && bModuleList instanceof BRemoteModuleList) { + BRemoteModuleList bRemoteModuleList = (BRemoteModuleList)bModuleList; + try { + XElem xElem; + XElem[] xElemArray = bRemoteModuleList.fetchModules(string); + if (xElemArray.length == 1 && (xElem = xElemArray[0]) != null && (xElem = xElem.elem("module")) != null) { + String string2 = null; + string2 = xElem.get("name", null); + if (string2 != null && string2.equalsIgnoreCase("baja")) { + return BModulePart.make(string2, xElem); + } + } + if (bRemoteModuleList != null) { + bRemoteModuleList.setModuleElems(xElemArray); + } + } + catch (Exception exception) {} + } + bModuleList.init(daemonSessionTaskListener); + return bModuleList.getPart(string); + } + + protected BPart getPartCompat(String string, DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException { + if (!this.getArchPart().isNull() && this.getArchPart().matchesName(string)) { + return this.getArchPart(); + } + if (!this.getOsPart().isNull() && this.getOsPart().matchesName(string)) { + return this.getOsPart(); + } + if (!this.getBrandPart().isNull() && this.getBrandPart().matchesName(string)) { + return this.getBrandPart(); + } + if (!this.getModelPart().isNull() && this.getModelPart().matchesName(string)) { + return this.getModelPart(); + } + if (!this.getNrePart().isNull() && this.getNrePart().matchesName(string)) { + return this.getNrePart(); + } + BPart bPart = (BPart)this.getOtherParts().get(SlotPath.escape((String)string)); + if (bPart != null) { + return bPart; + } + if (this.getVmPart().matchesName(string)) { + return this.getVmPart(); + } + this.getModuleList().init(daemonSessionTaskListener); + return this.getModuleList().getPart(string); + } + + public BIcon getIcon() { + if (icon == null) { + icon = BIcon.std((String)"daemon.png"); + } + return icon; + } + + public String getNavDescription(Context context) { + return this.getLexicon().getText("DaemonPlatform.navDescription", new Object[]{this.getHostName()}); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.sessionInvalid = false; + this.localInstance = false; + } + + public BDaemonPlatform() { + this.this(); + } + + public BDaemonPlatform(BDaemonSession bDaemonSession) { + this.this(); + this.session = bDaemonSession; + this.localInstance = true; + } + + static { + Class clazz = class$com$tridium$install$BDaemonPlatform; + if (clazz == null) { + clazz = class$com$tridium$install$BDaemonPlatform = BDaemonPlatform.class("[Lcom.tridium.install.BDaemonPlatform;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/install/BDependency.java b/modules/cfr_output/com/tridium/install/BDependency.java new file mode 100644 index 0000000..c46237f --- /dev/null +++ b/modules/cfr_output/com/tridium/install/BDependency.java @@ -0,0 +1,795 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.data.BIDataValue + * javax.baja.nre.util.Array + * javax.baja.nre.util.TextUtil + * javax.baja.registry.DependencyInfo + * javax.baja.sys.BIcon + * javax.baja.sys.BObject + * javax.baja.sys.BStruct + * javax.baja.sys.BValue + * javax.baja.sys.BasicContext + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.BTypeSpec + * javax.baja.util.LexiconText + * javax.baja.util.PatternFilter + * javax.baja.util.Version + * javax.baja.xml.XElem + */ +package com.tridium.install; + +import com.tridium.install.BVersion; +import com.tridium.install.PartSpec; +import com.tridium.install.part.BApplicationPart; +import com.tridium.install.part.BArchPart; +import com.tridium.install.part.BBrandPart; +import com.tridium.install.part.BGenericPart; +import com.tridium.install.part.BModelPart; +import com.tridium.install.part.BModulePart; +import com.tridium.install.part.BNrePart; +import com.tridium.install.part.BOsPart; +import com.tridium.install.part.BPart; +import com.tridium.install.part.BVmPart; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.Comparator; +import java.util.Iterator; +import java.util.TreeMap; +import javax.baja.data.BIDataValue; +import javax.baja.nre.util.Array; +import javax.baja.nre.util.TextUtil; +import javax.baja.platform.install.BPlatformPartType; +import javax.baja.platform.install.BVersionRelation; +import javax.baja.platform.install.PlatformDependency; +import javax.baja.platform.install.PlatformPart; +import javax.baja.registry.DependencyInfo; +import javax.baja.sys.BIcon; +import javax.baja.sys.BObject; +import javax.baja.sys.BStruct; +import javax.baja.sys.BValue; +import javax.baja.sys.BasicContext; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.BTypeSpec; +import javax.baja.util.LexiconText; +import javax.baja.util.PatternFilter; +import javax.baja.util.Version; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BDependency +extends BStruct +implements BIDataValue { + public static final Property partName = BDependency.newProperty((int)1, (String)"unknown", null); + public static final Property version = BDependency.newProperty((int)1, (BValue)BVersion.makeZero(), null); + public static final Property versionRelation = BDependency.newProperty((int)1, (BValue)BVersionRelation.minimum, null); + public static final Property partTypeSpec = BDependency.newProperty((int)1, (BValue)BTypeSpec.DEFAULT, null); + public static final Property solverFiltersString = BDependency.newProperty((int)1, (String)"*", null); + public static final Type TYPE; + public static final LexiconText anyVersionText; + public static final LexiconText anyVersionTextWithExclude; + public static final LexiconText nameVersionWithExclude; + public static final LexiconText maxVersionText; + public static final LexiconText maxVersionTextWithExclude; + public static final LexiconText exactVersionText; + public static final LexiconText exactVersionTextWithExclude; + public static final LexiconText minVersionExclusiveText; + public static final LexiconText notEqualVersionText; + public static final LexiconText minMaxText; + public static final LexiconText minNeText; + public static final LexiconText maxInclusiveMinExclusiveText; + public static final DependencySync DEP_SYNC_KEEP_FIRST; + public static final DependencySync DEP_SYNC_KEEP_SECOND; + public static final DependencySync DEP_SYNC_NO_CHANGE; + public static final DependencySync DEP_SYNC_CONFLICT; + public static final String DEFAULT_SOLVER = "default"; + public static final String NO_SOLVERS = ""; + public static final String COMMISSIONING_SOLVER = "commissioning"; + public static final String APP_SOLVER = "app"; + public static final String ANY_SOLVER = "*"; + public static final String EXCLUSION_FACET = "exclusion"; + public static final Comparator COMPARATOR; + private Type resolvedType; + private PartSpec spec; + private PatternFilter[] solverFilters; + static /* synthetic */ Class class$com$tridium$install$BDependency; + + public String getPartName() { + return this.getString(partName); + } + + public void setPartName(String string) { + this.setString(partName, string, null); + } + + public BVersion getVersion() { + return (BVersion)this.get(version); + } + + public void setVersion(BVersion bVersion) { + this.set(version, (BValue)bVersion, null); + } + + public BVersionRelation getVersionRelation() { + return (BVersionRelation)this.get(versionRelation); + } + + public void setVersionRelation(BVersionRelation bVersionRelation) { + this.set(versionRelation, (BValue)bVersionRelation, null); + } + + public BTypeSpec getPartTypeSpec() { + return (BTypeSpec)this.get(partTypeSpec); + } + + public void setPartTypeSpec(BTypeSpec bTypeSpec) { + this.set(partTypeSpec, (BValue)bTypeSpec, null); + } + + public String getSolverFiltersString() { + return this.getString(solverFiltersString); + } + + public void setSolverFiltersString(String string) { + this.setString(solverFiltersString, string, null); + } + + public Type getType() { + return TYPE; + } + + public XElem getXml() { + XElem xElem = new XElem(); + xElem.setAttr("name", this.getPartName()); + if (!this.getSolverFiltersString().equals(ANY_SOLVER)) { + xElem.setAttr("solvers", this.getSolverFiltersString()); + } + if (this.getVersion().getBajaVersionString().trim().length() > 0) { + xElem.setAttr("bajaVersion", this.getVersion().getBajaVersionString()); + } + if (this.getVersion().getVendorVersionString().trim().length() > 0) { + xElem.setAttr("vendorVersion", this.getVersion().getVendorVersionString()); + if (this.getVersionRelation() != BVersionRelation.minimum) { + xElem.setAttr("rel", this.getVersionRelation().getTag()); + } + } + if (this.getVersion().getVendor().trim().length() > 0) { + xElem.setAttr("vendor", this.getVersion().getVendor()); + } + if (this.getPartTypeSpec().equals((Object)BModulePart.TYPE.getTypeSpec())) { + xElem.setName("dependency"); + } else if (this.getPartTypeSpec().equals((Object)BOsPart.TYPE.getTypeSpec())) { + xElem.setName("os"); + } else if (this.getPartTypeSpec().equals((Object)BVmPart.TYPE.getTypeSpec())) { + xElem.setName("vm"); + } else if (this.getPartTypeSpec().equals((Object)BArchPart.TYPE.getTypeSpec())) { + xElem.setName("arch"); + } else if (this.getPartTypeSpec().equals((Object)BModelPart.TYPE.getTypeSpec())) { + xElem.setName("model"); + } else if (this.getPartTypeSpec().equals((Object)BBrandPart.TYPE.getTypeSpec())) { + xElem.setName("brand"); + } else if (this.getPartTypeSpec().equals((Object)BNrePart.TYPE.getTypeSpec())) { + xElem.setName("nre"); + } else if (this.getPartTypeSpec().equals((Object)BApplicationPart.TYPE.getTypeSpec())) { + xElem.setName(APP_SOLVER); + } else { + xElem.setName("part"); + } + return xElem; + } + + public static BDependency forModule(String string) { + return new BDependency(string, BVersion.ZERO, BModulePart.TYPE.getTypeSpec()); + } + + public static BDependency forPart(BPart bPart) { + return BDependency.forPart(bPart, BVersionRelation.minimum); + } + + public static BDependency forPart(BPart bPart, BVersionRelation bVersionRelation) { + return new BDependency(bPart.getPartName(), bPart.getVersion(), bVersionRelation, bPart.getType().getTypeSpec(), ANY_SOLVER); + } + + public static BDependency make(XElem xElem) { + if (xElem.name().equals("dependency") || xElem.name().equals("module")) { + return new BDependency(xElem.get("name"), new BVersion(xElem.get("vendor", NO_SOLVERS), BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BModulePart.TYPE.getTypeSpec(), xElem.get("solvers", ANY_SOLVER)); + } + if (xElem.name().equals("os")) { + return new BDependency(xElem.get("name"), new BVersion(xElem.get("vendor", NO_SOLVERS), BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BOsPart.TYPE.getTypeSpec(), xElem.get("solvers", ANY_SOLVER)); + } + if (xElem.name().equals("vm")) { + return new BDependency(xElem.get("name"), new BVersion(xElem.get("vendor", NO_SOLVERS), BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BVmPart.TYPE.getTypeSpec(), xElem.get("solvers", ANY_SOLVER)); + } + if (xElem.name().equals("arch")) { + return new BDependency(xElem.get("name"), new BVersion(null, BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BArchPart.TYPE.getTypeSpec(), NO_SOLVERS); + } + if (xElem.name().equals("model")) { + return new BDependency(xElem.get("name"), new BVersion(null, BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BModelPart.TYPE.getTypeSpec(), NO_SOLVERS); + } + if (xElem.name().equals("brand")) { + return new BDependency(xElem.get("name"), BVersion.ZERO, BVersionRelation.minimum, BBrandPart.TYPE.getTypeSpec(), xElem.get("solvers", NO_SOLVERS)); + } + if (xElem.name().equals("nre")) { + return new BDependency(xElem.get("name"), new BVersion(xElem.get("vendor", NO_SOLVERS), BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BNrePart.TYPE.getTypeSpec(), xElem.get("solvers", ANY_SOLVER)); + } + if (xElem.name().equals(APP_SOLVER)) { + return new BDependency(xElem.get("name"), new BVersion(xElem.get("vendor", NO_SOLVERS), BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BApplicationPart.TYPE.getTypeSpec(), xElem.get("solvers", APP_SOLVER)); + } + if (xElem.get("name", null) != null) { + return new BDependency(xElem.get("name"), new BVersion(null, BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BGenericPart.TYPE.getTypeSpec(), xElem.get("solvers", NO_SOLVERS)); + } + return null; + } + + public PlatformDependency asPlatformDependency() { + return new PlatformDependency(){ + + public final PlatformPart getPartPrototype() { + return new PlatformPart(){ + + public final String getPartName() { + return BDependency.this.getPartName(); + } + + public final BPlatformPartType getPartType() { + return BPart.getPlatformPartType(BDependency.this.getPartTypeSpec()); + } + + public final Version getPartVersion() { + return BDependency.this.getVersion().getVendorVersion(); + } + }; + } + + public final BVersionRelation getVersionRelation() { + return BDependency.this.getVersionRelation(); + } + }; + } + + private static final String getVendorVersion(XElem xElem) { + return xElem.get("vendorVersion", xElem.get("version", NO_SOLVERS)); + } + + public Type getPartType() { + if (this.resolvedType == null) { + this.resolvedType = this.getPartTypeSpec().getResolvedType(); + } + return this.resolvedType; + } + + public PartSpec getPartSpec() { + if (this.spec == null) { + this.spec = new PartSpec(this.getPartName(), this.getPartTypeSpec()); + } + return this.spec; + } + + public void changed(Property property, Context context) { + if (property == partTypeSpec) { + this.resolvedType = this.getPartTypeSpec().getResolvedType(); + } + } + + public boolean equivalent(Object object) { + if (object instanceof BDependency) { + BDependency bDependency = (BDependency)((Object)object); + boolean bl = false; + if (this.getPartName().equals(bDependency.getPartName()) && this.getPartType().equals(bDependency.getPartType()) && this.getVersionRelation().equals((Object)bDependency.getVersionRelation()) && this.getVersion().equivalent((Object)bDependency.getVersion()) && this.getSolverFiltersString().equals(bDependency.getSolverFiltersString())) { + bl = true; + } + return bl; + } + return false; + } + + /* + * Enabled aggressive block sorting + */ + public static DependencySync sync(BDependency bDependency, BDependency bDependency2) { + String string; + BVersionRelation bVersionRelation; + BVersion bVersion; + String string2; + block40: { + int n; + block46: { + block45: { + block42: { + block44: { + block43: { + block41: { + if (bDependency == bDependency2 || bDependency.equivalent((Object)bDependency2)) { + return DEP_SYNC_KEEP_FIRST; + } + if (!bDependency.getPartTypeSpec().equals((Object)bDependency2.getPartTypeSpec())) { + return DEP_SYNC_NO_CHANGE; + } + if (bDependency.getPartName().equals(bDependency2.getPartName()) || BPart.isWildcardName(bDependency2.getPartName()) && BPart.matchesName(bDependency.getPartName(), bDependency2.getPartName())) { + string2 = bDependency.getPartName(); + } else if (BPart.isWildcardName(bDependency.getPartName()) && BPart.matchesName(bDependency2.getPartName(), bDependency.getPartName())) { + string2 = bDependency2.getPartName(); + } else { + return DEP_SYNC_NO_CHANGE; + } + bVersion = null; + bVersionRelation = null; + n = bDependency.getVersion().checkVersionRequirement(bDependency2.getVersion()); + if (n == 8) { + return DEP_SYNC_CONFLICT; + } + if (bDependency.getVersionRelation() != BVersionRelation.exact) break block41; + if (bDependency2.getVersionRelation() == BVersionRelation.exact) { + if (n != 2 && n != 16) { + return DEP_SYNC_CONFLICT; + } + bVersion = bDependency.getVersion(); + bVersionRelation = BVersionRelation.exact; + break block40; + } else if (bDependency2.getVersionRelation() == BVersionRelation.minimum) { + if (n != 2 && n != 16 && n != 1 && n != 32) { + return DEP_SYNC_CONFLICT; + } + bVersion = bDependency.getVersion(); + bVersionRelation = BVersionRelation.exact; + break block40; + } else { + if (n != 4 && n != 32 && n != 2 && n != 16) { + return DEP_SYNC_CONFLICT; + } + bVersion = bDependency.getVersion(); + bVersionRelation = BVersionRelation.exact; + } + break block40; + } + if (bDependency.getVersionRelation() != BVersionRelation.minimum) break block42; + if (bDependency2.getVersionRelation() != BVersionRelation.exact) break block43; + if (n != 2 && n != 16 && n != 4 && n != 64) { + return DEP_SYNC_CONFLICT; + } + bVersion = bDependency2.getVersion(); + bVersionRelation = BVersionRelation.exact; + break block40; + } + if (bDependency2.getVersionRelation() != BVersionRelation.minimum) break block44; + bVersionRelation = BVersionRelation.minimum; + bVersion = n == 2 || n == 16 || n == 1 || n == 32 ? bDependency.getVersion() : bDependency2.getVersion(); + break block40; + } + if (n == 2 || n == 16) { + bVersion = bDependency.getVersion(); + bVersionRelation = BVersionRelation.exact; + break block40; + } else if (n == 64) { + bVersion = bDependency2.getVersion(); + bVersionRelation = BVersionRelation.maximum; + break block40; + } else { + if (n == 4) { + return DEP_SYNC_NO_CHANGE; + } + return DEP_SYNC_CONFLICT; + } + } + if (bDependency2.getVersionRelation() != BVersionRelation.exact) break block45; + if (n != 2 && n != 16 && n != 1) { + return DEP_SYNC_CONFLICT; + } + bVersion = bDependency2.getVersion(); + bVersionRelation = BVersionRelation.exact; + break block40; + } + if (bDependency2.getVersionRelation() != BVersionRelation.minimum) break block46; + if (n == 2 || n == 16) { + bVersion = bDependency.getVersion(); + bVersionRelation = BVersionRelation.exact; + break block40; + } else if (n == 32) { + bVersion = bDependency.getVersion(); + bVersionRelation = BVersionRelation.maximum; + break block40; + } else { + if (n == 1) { + return DEP_SYNC_NO_CHANGE; + } + return DEP_SYNC_CONFLICT; + } + } + bVersionRelation = BVersionRelation.maximum; + bVersion = n == 2 || n == 16 || n == 4 ? bDependency.getVersion() : bDependency2.getVersion(); + } + if (bDependency.getSolverFiltersString().equals(bDependency2.getSolverFiltersString())) { + string = bDependency.getSolverFiltersString(); + } else if (bDependency.getSolverFiltersString().equals(ANY_SOLVER) || bDependency2.getSolverFiltersString().equals(ANY_SOLVER)) { + string = ANY_SOLVER; + } else { + TreeMap treeMap = new TreeMap(); + PatternFilter[] patternFilterArray = bDependency.getSolvers(); + int n = 0; + while (n < patternFilterArray.length) { + treeMap.put(patternFilterArray[n].getPattern(), patternFilterArray[n]); + ++n; + } + PatternFilter[] patternFilterArray2 = bDependency2.getSolvers(); + int n2 = 0; + while (n2 < patternFilterArray2.length) { + if (!treeMap.containsKey(patternFilterArray2[n2].getPattern())) { + boolean bl = true; + Iterator iterator = treeMap.values().iterator(); + while (iterator.hasNext()) { + PatternFilter patternFilter = (PatternFilter)iterator.next(); + if (patternFilter.accept(patternFilterArray2[n2].getPattern())) { + bl = false; + break; + } + if (!patternFilterArray2[n2].accept(patternFilter.getPattern())) continue; + treeMap.remove(patternFilter.getPattern()); + break; + } + if (bl) { + treeMap.put(patternFilterArray2[n2].getPattern(), patternFilterArray2[n2]); + } + } + ++n2; + } + StringBuffer stringBuffer = new StringBuffer(); + Iterator iterator = treeMap.keySet().iterator(); + while (iterator.hasNext()) { + if (stringBuffer.length() > 0) { + stringBuffer.append(';'); + } + stringBuffer.append((String)iterator.next()); + } + string = stringBuffer.toString(); + } + if (bDependency.getPartName().equals(string2) && bDependency.getVersion().equivalent((Object)bVersion) && bDependency.getVersionRelation().equals((Object)bVersionRelation) && bDependency.getSolverFiltersString().equals(string)) { + return DEP_SYNC_KEEP_FIRST; + } + if (bDependency2.getPartName().equals(string2) && bDependency2.getVersion().equivalent((Object)bVersion) && bDependency2.getVersionRelation().equals((Object)bVersionRelation) && bDependency2.getSolverFiltersString().equals(string)) { + return DEP_SYNC_KEEP_SECOND; + } + return new DependencySync(new BDependency(string2, bVersion, bVersionRelation, bDependency.getPartTypeSpec(), string)); + } + + public boolean supersedes(BDependency bDependency) { + boolean bl = false; + if (BDependency.sync(this, bDependency) == DEP_SYNC_KEEP_FIRST) { + bl = true; + } + return bl; + } + + public boolean isPlatformDependency() { + boolean bl = false; + if (this.getPartTypeSpec().equals((Object)BModelPart.TYPE.getTypeSpec()) || this.getPartTypeSpec().equals((Object)BArchPart.TYPE.getTypeSpec()) || this.getPartTypeSpec().equals((Object)BGenericPart.TYPE.getTypeSpec()) || this.getPartTypeSpec().equals((Object)BOsPart.TYPE.getTypeSpec())) { + bl = true; + } + return bl; + } + + public String toString(Context context) { + String string; + BDependency bDependency = null; + if (context != null) { + bDependency = (BDependency)context.getFacet(EXCLUSION_FACET); + context = new BasicContext(context.getUser(), context.getLanguage()); + } + if ((string = this.getVersion().toString(context)).trim().length() == 0) { + if (bDependency != null) { + if (bDependency.getPartName().equals(this.getPartName())) { + if (bDependency.getVersionRelation() == BVersionRelation.minimum) { + return maxVersionText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()}); + } + if (bDependency.getVersionRelation() == BVersionRelation.maximum) { + return minVersionExclusiveText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()}); + } + if (bDependency.getVersionRelation() == BVersionRelation.maximum) { + return notEqualVersionText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()}); + } + } else { + return anyVersionTextWithExclude.getText(context, new Object[]{this.getPartName(), bDependency.toString(context)}); + } + } + return this.getPartName(); + } + if (string.equals("0")) { + if (bDependency != null && bDependency.getPartName().equals(this.getPartName())) { + if (bDependency.getVersionRelation() == BVersionRelation.minimum) { + return maxVersionText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()}); + } + if (bDependency.getVersionRelation() == BVersionRelation.maximum) { + return minVersionExclusiveText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()}); + } + if (bDependency.getVersionRelation() == BVersionRelation.maximum) { + return notEqualVersionText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()}); + } + } + string = anyVersionText.getText(context); + } + if (this.getVersionRelation() == BVersionRelation.minimum) { + if (bDependency != null) { + if (bDependency.getPartName().equals(this.getPartName())) { + if (bDependency.getVersionRelation() == BVersionRelation.minimum) { + return minMaxText.getText(context, new Object[]{this.getPartName(), string, bDependency.getVersion()}); + } + if (bDependency.getVersionRelation() == BVersionRelation.maximum && this.getVersion().compareTo((Object)bDependency.getVersion()) <= 0) { + return minVersionExclusiveText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()}); + } + if (bDependency.getVersionRelation() == BVersionRelation.maximum) { + return minNeText.getText(context, new Object[]{this.getPartName(), string, bDependency.getVersion()}); + } + } else { + return nameVersionWithExclude.getText(context, new Object[]{this.getPartName(), string, bDependency.toString(context)}); + } + } + return BVersion.nameVersionText.getText(context, new Object[]{this.getPartName(), string}); + } + if (this.getVersionRelation() == BVersionRelation.maximum) { + if (bDependency != null) { + if (bDependency.getPartName().equals(this.getPartName())) { + if (bDependency.getVersionRelation() == BVersionRelation.minimum && this.getVersion().compareTo((Object)bDependency.getVersion()) > 0) { + return maxVersionText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()}); + } + if (bDependency.getVersionRelation() == BVersionRelation.maximum) { + return maxInclusiveMinExclusiveText.getText(context, new Object[]{this.getPartName(), string, bDependency.getVersion()}); + } + } else { + return maxVersionTextWithExclude.getText(context, new Object[]{this.getPartName(), bDependency.getVersion(), bDependency.toString(context)}); + } + } + return maxVersionText.getText(context, new Object[]{this.getPartName(), string}); + } + if (bDependency == null || bDependency.getPartName().equals(this.getPartName())) { + return exactVersionText.getText(context, new Object[]{this.getPartName(), string}); + } + return exactVersionTextWithExclude.getText(context, new Object[]{this.getPartName(), string, bDependency.toString(context)}); + } + + public BIcon getIcon() { + return BPart.getPartTypeIcon(this.getPartType()); + } + + public static BDependency[] merge(BDependency[] bDependencyArray) { + Array array = new Array((Object[])bDependencyArray); + array = array.sort(COMPARATOR); + int n = 0; + while (n < array.size() - 1) { + BDependency bDependency = (BDependency)((Object)array.get(n)); + int n2 = n + 1; + while (n2 < array.size()) { + BDependency bDependency2 = (BDependency)((Object)array.get(n2)); + DependencySync dependencySync = BDependency.sync(bDependency, bDependency2); + if (dependencySync == DEP_SYNC_KEEP_FIRST) { + array.remove(n2); + continue; + } + if (dependencySync == DEP_SYNC_KEEP_SECOND) { + array.swap(n, n2); + array.remove(n2); + continue; + } + if (dependencySync == DEP_SYNC_CONFLICT || dependencySync == DEP_SYNC_NO_CHANGE) { + ++n2; + continue; + } + array.set(n, (Object)dependencySync.mergedResult); + array.remove(n2); + } + ++n; + } + return (BDependency[])array.trim(); + } + + public PatternFilter[] getSolvers() { + if (this.solverFilters == null) { + this.solverFilters = PatternFilter.parseList((String)this.getSolverFiltersString()); + } + return this.solverFilters; + } + + public boolean canSolveWith(String[] stringArray) { + int n = 0; + while (n < stringArray.length) { + if (this.canSolveWith(stringArray[n])) { + return true; + } + ++n; + } + return false; + } + + public boolean canSolveWith(String string) { + this.getSolvers(); + int n = 0; + while (n < this.solverFilters.length) { + if (this.solverFilters[n].accept(string)) { + return true; + } + ++n; + } + return false; + } + + public BObject decode(DataInput dataInput) throws IOException { + this.setPartName(dataInput.readUTF()); + this.setVersion((BVersion)BVersion.ZERO.decode(dataInput)); + this.setVersionRelation((BVersionRelation)BVersionRelation.minimum.decode(dataInput)); + this.setPartTypeSpec(BTypeSpec.make((String)dataInput.readUTF())); + this.setSolverFiltersString(dataInput.readUTF()); + return null; + } + + public void encode(DataOutput dataOutput) throws IOException { + dataOutput.writeUTF(this.getPartName()); + this.getVersion().encode(dataOutput); + this.getVersionRelation().encode(dataOutput); + dataOutput.writeUTF(this.getPartTypeSpec().toString()); + dataOutput.writeUTF(this.getSolverFiltersString()); + } + + public BObject decodeFromString(String string) throws IOException { + BDependency bDependency = new BDependency(); + String[] stringArray = TextUtil.split((String)string, (char)';'); + bDependency.setPartName(stringArray[0]); + bDependency.getVersion().setBajaVersionString(stringArray[1]); + bDependency.getVersion().setVendor(stringArray[2]); + bDependency.getVersion().setVendorVersionString(stringArray[3]); + bDependency.setVersionRelation(BVersionRelation.make(stringArray[4])); + bDependency.setPartTypeSpec(BTypeSpec.make((String)stringArray[5])); + StringBuffer stringBuffer = new StringBuffer(); + int n = 6; + while (n < stringArray.length) { + if (stringBuffer.length() > 0) { + stringBuffer.append(';'); + } + stringBuffer.append(stringArray[n]); + ++n; + } + bDependency.setSolverFiltersString(stringBuffer.toString()); + return bDependency; + } + + public String encodeToString() throws IOException { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(this.getPartName()); + stringBuffer.append(';'); + stringBuffer.append(this.getVersion().encodeToString()); + stringBuffer.append(';'); + stringBuffer.append(this.getVersionRelation().getTag()); + stringBuffer.append(';'); + stringBuffer.append(this.getPartTypeSpec().toString()); + stringBuffer.append(';'); + stringBuffer.append(this.getSolverFiltersString()); + return stringBuffer.toString(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.resolvedType = null; + this.spec = null; + this.solverFilters = null; + } + + public BDependency() { + this.this(); + } + + public BDependency(String string, BVersion bVersion, BTypeSpec bTypeSpec) { + this(string, bVersion, BVersionRelation.minimum, bTypeSpec, ANY_SOLVER); + } + + public BDependency(String string, BVersion bVersion, BVersionRelation bVersionRelation, BTypeSpec bTypeSpec) { + this(string, bVersion, bVersionRelation, bTypeSpec, ANY_SOLVER); + } + + public BDependency(String string, BVersion bVersion, BVersionRelation bVersionRelation, BTypeSpec bTypeSpec, String string2) { + this.this(); + this.setPartName(string); + this.setVersion((BVersion)bVersion.newCopy()); + this.setVersionRelation(bVersionRelation); + this.setPartTypeSpec(bTypeSpec); + this.setSolverFiltersString(string2); + } + + public BDependency(DependencyInfo dependencyInfo) { + this.this(); + this.setPartTypeSpec(BModulePart.TYPE.getTypeSpec()); + this.setPartName(dependencyInfo.getModuleName()); + if (dependencyInfo.getVendor() != null) { + this.getVersion().setVendor(dependencyInfo.getVendor()); + } + this.getVersion().setVendorVersion(dependencyInfo.getVendorVersion()); + } + + static { + Class clazz = class$com$tridium$install$BDependency; + if (clazz == null) { + clazz = class$com$tridium$install$BDependency = BDependency.class("[Lcom.tridium.install.BDependency;", false); + } + TYPE = Sys.loadType((Class)clazz); + anyVersionText = LexiconText.make((Type)TYPE, (String)"Dependency.anyVersion"); + anyVersionTextWithExclude = LexiconText.make((Type)TYPE, (String)"Dependency.anyVersion.exclude"); + nameVersionWithExclude = LexiconText.make((Type)TYPE, (String)"Dependency.nameVersion.exclude"); + maxVersionText = LexiconText.make((Type)TYPE, (String)"Dependency.maxVersion"); + maxVersionTextWithExclude = LexiconText.make((Type)TYPE, (String)"Dependency.maxVersion.exclude"); + exactVersionText = LexiconText.make((Type)TYPE, (String)"Dependency.exactVersion"); + exactVersionTextWithExclude = LexiconText.make((Type)TYPE, (String)"Dependency.exactVersion.exclude"); + minVersionExclusiveText = LexiconText.make((Type)TYPE, (String)"Dependency.minVersionExclusive"); + notEqualVersionText = LexiconText.make((Type)TYPE, (String)"Dependency.notEqualVersion"); + minMaxText = LexiconText.make((Type)TYPE, (String)"Dependency.minMax"); + minNeText = LexiconText.make((Type)TYPE, (String)"Dependency.minNe"); + maxInclusiveMinExclusiveText = LexiconText.make((Type)TYPE, (String)"Dependency.maxInclusiveMinExclusive"); + DEP_SYNC_KEEP_FIRST = new DependencySync("keep first"); + DEP_SYNC_KEEP_SECOND = new DependencySync("keep second"); + DEP_SYNC_NO_CHANGE = new DependencySync("no change"); + DEP_SYNC_CONFLICT = new DependencySync("conflict"); + COMPARATOR = new Comparator(){ + + public final int compare(Object object, Object object2) { + BDependency bDependency = (BDependency)((Object)object); + BDependency bDependency2 = (BDependency)((Object)object2); + int n = bDependency.getPartTypeSpec().toString().compareTo(bDependency2.getPartTypeSpec().toString()); + if (n == 0 && (n = bDependency.getPartName().compareTo(bDependency2.getPartName())) == 0 && (n = bDependency.getVersion().compareTo((Object)bDependency2.getVersion())) == 0) { + n = bDependency.getVersionRelation().getTag().compareTo(bDependency2.getVersionRelation().getTag()); + } + return n; + } + }; + } + + public static class DependencySync { + public BDependency mergedResult; + public String descr; + + public boolean equals(Object object) { + if (this == object) { + return true; + } + if (this.mergedResult != null && object instanceof DependencySync) { + boolean bl = false; + if (((DependencySync)object).mergedResult != null && ((DependencySync)object).mergedResult.equivalent((Object)this.mergedResult)) { + bl = true; + } + return bl; + } + return false; + } + + public String toString() { + return this.descr == null ? "merge into " + this.mergedResult.toString() : this.descr; + } + + public DependencySync(BDependency bDependency) { + this.mergedResult = bDependency; + this.descr = null; + } + + public DependencySync(String string) { + this.mergedResult = null; + this.descr = string; + } + } +} + diff --git a/modules/cfr_output/com/tridium/install/BLocalDaemonPlatform.java b/modules/cfr_output/com/tridium/install/BLocalDaemonPlatform.java new file mode 100644 index 0000000..e56b094 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/BLocalDaemonPlatform.java @@ -0,0 +1,78 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.security.AuthenticationException + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.install; + +import com.tridium.install.BDaemonPlatform; +import com.tridium.install.BRegisteredModuleList; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.daemon.LocalSessionUtil; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import java.net.ConnectException; +import javax.baja.security.AuthenticationException; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BLocalDaemonPlatform +extends BDaemonPlatform { + public static final Type TYPE; + private static BLocalDaemonPlatform instance; + static /* synthetic */ Class class$com$tridium$install$BLocalDaemonPlatform; + + public Type getType() { + return TYPE; + } + + protected void init(DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException { + super.init(daemonSessionTaskListener); + BRegisteredModuleList bRegisteredModuleList = new BRegisteredModuleList(); + bRegisteredModuleList.init(null); + this.setModuleList(bRegisteredModuleList); + } + + public static BLocalDaemonPlatform getInstance() throws ConnectException, AuthenticationException { + BDaemonSession bDaemonSession; + if (instance == null && (bDaemonSession = LocalSessionUtil.getLocalSession()) != null) { + instance = new BLocalDaemonPlatform(bDaemonSession); + } + return instance; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BLocalDaemonPlatform() { + } + + private BLocalDaemonPlatform(BDaemonSession bDaemonSession) throws ConnectException, AuthenticationException { + super(bDaemonSession); + } + + static { + Class clazz = class$com$tridium$install$BLocalDaemonPlatform; + if (clazz == null) { + clazz = class$com$tridium$install$BLocalDaemonPlatform = BLocalDaemonPlatform.class("[Lcom.tridium.install.BLocalDaemonPlatform;", false); + } + TYPE = Sys.loadType((Class)clazz); + instance = null; + } +} + diff --git a/modules/cfr_output/com/tridium/install/BLocalDirectoryModuleList.java b/modules/cfr_output/com/tridium/install/BLocalDirectoryModuleList.java new file mode 100644 index 0000000..2e7c7d8 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/BLocalDirectoryModuleList.java @@ -0,0 +1,123 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BDirectory + * javax.baja.file.BIFile + * javax.baja.naming.SlotPath + * javax.baja.sys.BValue + * javax.baja.sys.LocalizableRuntimeException + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.install; + +import com.tridium.install.BModuleList; +import com.tridium.install.installable.BModuleInstallable; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import javax.baja.file.BDirectory; +import javax.baja.file.BIFile; +import javax.baja.naming.SlotPath; +import javax.baja.sys.BValue; +import javax.baja.sys.LocalizableRuntimeException; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BLocalDirectoryModuleList +extends BModuleList { + public static final Type TYPE; + private boolean initialized; + private BDirectory[] moduleDirectories; + static /* synthetic */ Class class$com$tridium$install$BLocalDirectoryModuleList; + + public Type getType() { + return TYPE; + } + + public BDirectory[] getDirectories() { + return this.moduleDirectories; + } + + public void doReload(DaemonSessionTaskListener daemonSessionTaskListener) { + this.init(daemonSessionTaskListener); + } + + public void reset() { + super.reset(); + this.getModules().removeAll(); + this.initialized = false; + } + + private final void addFiles(BDirectory bDirectory) { + BIFile[] bIFileArray = bDirectory.listFiles(); + int n = 0; + while (n < bIFileArray.length) { + BModuleInstallable bModuleInstallable; + if (bIFileArray[n].getExtension() != null && (bIFileArray[n].getExtension().equals("jar") || bIFileArray[n].getExtension().equals("sjar")) && (bModuleInstallable = (BModuleInstallable)BModuleInstallable.make(bIFileArray[n])) != null) { + String string = SlotPath.escape((String)bModuleInstallable.getInstallableName()); + if (this.getModules().getProperty(string) == null) { + this.getModules().add(string, (BValue)bModuleInstallable); + } else { + throw new LocalizableRuntimeException("platform", "ModuleList.exception.dupModule", new Object[]{bModuleInstallable.getInstallableName()}); + } + } + ++n; + } + } + + public synchronized void doInit(DaemonSessionTaskListener daemonSessionTaskListener) { + if (!this.initialized) { + this.getModules().removeAll(); + int n = 0; + while (n < this.moduleDirectories.length) { + this.addFiles(this.moduleDirectories[n]); + ++n; + } + this.initialized = true; + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.initialized = false; + } + + public BLocalDirectoryModuleList(BDirectory bDirectory) { + this(new BDirectory[]{bDirectory}); + } + + public BLocalDirectoryModuleList(BDirectory[] bDirectoryArray) { + this.this(); + this.moduleDirectories = bDirectoryArray; + this.setLocalInstance(true); + this.reset(); + } + + public BLocalDirectoryModuleList() { + this.this(); + } + + static { + Class clazz = class$com$tridium$install$BLocalDirectoryModuleList; + if (clazz == null) { + clazz = class$com$tridium$install$BLocalDirectoryModuleList = BLocalDirectoryModuleList.class("[Lcom.tridium.install.BLocalDirectoryModuleList;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/install/BModuleList.java b/modules/cfr_output/com/tridium/install/BModuleList.java new file mode 100644 index 0000000..cf1ab4c --- /dev/null +++ b/modules/cfr_output/com/tridium/install/BModuleList.java @@ -0,0 +1,332 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.naming.SlotPath + * javax.baja.nre.util.Array + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.Context + * javax.baja.sys.Cursor + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.install; + +import com.tridium.install.BDependency; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.installable.BModuleInstallable; +import com.tridium.install.installable.ClosableCursor; +import com.tridium.install.installable.CursorUtil; +import com.tridium.install.installable.InstallableRegistry; +import com.tridium.install.part.BModulePart; +import com.tridium.install.part.BPart; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import java.util.HashMap; +import javax.baja.naming.SlotPath; +import javax.baja.nre.util.Array; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.Context; +import javax.baja.sys.Cursor; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BModuleList +extends BComponent +implements InstallableRegistry { + public static final Property modules = BModuleList.newProperty((int)1, (BValue)new BVector(), null); + public static final Action init = BModuleList.newAction((int)4, null); + public static final Type TYPE; + private HashMap dependentModuleNames; + private boolean isLocalInstance; + static /* synthetic */ Class class$com$tridium$install$BModuleList; + static /* synthetic */ Class class$com$tridium$install$installable$BModuleInstallable; + + public BVector getModules() { + return (BVector)this.get(modules); + } + + public void setModules(BVector bVector) { + this.set(modules, (BValue)bVector, null); + } + + public void init() { + this.invoke(init, null, null); + } + + public Type getType() { + return TYPE; + } + + public final synchronized void load() { + this.load(null); + } + + public final synchronized void load(DaemonSessionTaskListener daemonSessionTaskListener) { + this.checkLocalInstance(); + this.doReload(daemonSessionTaskListener); + } + + public final synchronized void reload() { + this.reload(null); + } + + public final synchronized void reload(DaemonSessionTaskListener daemonSessionTaskListener) { + this.reset(); + this.init(daemonSessionTaskListener); + this.doReload(daemonSessionTaskListener); + } + + public synchronized void reset() { + this.checkLocalInstance(); + this.dependentModuleNames = null; + } + + protected synchronized void doReload(DaemonSessionTaskListener daemonSessionTaskListener) { + } + + public BPart getPart(String string) { + BModuleInstallable bModuleInstallable = this.getModuleInstallable(string); + return bModuleInstallable == null ? null : bModuleInstallable.getModulePart(); + } + + public BModuleInstallable getModuleInstallable(String string) { + return (BModuleInstallable)this.getModules().get(SlotPath.escape((String)string)); + } + + public Array getDependentModuleNames(String string) { + Array array; + if (this.dependentModuleNames == null) { + this.dependentModuleNames = new HashMap(); + array = this.getModules().getProperties(); + while (array.next()) { + BModulePart bModulePart = ((BModuleInstallable)array.get()).getModulePart(); + BDependency[] bDependencyArray = bModulePart.getDependencyArray(); + int n = 0; + while (n < bDependencyArray.length) { + String string2 = bDependencyArray[n].getPartName(); + Array array2 = (Array)this.dependentModuleNames.get(string2); + if (array2 == null) { + array2 = new Array(); + this.dependentModuleNames.put(string2, array2); + } + array2.add((Object)bModulePart.getPartName()); + ++n; + } + } + } + return (array = (Array)this.dependentModuleNames.get(string)) == null ? new Array() : array; + } + + public boolean meets(BDependency bDependency) { + BPart bPart = this.getPart(bDependency.getPartName()); + if (bPart == null) { + return false; + } + return bPart.meets(bDependency); + } + + public BInstallable[] findInstallables(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + BInstallable bInstallable = this.findInstallable(bDependency, daemonSessionTaskListener); + if (bInstallable == null) { + return new BInstallable[0]; + } + return new BInstallable[]{bInstallable}; + } + + /* + * Unable to fully structure code + */ + public BInstallable findInstallable(BDependency var1_1, DaemonSessionTaskListener var2_2) throws Exception { + this.init(var2_2); + var3_3 = this.getModules().getProperties(); + if (true) ** GOTO lbl7 + do { + if ((var4_4 = (BModuleInstallable)var3_3.get()).meets(var1_1)) { + return var4_4; + } +lbl7: + // 3 sources + + if ((v0 = BModuleList.class$com$tridium$install$installable$BModuleInstallable) != null) continue; + v0 = BModuleList.class("[Lcom.tridium.install.installable.BModuleInstallable;", false); + } while (var3_3.next(v0)); + return null; + } + + public ClosableCursor getInstallables(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener) { + this.init(); + return CursorUtil.closable((Cursor)this.getModules().getProperties()); + } + + public ClosableCursor getInstallables(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + BInstallable bInstallable = this.findInstallable(bDependency, daemonSessionTaskListener); + if (bInstallable == null) { + return new ClosableCursor(){ + + public final void close() { + } + + public final BObject get() { + throw new IllegalStateException(); + } + + public final Context getContext() { + return null; + } + + public final boolean next() { + return false; + } + + public final boolean next(Class clazz) { + return false; + } + + public final boolean nextComponent() { + return false; + } + }; + } + return new ItemCursor((BObject)bInstallable); + } + + public final void init(DaemonSessionTaskListener daemonSessionTaskListener) { + this.doInit(daemonSessionTaskListener); + } + + public final void doInit() { + this.doInit(null); + } + + public synchronized void doInit(DaemonSessionTaskListener daemonSessionTaskListener) { + throw new UnsupportedOperationException(); + } + + protected void setLocalInstance(boolean bl) { + this.isLocalInstance = bl; + } + + protected boolean isLocalInstance() { + return this.isLocalInstance; + } + + protected void checkLocalInstance() { + if (!this.isLocalInstance()) { + throw new IllegalStateException("operation not supported on remote BModuleList"); + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.dependentModuleNames = null; + } + + public BModuleList() { + this.this(); + } + + static { + Class clazz = class$com$tridium$install$BModuleList; + if (clazz == null) { + clazz = class$com$tridium$install$BModuleList = BModuleList.class("[Lcom.tridium.install.BModuleList;", false); + } + TYPE = Sys.loadType((Class)clazz); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public static class ItemCursor + implements ClosableCursor { + private BObject item; + private int index; + static /* synthetic */ Class class$javax$baja$sys$BComponent; + + public void close() { + } + + public BObject get() { + if (this.index == 0) { + return this.item; + } + throw new IllegalStateException(); + } + + public Context getContext() { + return null; + } + + public boolean next() { + if (this.index < 0) { + ++this.index; + return true; + } + return false; + } + + public boolean next(Class clazz) { + boolean bl = this.next(); + while (bl && !clazz.isAssignableFrom(this.get().getClass())) { + bl = this.next(); + } + return bl; + } + + public boolean nextComponent() { + Class clazz = class$javax$baja$sys$BComponent; + if (clazz == null) { + clazz = class$javax$baja$sys$BComponent = ItemCursor.class("[Ljavax.baja.sys.BComponent;", false); + } + return this.next(clazz); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.index = -1; + } + + public ItemCursor(BObject bObject) { + this.this(); + this.item = bObject; + this.index = -1; + } + } +} + diff --git a/modules/cfr_output/com/tridium/install/BPartInstallStatus.java b/modules/cfr_output/com/tridium/install/BPartInstallStatus.java new file mode 100644 index 0000000..2ee13b5 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/BPartInstallStatus.java @@ -0,0 +1,76 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BFrozenEnum + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.install; + +import javax.baja.sys.BFrozenEnum; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public final class BPartInstallStatus +extends BFrozenEnum { + public static final int NOT_FOUND = 0; + public static final int NO_CHANGE = 1; + public static final int INSTALL = 2; + public static final int UPGRADE = 3; + public static final int REINSTALL = 4; + public static final int DOWNGRADE = 5; + public static final int UNINSTALL = 6; + public static final BPartInstallStatus notFound = new BPartInstallStatus(0); + public static final BPartInstallStatus noChange = new BPartInstallStatus(1); + public static final BPartInstallStatus install = new BPartInstallStatus(2); + public static final BPartInstallStatus upgrade = new BPartInstallStatus(3); + public static final BPartInstallStatus reinstall = new BPartInstallStatus(4); + public static final BPartInstallStatus downgrade = new BPartInstallStatus(5); + public static final BPartInstallStatus uninstall = new BPartInstallStatus(6); + public static final Type TYPE; + public static final BPartInstallStatus DEFAULT; + static /* synthetic */ Class class$com$tridium$install$BPartInstallStatus; + + public final Type getType() { + return TYPE; + } + + public static final BPartInstallStatus make(int n) { + return (BPartInstallStatus)notFound.getRange().get(n, false); + } + + public static final BPartInstallStatus make(String string) { + return (BPartInstallStatus)notFound.getRange().get(string); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private BPartInstallStatus(int n) { + super(n); + } + + static { + Class clazz = class$com$tridium$install$BPartInstallStatus; + if (clazz == null) { + clazz = class$com$tridium$install$BPartInstallStatus = BPartInstallStatus.class("[Lcom.tridium.install.BPartInstallStatus;", false); + } + TYPE = Sys.loadType((Class)clazz); + DEFAULT = notFound; + } +} + diff --git a/modules/cfr_output/com/tridium/install/BRegisteredModuleList.java b/modules/cfr_output/com/tridium/install/BRegisteredModuleList.java new file mode 100644 index 0000000..d6da341 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/BRegisteredModuleList.java @@ -0,0 +1,102 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.registry.NModuleInfo + * javax.baja.naming.SlotPath + * javax.baja.registry.ModuleInfo + * javax.baja.sys.BValue + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.install; + +import com.tridium.install.BModuleList; +import com.tridium.install.installable.BModuleInstallable; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import com.tridium.sys.registry.NModuleInfo; +import javax.baja.naming.SlotPath; +import javax.baja.registry.ModuleInfo; +import javax.baja.sys.BValue; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BRegisteredModuleList +extends BModuleList { + public static final Type TYPE; + private static BRegisteredModuleList instance; + private boolean initialized; + static /* synthetic */ Class class$com$tridium$install$BRegisteredModuleList; + + public Type getType() { + return TYPE; + } + + public static BModuleList getInstance() { + if (instance == null) { + instance = new BRegisteredModuleList(); + instance.init(null); + } + return instance; + } + + public void doReload(DaemonSessionTaskListener daemonSessionTaskListener) { + this.init(daemonSessionTaskListener); + } + + public void reset() { + super.reset(); + this.getModules().removeAll(); + this.initialized = false; + } + + public synchronized void doInit(DaemonSessionTaskListener daemonSessionTaskListener) { + if (!this.initialized) { + this.getModules().removeAll(); + ModuleInfo[] moduleInfoArray = Sys.getRegistry().getModules(); + int n = 0; + while (n < moduleInfoArray.length) { + BModuleInstallable bModuleInstallable = BModuleInstallable.make((NModuleInfo)moduleInfoArray[n]); + if (bModuleInstallable != null) { + this.getModules().add(SlotPath.escape((String)bModuleInstallable.getInstallableName()), (BValue)bModuleInstallable); + } + ++n; + } + this.initialized = true; + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.initialized = false; + } + + public BRegisteredModuleList() { + this.this(); + } + + static { + Class clazz = class$com$tridium$install$BRegisteredModuleList; + if (clazz == null) { + clazz = class$com$tridium$install$BRegisteredModuleList = BRegisteredModuleList.class("[Lcom.tridium.install.BRegisteredModuleList;", false); + } + TYPE = Sys.loadType((Class)clazz); + instance = null; + } +} + diff --git a/modules/cfr_output/com/tridium/install/BRemoteDaemonPlatform.java b/modules/cfr_output/com/tridium/install/BRemoteDaemonPlatform.java new file mode 100644 index 0000000..7cb3ba2 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/BRemoteDaemonPlatform.java @@ -0,0 +1,101 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.security.AuthenticationException + * javax.baja.sys.BValue + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.install; + +import com.tridium.install.BDaemonPlatform; +import com.tridium.install.BRemoteModuleList; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import java.net.ConnectException; +import javax.baja.security.AuthenticationException; +import javax.baja.sys.BValue; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BRemoteDaemonPlatform +extends BDaemonPlatform { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$install$BRemoteDaemonPlatform; + + public Type getType() { + return TYPE; + } + + protected void init(DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException { + super.init(daemonSessionTaskListener); + this.setModuleList(new BRemoteModuleList(this.getDaemonSession())); + } + + public static BRemoteDaemonPlatform make(BDaemonSession bDaemonSession, DaemonSessionTaskListener daemonSessionTaskListener) throws AuthenticationException, ConnectException { + return BRemoteDaemonPlatform.make(bDaemonSession, daemonSessionTaskListener, true); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public static BRemoteDaemonPlatform make(BDaemonSession bDaemonSession, DaemonSessionTaskListener daemonSessionTaskListener, boolean bl) throws AuthenticationException, ConnectException { + if (bDaemonSession == null) { + return null; + } + BDaemonSession bDaemonSession2 = bDaemonSession; + synchronized (bDaemonSession2) { + BRemoteDaemonPlatform bRemoteDaemonPlatform; + block6: { + block5: { + if (!bl) break block5; + bRemoteDaemonPlatform = (BRemoteDaemonPlatform)bDaemonSession.getHostProperties().get("platform"); + if (bRemoteDaemonPlatform == null) { + bRemoteDaemonPlatform = new BRemoteDaemonPlatform(bDaemonSession); + bDaemonSession.getHostProperties().add("platform", (BValue)bRemoteDaemonPlatform); + } + break block6; + } + bRemoteDaemonPlatform = new BRemoteDaemonPlatform(bDaemonSession); + } + bRemoteDaemonPlatform.checkSession(daemonSessionTaskListener); + return bRemoteDaemonPlatform; + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BRemoteDaemonPlatform() { + } + + private BRemoteDaemonPlatform(BDaemonSession bDaemonSession) throws ConnectException, AuthenticationException { + super(bDaemonSession); + } + + static { + Class clazz = class$com$tridium$install$BRemoteDaemonPlatform; + if (clazz == null) { + clazz = class$com$tridium$install$BRemoteDaemonPlatform = BRemoteDaemonPlatform.class("[Lcom.tridium.install.BRemoteDaemonPlatform;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/install/BRemoteModuleList.java b/modules/cfr_output/com/tridium/install/BRemoteModuleList.java new file mode 100644 index 0000000..67f90db --- /dev/null +++ b/modules/cfr_output/com/tridium/install/BRemoteModuleList.java @@ -0,0 +1,221 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.net.HttpUtil + * javax.baja.file.FilePath + * javax.baja.log.Log + * javax.baja.naming.SlotPath + * javax.baja.sys.BValue + * javax.baja.sys.Clock + * javax.baja.sys.LocalizableRuntimeException + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + * javax.baja.xml.XParser + */ +package com.tridium.install; + +import com.tridium.install.BModuleList; +import com.tridium.install.GetModuleListMessage; +import com.tridium.install.installable.BModuleInstallable; +import com.tridium.net.HttpUtil; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.daemon.message.RequestGarbageCollectionMessage; +import com.tridium.platform.daemon.task.CancelableDaemonSessionTask; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import java.io.InputStream; +import java.net.ConnectException; +import javax.baja.file.FilePath; +import javax.baja.log.Log; +import javax.baja.naming.SlotPath; +import javax.baja.platform.ICancelHint; +import javax.baja.sys.BValue; +import javax.baja.sys.Clock; +import javax.baja.sys.LocalizableRuntimeException; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; +import javax.baja.xml.XParser; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BRemoteModuleList +extends BModuleList { + public static final Type TYPE; + private static Log log; + private BDaemonSession session; + private boolean initialized; + private XElem[] moduleElems; + private Object MODULE_ELEM_LOCK; + static /* synthetic */ Class class$com$tridium$install$BRemoteModuleList; + + public Type getType() { + return TYPE; + } + + public void doReload(DaemonSessionTaskListener daemonSessionTaskListener) { + this.init(daemonSessionTaskListener); + } + + public void reset() { + super.reset(); + this.moduleElems = null; + this.getModules().removeAll(); + this.initialized = false; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Unable to fully structure code + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public synchronized void doInit(DaemonSessionTaskListener var1_1) { + if (!this.isLocalInstance()) { + return; + } + if (this.initialized != false) return; + var2_2 = Clock.ticks(); + BRemoteModuleList.log.trace("building remote module list"); + this.getModules().removeAll(); + var4_3 = this.getNewModuleInfoTask(); + if (var1_1 != null) { + var1_1.taskStarted(var4_3); + } + try { + try { + var8_4 = this.MODULE_ELEM_LOCK; + synchronized (var8_4) { + if (this.moduleElems == null) { + this.moduleElems = this.fetchModules(null); + } + var7_5 = this.moduleElems; + // MONITOREXIT @DISABLED, blocks:[0, 1, 2, 4] lbl18 : MonitorExitStatement: MONITOREXIT : var8_4 + var10_8 = 0; + if (true) ** GOTO lbl34 + } + do { + if (!(var11_9 = this.uriToFilePath(var7_5[var10_8].get("path"))).getParent().getName().equals("lib")) { + var12_10 = new BModuleInstallable(var7_5[var10_8].getl("size", (long)-1), var11_9.getName(), var7_5[var10_8].elem("module")); + var13_11 = SlotPath.escape((String)var12_10.getInstallableName()); + BRemoteModuleList.log.trace("adding remote module " + var12_10.getInstallableName()); + if (this.getModules().getProperty(var13_11) != null) { + BRemoteModuleList.log.error(this.getLexicon().getText("ModuleList.exception.dupModule", new Object[]{var12_10.getInstallableName()})); + throw new LocalizableRuntimeException("platform", "ModuleList.exception.dupModule", new Object[]{var12_10.getInstallableName()}); + } + this.getModules().add(var13_11, (BValue)var12_10); + } + ++var10_8; +lbl34: + // 2 sources + + } while (var10_8 < var7_5.length && !var4_3.isCanceled()); + if (var4_3.isCanceled()) { + throw new ICancelHint.CanceledException(); + } + this.initialized = true; + } + catch (ICancelHint.CanceledException var7_6) { + throw var7_6; + } + catch (Exception var7_7) { + throw new LocalizableRuntimeException("platform", "RemoteModuleList.exception.xmlParse", (Throwable)var7_7); + } + var6_14 = null; + } + catch (Throwable var5_12) { + var6_13 = null; + Log.getLog((String)"platform.daemonTuning").trace("moduleList " + (Clock.ticks() - var2_2) + "ms"); + if (var1_1 == null) throw var5_12; + var1_1.taskFinished(var4_3); + throw var5_12; + } + Log.getLog((String)"platform.daemonTuning").trace("moduleList " + (Clock.ticks() - var2_2) + "ms"); + if (var1_1 == null) return; + var1_1.taskFinished(var4_3); + } + + protected XElem[] fetchModules(String string) throws Exception, ConnectException { + XElem[] xElemArray = XParser.make((InputStream)this.session.getInputStream(new GetModuleListMessage(false, true, true, string))).parse().elems("moduleItem"); + try { + if (this.session.getHostProperties().getOsName().toLowerCase().startsWith("win")) { + log.trace("sending remote garbage collection"); + this.session.sendMessage(RequestGarbageCollectionMessage.getInstance()); + } + } + catch (Exception exception) {} + return xElemArray; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void setModuleElems(XElem[] xElemArray) { + Object object = this.MODULE_ELEM_LOCK; + synchronized (object) { + this.moduleElems = xElemArray; + return; + } + } + + public CancelableDaemonSessionTask getNewModuleInfoTask() { + return new CancelableDaemonSessionTask(this.getLexicon(), "RemoteModuleList.dialog.loading.title", "RemoteModuleList.dialog.loading.message"); + } + + private final FilePath uriToFilePath(String string) { + if (string.startsWith("/files")) { + return new FilePath("/" + HttpUtil.decodeUrl((String)string.substring(7))); + } + if (string.startsWith("/niagara")) { + return new FilePath("!" + HttpUtil.decodeUrl((String)string.substring(9))); + } + return null; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.session = null; + this.initialized = false; + this.moduleElems = null; + this.MODULE_ELEM_LOCK = new Object(); + } + + public BRemoteModuleList() { + this.this(); + } + + public BRemoteModuleList(BDaemonSession bDaemonSession) { + this.this(); + this.session = bDaemonSession; + this.setLocalInstance(true); + this.reset(); + } + + static { + Class clazz = class$com$tridium$install$BRemoteModuleList; + if (clazz == null) { + clazz = class$com$tridium$install$BRemoteModuleList = BRemoteModuleList.class("[Lcom.tridium.install.BRemoteModuleList;", false); + } + TYPE = Sys.loadType((Class)clazz); + log = Log.getLog((String)"platform"); + } +} + diff --git a/modules/cfr_output/com/tridium/install/BUnitDatabaseMerge.java b/modules/cfr_output/com/tridium/install/BUnitDatabaseMerge.java new file mode 100644 index 0000000..fa64048 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/BUnitDatabaseMerge.java @@ -0,0 +1,257 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BIFile + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XContent + * javax.baja.xml.XElem + * javax.baja.xml.XParser + * javax.baja.xml.XWriter + */ +package com.tridium.install; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.Map; +import javax.baja.file.BIFile; +import javax.baja.platform.install.BFileReconciler; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XContent; +import javax.baja.xml.XElem; +import javax.baja.xml.XParser; +import javax.baja.xml.XWriter; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BUnitDatabaseMerge +extends BFileReconciler { + public static final BUnitDatabaseMerge INSTANCE = new BUnitDatabaseMerge(); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$install$BUnitDatabaseMerge; + + public Type getType() { + return TYPE; + } + + public BFileReconciler.ReconciliationResults reconcile(BIFile bIFile, BIFile bIFile2) throws Exception { + Object object; + String string; + boolean bl = false; + HashMap hashMap = new HashMap(); + HashMap hashMap2 = new HashMap(); + HashMap hashMap3 = new HashMap(); + XElem xElem = this.parseFile(bIFile2); + XElem[] xElemArray = xElem.elems("quantity"); + int n = 0; + while (n < xElemArray.length) { + XElem xElem2 = xElemArray[n]; + string = xElem2.get("n"); + hashMap2.put(string, xElem2); + object = xElem2.elems("unit"); + int n2 = 0; + while (n2 < ((XElem[])object).length) { + String string2 = object[n2].get("n"); + hashMap.put(string2, object[n2]); + hashMap3.put(string2, string); + ++n2; + } + ++n; + } + XElem xElem3 = this.parseFile(bIFile); + xElemArray = xElem3.elems("quantity"); + int n3 = 0; + while (n3 < xElemArray.length) { + string = xElemArray[n3]; + object = string.get("n"); + XElem[] xElemArray2 = string.elems("unit"); + int n4 = 0; + while (n4 < xElemArray2.length) { + String string3; + XElem xElem4 = xElemArray2[n4]; + String string4 = xElem4.get("n"); + XElem xElem5 = (XElem)hashMap.get(string4); + if (xElem5 == null) { + string3 = this.getOldQuantityElem((XElem)string, xElem, hashMap2); + xElem5 = xElem4.copy(); + string3.addContent((XContent)xElem5); + hashMap.put(string4, xElem5); + bl = true; + } else { + XElem xElem6; + string3 = (String)hashMap3.get(string4); + if (!((String)object).equals(string3)) { + xElem6 = (XElem)hashMap2.get(string3); + xElem6.removeContent((XContent)xElem5); + xElem6 = this.getOldQuantityElem((XElem)string, xElem, hashMap2); + xElem5 = xElem4.copy(); + xElem6.addContent((XContent)xElem5); + hashMap3.put(string4, object); + hashMap.put(string4, xElem5); + bl = true; + } else if (!this.equivalent(xElem4, xElem5)) { + xElem6 = this.getOldQuantityElem((XElem)string, xElem, hashMap2); + xElem6.removeContent((XContent)xElem5); + xElem5 = xElem4.copy(); + xElem6.addContent((XContent)xElem5); + hashMap.put(string4, xElem5); + bl = true; + } + } + ++n4; + } + ++n3; + } + if (bl) { + return new XmlReconciliationResults(xElem); + } + return NO_RECONCILIATION; + } + + protected XElem getOldQuantityElem(XElem xElem, XElem xElem2, Map map) { + String string = xElem.get("n"); + XElem xElem3 = (XElem)map.get(string); + if (xElem3 == null) { + xElem3 = this.shallowCopy(xElem); + xElem2.addContent((XContent)xElem3); + map.put(string, xElem3); + } + return xElem3; + } + + protected boolean equivalent(XElem xElem, XElem xElem2) { + if (xElem == xElem2) { + return true; + } + if (xElem == null) { + boolean bl = false; + if (xElem2 == null) { + bl = true; + } + return bl; + } + if (xElem2 == null) { + return false; + } + if (this.equals(xElem.ns(), xElem2.ns()) && this.equals(xElem.name(), xElem2.name()) && xElem.attrSize() == xElem2.attrSize()) { + int n = 0; + while (n < xElem.attrSize()) { + int n2 = xElem2.attrIndex(xElem.attrNs(n), xElem.attrName(n)); + if (n2 < 0) { + return false; + } + if (!this.equals(xElem.attrValue(n), xElem2.attrValue(n2))) { + return false; + } + ++n; + } + return true; + } + return false; + } + + protected boolean equals(Object object, Object object2) { + if (object == object2) { + return true; + } + if (object == null) { + boolean bl = false; + if (object2 == null) { + bl = true; + } + return bl; + } + return object.equals(object2); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + protected XElem parseFile(BIFile bIFile) throws Exception { + XElem xElem; + InputStream inputStream = bIFile.getInputStream(); + try { + xElem = XParser.make((InputStream)inputStream).parse(); + Object var4_4 = null; + } + catch (Throwable throwable) { + Object var4_5 = null; + try { + inputStream.close(); + } + catch (Exception exception) {} + throw throwable; + } + try { + inputStream.close(); + } + catch (Exception exception) {} + return xElem; + } + + protected XElem shallowCopy(XElem xElem) { + XElem xElem2 = new XElem(xElem.ns(), xElem.name()); + int n = 0; + while (n < xElem.attrSize()) { + xElem2.addAttr(xElem.attrNs(n), xElem.attrName(n), xElem.attrValue(n)); + ++n; + } + return xElem2; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + protected BUnitDatabaseMerge() { + } + + static { + Class clazz = class$com$tridium$install$BUnitDatabaseMerge; + if (clazz == null) { + clazz = class$com$tridium$install$BUnitDatabaseMerge = BUnitDatabaseMerge.class("[Lcom.tridium.install.BUnitDatabaseMerge;", false); + } + TYPE = Sys.loadType((Class)clazz); + } + + public static class XmlReconciliationResults + implements BFileReconciler.ReconciliationResults { + public byte[] contents; + + public InputStream getInputStream() { + return new ByteArrayInputStream(this.contents); + } + + public long getSize() { + return this.contents.length; + } + + public boolean shouldReplaceContents() { + return true; + } + + public XmlReconciliationResults(XElem xElem) throws Exception { + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + XWriter xWriter = new XWriter((OutputStream)byteArrayOutputStream); + xElem.write(xWriter); + xWriter.flush(); + this.contents = byteArrayOutputStream.toByteArray(); + } + } +} + diff --git a/modules/cfr_output/com/tridium/install/BVersion.java b/modules/cfr_output/com/tridium/install/BVersion.java new file mode 100644 index 0000000..f2c76c1 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/BVersion.java @@ -0,0 +1,393 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.data.BIDataValue + * javax.baja.nre.util.TextUtil + * javax.baja.sys.BIComparable + * javax.baja.sys.BObject + * javax.baja.sys.BStruct + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.LexiconText + * javax.baja.util.Version + */ +package com.tridium.install; + +import com.tridium.install.BDependency; +import com.tridium.install.part.BPart; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import javax.baja.data.BIDataValue; +import javax.baja.nre.util.TextUtil; +import javax.baja.platform.install.BVersionRelation; +import javax.baja.sys.BIComparable; +import javax.baja.sys.BObject; +import javax.baja.sys.BStruct; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.LexiconText; +import javax.baja.util.Version; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BVersion +extends BStruct +implements BIComparable, +BIDataValue { + public static final Property bajaVersionString = BVersion.newProperty((int)1, (String)"", null); + public static final Property vendor = BVersion.newProperty((int)1, (String)"", null); + public static final Property vendorVersionString = BVersion.newProperty((int)1, (String)"", null); + public static final Type TYPE; + public static final LexiconText nameVersionText; + public static final BVersion ZERO; + public static final int LATER_VERSION = 1; + public static final int SAME_VERSION = 2; + public static final int EARLIER_VERSION = 4; + public static final int DIFFERENT_VERSION = 8; + public static final int EQUIVALENT_VERSION = 16; + public static final int MORE_SPECIFIC_VERSION = 32; + public static final int LESS_SPECIFIC_VERSION = 64; + public static final int MEETS_MINIMUM = 115; + public static final int MEETS_MAXIMUM = 118; + private Version vendorVersionObject; + private boolean setting; + private String settingMonitor; + static /* synthetic */ Class class$com$tridium$install$BVersion; + + public String getBajaVersionString() { + return this.getString(bajaVersionString); + } + + public void setBajaVersionString(String string) { + this.setString(bajaVersionString, string, null); + } + + public String getVendor() { + return this.getString(vendor); + } + + public void setVendor(String string) { + this.setString(vendor, string, null); + } + + public String getVendorVersionString() { + return this.getString(vendorVersionString); + } + + public void setVendorVersionString(String string) { + this.setString(vendorVersionString, string, null); + } + + public Type getType() { + return TYPE; + } + + public int compareTo(Object object) { + BVersion bVersion = (BVersion)((Object)object); + if (bVersion == null) { + return 1; + } + int n = TextUtil.toLowerCase((String)this.getVendor()).compareTo(TextUtil.toLowerCase((String)bVersion.getVendor())); + if (n == 0) { + if (bVersion.getVendorVersion() == null) { + int n2 = 0; + if (this.getVendorVersion() == null) { + n2 = 1; + } + return 1 - n2; + } + if (this.getVendorVersion() == null) { + return -1; + } + n = this.getVendorVersion().compareTo((Object)bVersion.getVendorVersion()); + } + return n; + } + + public static boolean meets(Version version, BDependency bDependency) { + return BVersion.meetsVersionRequirement(version, bDependency.getVersion().getVendorVersion(), bDependency.getVersionRelation()); + } + + public static boolean meetsVersionRequirement(Version version, Version version2, BVersionRelation bVersionRelation) { + int n = BVersion.checkVersionRequirement(version, version2); + if (bVersionRelation == BVersionRelation.minimum) { + boolean bl = false; + if ((n & 0x73) > 0) { + bl = true; + } + return bl; + } + if (bVersionRelation == BVersionRelation.maximum) { + boolean bl = false; + if ((n & 0x76) > 0) { + bl = true; + } + return bl; + } + boolean bl = false; + if ((n & 2) > 0) { + bl = true; + } + return bl; + } + + public boolean meets(BDependency bDependency) { + return this.meetsVersionRequirement(bDependency.getVersion(), bDependency.getVersionRelation()); + } + + public boolean meetsVersionRequirement(BVersion bVersion, BVersionRelation bVersionRelation) { + int n = this.checkVersionRequirement(bVersion); + if (bVersionRelation == BVersionRelation.minimum) { + boolean bl = false; + if ((n & 0x73) > 0) { + bl = true; + } + return bl; + } + if (bVersionRelation == BVersionRelation.maximum) { + boolean bl = false; + if ((n & 0x76) > 0) { + bl = true; + } + return bl; + } + boolean bl = false; + if ((n & 2) > 0) { + bl = true; + } + return bl; + } + + /* + * Enabled force condition propagation + * Lifted jumps to return sites + */ + public int checkVersionRequirement(BVersion bVersion) { + int n; + if (!bVersion.getVendor().equalsIgnoreCase(this.getVendor()) && bVersion.getVendor().trim().length() != 0 && this.getVendor().trim().length() != 0) return 8; + if (bVersion.getVendorVersion() == null) { + if (this.getVendorVersion() != null) return 32; + n = 0; + } else { + if (this.getVendorVersion() == null) { + return 64; + } + n = this.getVendorVersion().compareTo((Object)bVersion.getVendorVersion()); + } + if (n == 0) { + if (!bVersion.getVendor().equalsIgnoreCase(this.getVendor())) return 16; + return 2; + } + if (n >= 0) return 1; + return 4; + } + + public static int checkVersionRequirement(Version version, Version version2) { + int n = version2 == null ? 0 : (version == null ? -1 : version.compareTo((Object)version2)); + if (n == 0) { + return 2; + } + if (n < 0) { + return 4; + } + return 1; + } + + public synchronized boolean equivalent(Object object) { + if (object instanceof BVersion) { + BVersion bVersion = (BVersion)((Object)object); + if (this.getVendorVersion() == null) { + if (bVersion.getVendorVersion() != null) { + return false; + } + } else { + if (bVersion.getVendorVersion() == null) { + return false; + } + if (!this.getVendorVersion().equals((Object)bVersion.getVendorVersion())) { + return false; + } + } + return bVersion.getVendor().equalsIgnoreCase(this.getVendor()); + } + return false; + } + + public String toString(Context context) { + StringBuffer stringBuffer = new StringBuffer(); + if (this.getVendor().length() > 0) { + stringBuffer.append(this.getVendor()).append(" "); + } + if (this.getVendorVersion() != null) { + stringBuffer.append(this.getVendorVersion()); + } + return stringBuffer.toString().trim(); + } + + public Version getBajaVersion() { + if (this.getVersionString(this.getBajaVersionString()).trim().length() > 0) { + return new Version(this.getVersionString(this.getBajaVersionString())); + } + return null; + } + + public Version getVendorVersion() { + if (this.vendorVersionObject == null && this.getVersionString(this.getVendorVersionString()).trim().length() > 0) { + this.vendorVersionObject = new Version(this.getVersionString(this.getVendorVersionString())); + } + return this.vendorVersionObject; + } + + public void setVendorVersion(Version version) { + if (this.setting) { + return; + } + this.vendorVersionObject = version; + if (version == null) { + this.setVendorVersionString(""); + } else { + this.setVendorVersionString(version.toString()); + } + } + + private final String getVersionString(String string) { + if (string == null) { + return ""; + } + int n = 0; + while (n < string.length()) { + if (string.charAt(n) != '.' && !Character.isDigit(string.charAt(n))) { + return string.substring(0, n); + } + ++n; + } + return string; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void changed(Property property, Context context) { + String string = this.settingMonitor; + synchronized (string) { + this.setting = true; + if (property == vendorVersionString) { + String string2 = this.propertyValueToString(property, context); + this.vendorVersionObject = string2.trim().length() == 0 ? null : new Version(this.getVersionString(string2)); + } + this.setting = false; + return; + } + } + + public static String formatNameVersion(BPart bPart, Context context) { + return BVersion.formatNameVersion(bPart.getPartName(), bPart.getVersion(), context); + } + + public static String formatNameVersion(String string, BVersion bVersion, Context context) { + String string2 = bVersion.toString(context); + if (string2.trim().length() == 0 || string2.equals("0")) { + return string; + } + return nameVersionText.getText(context, new Object[]{string, string2}); + } + + public static BVersion makeZero() { + return new BVersion(); + } + + public void encode(DataOutput dataOutput) throws IOException { + dataOutput.writeUTF(this.getBajaVersionString()); + dataOutput.writeUTF(this.getVendor()); + dataOutput.writeUTF(this.getVendorVersionString()); + } + + public BObject decode(DataInput dataInput) throws IOException { + BVersion bVersion = new BVersion(); + bVersion.setBajaVersionString(dataInput.readUTF()); + bVersion.setVendor(dataInput.readUTF()); + bVersion.setVendorVersionString(dataInput.readUTF()); + return bVersion; + } + + public String encodeToString() throws IOException { + StringBuffer stringBuffer = new StringBuffer(128); + stringBuffer.append(this.getBajaVersionString()); + stringBuffer.append(';'); + stringBuffer.append(this.getVendor()); + stringBuffer.append(';'); + stringBuffer.append(this.getVendorVersionString()); + return stringBuffer.toString(); + } + + public BObject decodeFromString(String string) throws IOException { + BVersion bVersion = new BVersion(); + String[] stringArray = TextUtil.split((String)string, (char)';'); + bVersion.setBajaVersionString(stringArray[0]); + bVersion.setVendor(stringArray[1]); + bVersion.setVendorVersionString(stringArray[2]); + return bVersion; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.vendorVersionObject = null; + this.setting = false; + this.settingMonitor = new String("Setting"); + } + + public BVersion() { + this.this(); + } + + public BVersion(String string) { + this(null, string); + } + + public BVersion(String string, String string2) { + this.this(); + if (string != null && string.trim().length() > 0) { + this.setVendor(string); + } else { + this.setVendor(""); + } + if (string2 != null && string2.trim().length() > 0) { + this.setVendorVersionString(string2); + } else { + this.setVendorVersionString(""); + } + } + + static { + Class clazz = class$com$tridium$install$BVersion; + if (clazz == null) { + clazz = class$com$tridium$install$BVersion = BVersion.class("[Lcom.tridium.install.BVersion;", false); + } + TYPE = Sys.loadType((Class)clazz); + nameVersionText = LexiconText.make((String)"platform", (String)"Version.nameVersion"); + ZERO = new BVersion(); + } +} + diff --git a/modules/cfr_output/com/tridium/install/ClassCondenser.java b/modules/cfr_output/com/tridium/install/ClassCondenser.java new file mode 100644 index 0000000..62cb9eb --- /dev/null +++ b/modules/cfr_output/com/tridium/install/ClassCondenser.java @@ -0,0 +1,252 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.install; + +import com.tridium.install.Attrib; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +public class ClassCondenser { + private static final int MAGIC = -889275714; + private static final int CONSTANT_Utf8 = 1; + private static final int CONSTANT_Integer = 3; + private static final int CONSTANT_Float = 4; + private static final int CONSTANT_Long = 5; + private static final int CONSTANT_Double = 6; + private static final int CONSTANT_Class = 7; + private static final int CONSTANT_String = 8; + private static final int CONSTANT_Fieldref = 9; + private static final int CONSTANT_Methodref = 10; + private static final int CONSTANT_InterfaceMethodref = 11; + private static final int CONSTANT_NameAndType = 12; + private static final String CODE_ATTRIB = "Code"; + private static final String LINE_NUMBER_TABLE_ATTRIB = "LineNumberTable"; + private static final int EXCEPTION_TABLE_ENTRY_SIZE = 8; + private static final int ATTRIB_HEADER_SIZE = 6; + private String[] cpUtf; + + public void condense(InputStream inputStream, OutputStream outputStream) throws IOException { + this.condense(inputStream, outputStream, true); + } + + public void condense(InputStream inputStream, OutputStream outputStream, boolean bl) throws IOException { + int n; + DataInputStream dataInputStream = new DataInputStream(new BufferedInputStream(inputStream)); + DataOutputStream dataOutputStream = new DataOutputStream(new BufferedOutputStream(outputStream)); + if (this.echoInt(dataInputStream, dataOutputStream) != -889275714) { + throw new IOException("Invalid magic"); + } + this.echoUnsignedShort(dataInputStream, dataOutputStream); + this.echoUnsignedShort(dataInputStream, dataOutputStream); + this.cpUtf = new String[this.echoUnsignedShort(dataInputStream, dataOutputStream)]; + int n2 = 1; + while (n2 < this.cpUtf.length) { + n = this.echoCpInfo(dataInputStream, dataOutputStream, n2); + if (n != 0) { + ++n2; + } + ++n2; + } + this.echoUnsignedShort(dataInputStream, dataOutputStream); + this.echoUnsignedShort(dataInputStream, dataOutputStream); + this.echoUnsignedShort(dataInputStream, dataOutputStream); + this.echoFully(dataInputStream, dataOutputStream, this.echoUnsignedShort(dataInputStream, dataOutputStream) * 2); + n2 = this.echoUnsignedShort(dataInputStream, dataOutputStream); + n = 0; + while (n < n2) { + this.echoField(dataInputStream, dataOutputStream); + ++n; + } + n2 = this.echoUnsignedShort(dataInputStream, dataOutputStream); + n = 0; + while (n < n2) { + this.echoMethod(dataInputStream, dataOutputStream); + ++n; + } + n2 = this.echoUnsignedShort(dataInputStream, dataOutputStream); + n = 0; + while (n < n2) { + this.echoAttrib(dataInputStream, dataOutputStream); + ++n; + } + dataOutputStream.flush(); + if (bl) { + dataOutputStream.close(); + outputStream.close(); + dataInputStream.close(); + inputStream.close(); + } + } + + private final int echoUnsignedByte(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException { + int n = dataInputStream.readUnsignedByte(); + dataOutputStream.writeByte(n); + return n; + } + + private final int echoUnsignedShort(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException { + int n = dataInputStream.readUnsignedShort(); + dataOutputStream.writeShort(n); + return n; + } + + private final int echoInt(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException { + int n = dataInputStream.readInt(); + dataOutputStream.writeInt(n); + return n; + } + + private final byte[] echoFully(DataInputStream dataInputStream, DataOutputStream dataOutputStream, int n) throws IOException { + byte[] byArray = new byte[n]; + dataInputStream.readFully(byArray, 0, n); + dataOutputStream.write(byArray, 0, n); + return byArray; + } + + private final String echoUTF(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException { + String string = DataInputStream.readUTF(dataInputStream); + dataOutputStream.writeUTF(string); + return string; + } + + private final void echoMethod(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException { + this.echoUnsignedShort(dataInputStream, dataOutputStream); + this.echoUnsignedShort(dataInputStream, dataOutputStream); + this.echoUnsignedShort(dataInputStream, dataOutputStream); + int n = this.echoUnsignedShort(dataInputStream, dataOutputStream); + int n2 = 0; + while (n2 < n) { + this.echoAttrib(dataInputStream, dataOutputStream); + ++n2; + } + } + + private final void echoField(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException { + this.echoUnsignedShort(dataInputStream, dataOutputStream); + this.echoUnsignedShort(dataInputStream, dataOutputStream); + this.echoUnsignedShort(dataInputStream, dataOutputStream); + int n = this.echoUnsignedShort(dataInputStream, dataOutputStream); + int n2 = 0; + while (n2 < n) { + this.echoAttrib(dataInputStream, dataOutputStream); + ++n2; + } + } + + private final void echoAttrib(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException { + int n = dataInputStream.readUnsignedShort(); + int n2 = dataInputStream.readInt(); + String string = this.cpUtf[n]; + if (string == null) { + throw new IOException("Could not look up attribute."); + } + if (string.equals(CODE_ATTRIB)) { + this.echoCodeAttrib(dataInputStream, dataOutputStream, n, n2); + } else { + dataOutputStream.writeShort(n); + dataOutputStream.writeInt(n2); + this.echoFully(dataInputStream, dataOutputStream, n2); + } + } + + private final void echoCodeAttrib(DataInputStream dataInputStream, DataOutputStream dataOutputStream, int n, int n2) throws IOException { + int n3 = dataInputStream.readUnsignedShort(); + int n4 = dataInputStream.readUnsignedShort(); + int n5 = dataInputStream.readInt(); + byte[] byArray = new byte[n5]; + dataInputStream.readFully(byArray, 0, n5); + int n6 = dataInputStream.readUnsignedShort(); + int n7 = n6 * 8; + byte[] byArray2 = new byte[n7]; + dataInputStream.readFully(byArray2, 0, n7); + Attrib[] attribArray = new Attrib[dataInputStream.readUnsignedShort()]; + int n8 = 0; + int n9 = 0; + while (n9 < attribArray.length) { + attribArray[n9] = new Attrib(dataInputStream, this.cpUtf); + if (attribArray[n9].name.equals(LINE_NUMBER_TABLE_ATTRIB)) { + n2 -= attribArray[n9].len + 6; + attribArray[n9] = null; + } else { + ++n8; + } + ++n9; + } + dataOutputStream.writeShort(n); + dataOutputStream.writeInt(n2); + dataOutputStream.writeShort(n3); + dataOutputStream.writeShort(n4); + dataOutputStream.writeInt(n5); + dataOutputStream.write(byArray, 0, n5); + dataOutputStream.writeShort(n6); + dataOutputStream.write(byArray2, 0, n7); + dataOutputStream.writeShort(n8); + n9 = 0; + while (n9 < attribArray.length) { + if (attribArray[n9] != null) { + dataOutputStream.writeShort(attribArray[n9].nameIndex); + dataOutputStream.writeInt(attribArray[n9].len); + dataOutputStream.write(attribArray[n9].info, 0, attribArray[n9].len); + } + ++n9; + } + } + + private final boolean echoCpInfo(DataInputStream dataInputStream, DataOutputStream dataOutputStream, int n) throws IOException { + int n2 = this.echoUnsignedByte(dataInputStream, dataOutputStream); + switch (n2) { + case 1: { + this.cpUtf[n] = this.echoUTF(dataInputStream, dataOutputStream); + return false; + } + case 3: { + this.echoFully(dataInputStream, dataOutputStream, 4); + return false; + } + case 4: { + this.echoFully(dataInputStream, dataOutputStream, 4); + return false; + } + case 5: { + this.echoFully(dataInputStream, dataOutputStream, 8); + return true; + } + case 6: { + this.echoFully(dataInputStream, dataOutputStream, 8); + return true; + } + case 7: { + this.echoFully(dataInputStream, dataOutputStream, 2); + return false; + } + case 8: { + this.echoFully(dataInputStream, dataOutputStream, 2); + return false; + } + case 9: { + this.echoFully(dataInputStream, dataOutputStream, 4); + return false; + } + case 10: { + this.echoFully(dataInputStream, dataOutputStream, 4); + return false; + } + case 11: { + this.echoFully(dataInputStream, dataOutputStream, 4); + return false; + } + case 12: { + this.echoFully(dataInputStream, dataOutputStream, 4); + return false; + } + } + throw new IOException("Invalid cp tag 0x" + Integer.toHexString(n2)); + } +} + diff --git a/modules/cfr_output/com/tridium/install/DaemonPlatformUtil.java b/modules/cfr_output/com/tridium/install/DaemonPlatformUtil.java new file mode 100644 index 0000000..d505a7c --- /dev/null +++ b/modules/cfr_output/com/tridium/install/DaemonPlatformUtil.java @@ -0,0 +1,162 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nre.util.Array + * javax.baja.util.Lexicon + */ +package com.tridium.install; + +import com.tridium.install.BDaemonPlatform; +import com.tridium.install.BDependency; +import com.tridium.install.BVersion; +import com.tridium.install.part.BNrePart; +import com.tridium.install.part.BOsPart; +import com.tridium.install.part.BPart; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.daemon.BStationSurrogate; +import com.tridium.platform.daemon.task.CancelableDaemonSessionTask; +import com.tridium.platform.daemon.task.DaemonSessionTask; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import java.net.SocketException; +import javax.baja.nre.util.Array; +import javax.baja.platform.ICancelHint; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class DaemonPlatformUtil { + private static final BDependency fixedNre = new BDependency("nre-core-qnx-ppc", new BVersion(null, "3.0.103"), BNrePart.TYPE.getTypeSpec()); + static /* synthetic */ Class class$com$tridium$platform$daemon$BStationSurrogate; + + /* + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public static void doExtraStationShutdownTasks(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener, ICancelHint iCancelHint) throws Exception { + Object var11_19; + Object object2; + BOsPart bOsPart = bDaemonPlatform.getOsPart(); + if (!bOsPart.getPartName().startsWith("qnx")) return; + BNrePart bNrePart = bDaemonPlatform.getNrePart(); + if (!bNrePart.isNull()) { + if (((BPart)bNrePart).meets(fixedNre)) return; + } + if (daemonSessionTaskListener == null) { + daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER; + } + BDaemonSession bDaemonSession = bDaemonPlatform.getDaemonSession(); + String string = bDaemonSession.getHostProperties().getSessionTimestamp(); + Lexicon lexicon = Lexicon.make((String)"platform"); + Class clazz = class$com$tridium$platform$daemon$BStationSurrogate; + if (clazz == null) { + clazz = class$com$tridium$platform$daemon$BStationSurrogate = DaemonPlatformUtil.class("[Lcom.tridium.platform.daemon.BStationSurrogate;", false); + } + Array array = new Array(clazz); + DaemonSessionTask daemonSessionTask = new DaemonSessionTask(lexicon, "DaemonPlatformUtil.settingAutoStart.title", "DaemonPlatformUtil.settingAutoStart.message"); + daemonSessionTaskListener.taskStarted(daemonSessionTask); + try { + object2 = BStationSurrogate.makeAll(bDaemonSession); + int n = 0; + while (n < ((BStationSurrogate[])object2).length) { + DaemonPlatformUtil.checkCanceled(iCancelHint); + if (object2[n].getIsAutoStart()) { + object2[n].updateSettings(false, object2[n].getIsAutoRestart()); + array.add((Object)object2[n]); + } + ++n; + } + var11_19 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + } + catch (Throwable throwable) { + Object var11_18 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + throw throwable; + } + { + Object var17_23; + daemonSessionTask = new DaemonSessionTask(lexicon, "DaemonPlatformUtil.sendingReboot.title", "DaemonPlatformUtil.sendingReboot.message"); + daemonSessionTaskListener.taskStarted(daemonSessionTask); + try { + if (!bDaemonSession.sendRebootRequest(false)) { + DaemonPlatformUtil.checkCanceled(iCancelHint); + bDaemonSession.sendForceRebootRequest(); + } + var17_23 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + daemonSessionTask = new CancelableDaemonSessionTask(lexicon, "DaemonPlatformUtil.reconnecting.title", "DaemonPlatformUtil.reconnecting.message", iCancelHint); + daemonSessionTaskListener.taskStarted(daemonSessionTask); + } + catch (Throwable throwable) { + Object var17_22 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + throw throwable; + } + try { + bDaemonSession.getHostProperties().reset(); + while (true) { + DaemonPlatformUtil.checkCanceled(iCancelHint); + try { + bDaemonSession.reloadHostProperties(15000); + if (bDaemonSession.getHostProperties().getSessionTimestamp().equals(string)) continue; + daemonSessionTask.setMessage(lexicon.getText("DaemonPlatformUtil.reconnecting.successMessage")); + daemonSessionTaskListener.taskUpdated(daemonSessionTask); + } + catch (SocketException socketException) { + continue; + } + break; + } + var17_23 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + } + catch (Throwable throwable) { + var17_23 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + throw throwable; + } + var11_19 = null; + daemonSessionTask = new DaemonSessionTask(lexicon, "DaemonPlatformUtil.restoringAutoStart.title", "DaemonPlatformUtil.restoringAutoStart.message"); + daemonSessionTaskListener.taskStarted(daemonSessionTask); + } + try { + int n = 0; + while (n < array.size()) { + BStationSurrogate bStationSurrogate = (BStationSurrogate)((Object)array.get(n)); + bStationSurrogate.updateSettings(true, bStationSurrogate.getIsAutoRestart()); + ++n; + } + Object var13_15 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + return; + } + catch (Throwable object2) { + Object var13_14 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + throw object2; + } + } + + private static final void checkCanceled(ICancelHint iCancelHint) { + if (iCancelHint != null && iCancelHint.isCanceled()) { + throw new ICancelHint.CanceledException(); + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } +} + diff --git a/modules/cfr_output/com/tridium/install/DependencyMap.java b/modules/cfr_output/com/tridium/install/DependencyMap.java new file mode 100644 index 0000000..201a0a8 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/DependencyMap.java @@ -0,0 +1,141 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.install; + +import com.tridium.install.BDependency; +import com.tridium.install.PartSpec; +import com.tridium.install.part.BPart; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +public class DependencyMap { + private Map map = new HashMap(); + + public int size() { + return this.map.size(); + } + + public void clear() { + this.map.clear(); + } + + public void merge(DependencyMap dependencyMap) { + if (dependencyMap == null) { + return; + } + Iterator iterator = dependencyMap.map.values().iterator(); + while (iterator.hasNext()) { + Map map = (Map)iterator.next(); + Iterator iterator2 = map.keySet().iterator(); + while (iterator2.hasNext()) { + PartSpec partSpec = (PartSpec)iterator2.next(); + this.addDependency(partSpec, (BDependency)((Object)map.get(partSpec))); + } + } + } + + public boolean removeDependency(PartSpec partSpec, BDependency bDependency) { + Map map = (Map)this.map.get(bDependency.getPartSpec()); + if (map != null) { + Object v = map.remove(partSpec); + if (map.size() == 0) { + this.map.remove(bDependency.getPartSpec()); + } + boolean bl = false; + if (v != null) { + bl = true; + } + return bl; + } + return false; + } + + public BDependency getStrictestDependencyOn(BPart bPart) { + return this.getStrictestDependencyOn(bPart.getPartSpec()); + } + + public BDependency getStrictestDependencyOn(PartSpec partSpec) { + BDependency bDependency = null; + Map map = this.getDependenciesOn(partSpec); + Iterator iterator = map.values().iterator(); + while (iterator.hasNext()) { + BDependency bDependency2 = (BDependency)((Object)iterator.next()); + if (bDependency != null && !bDependency2.supersedes(bDependency)) continue; + bDependency = bDependency2; + } + return bDependency; + } + + public Set getPartSpecs() { + return this.map.keySet(); + } + + public Map getDependenciesOn(BPart bPart) { + return this.getDependenciesOn(bPart.getPartSpec()); + } + + public Map getDependenciesOn(PartSpec partSpec) { + return (Map)this.map.get(partSpec); + } + + public boolean addDependencies(Map map) { + if (map == null) { + return false; + } + boolean bl = false; + Iterator iterator = map.keySet().iterator(); + while (iterator.hasNext()) { + PartSpec partSpec = (PartSpec)iterator.next(); + boolean bl2 = false; + if (!this.addDependency(partSpec, (BDependency)((Object)map.get(partSpec))) && !bl) continue; + bl2 = bl = true; + } + return bl; + } + + public boolean addDependency(PartSpec partSpec, BDependency bDependency) { + HashMap hashMap = (HashMap)this.map.get(bDependency.getPartSpec()); + if (hashMap == null) { + hashMap = new HashMap(); + hashMap.put(partSpec, bDependency); + this.map.put(bDependency.getPartSpec(), hashMap); + return true; + } + BDependency bDependency2 = (BDependency)((Object)hashMap.get(partSpec)); + if (bDependency2 == null) { + boolean bl = false; + if (hashMap.put(partSpec, bDependency) == null) { + bl = true; + } + return bl; + } + if (bDependency.supersedes(bDependency2)) { + boolean bl = false; + if (hashMap.put(partSpec, bDependency) == null) { + bl = true; + } + return bl; + } + return false; + } + + public void dump() { + System.out.println("dumping " + this); + Iterator iterator = this.map.keySet().iterator(); + while (iterator.hasNext()) { + String string = (String)iterator.next(); + Map map = (Map)this.map.get(string); + System.out.println(" dependencies on " + string); + Iterator iterator2 = map.keySet().iterator(); + while (iterator2.hasNext()) { + PartSpec partSpec = (PartSpec)iterator2.next(); + BDependency bDependency = (BDependency)((Object)map.get(partSpec)); + System.out.println(" " + partSpec.getPartName() + " requires " + (Object)((Object)bDependency)); + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/install/DependencyUtil.java b/modules/cfr_output/com/tridium/install/DependencyUtil.java new file mode 100644 index 0000000..d9f95fc --- /dev/null +++ b/modules/cfr_output/com/tridium/install/DependencyUtil.java @@ -0,0 +1,445 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BDirectory + * javax.baja.file.BFileSpace + * javax.baja.file.BIFile + * javax.baja.file.FilePath + * javax.baja.security.AuthenticationException + * javax.baja.sys.LocalizableRuntimeException + * javax.baja.xml.XElem + * javax.baja.xml.XParser + */ +package com.tridium.install; + +import com.tridium.install.BDaemonPlatform; +import com.tridium.install.BDependency; +import com.tridium.install.InstallScenario; +import com.tridium.install.SolutionParameters; +import com.tridium.install.installable.BDistribution; +import com.tridium.install.installable.BModuleInstallable; +import com.tridium.install.installable.InstallableRegistry; +import com.tridium.install.installable.LocalInstallableRegistry; +import com.tridium.install.part.BModulePart; +import com.tridium.platform.daemon.BModuleContent; +import com.tridium.platform.daemon.file.BDaemonDirectoryStore; +import com.tridium.platform.daemon.file.BDaemonFileSpace; +import com.tridium.platform.daemon.file.BDaemonFileStore; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import java.io.IOException; +import java.io.InputStream; +import java.net.ConnectException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; +import javax.baja.file.BDirectory; +import javax.baja.file.BFileSpace; +import javax.baja.file.BIFile; +import javax.baja.file.FilePath; +import javax.baja.security.AuthenticationException; +import javax.baja.sys.LocalizableRuntimeException; +import javax.baja.xml.XElem; +import javax.baja.xml.XParser; + +public class DependencyUtil { + private static final TreeSet ALL_WEB_UI_MODULES = new TreeSet(); + private static int ANALYSIS_REQ_STATION; + private static int ANALYSIS_REQ_PLATFORM; + private static int ANALYSIS_DEP_MISSING; + private static int ANALYSIS_DEP_UNAVAILABLE; + private static int ANALYSIS_DEP_UNSOLVABLE; + + public static BDependency[] getPlatformDependencies(BDaemonPlatform bDaemonPlatform) throws ConnectException, AuthenticationException { + return DependencyUtil.getPlatformDependencies(bDaemonPlatform, bDaemonPlatform.getModuleContent()); + } + + public static BDependency[] getPlatformDependencies(BDaemonPlatform bDaemonPlatform, BModuleContent bModuleContent) throws ConnectException, AuthenticationException { + return DependencyUtil.getModuleDeps(DependencyUtil.accumPlatformDeps(DependencyUtil.getWebUiModules(bDaemonPlatform, bModuleContent), bDaemonPlatform)); + } + + public static BDependency[] getStationDependencies(BDaemonPlatform bDaemonPlatform, FilePath filePath) throws ConnectException, AuthenticationException { + return DependencyUtil.getStationDependencies(bDaemonPlatform, filePath, bDaemonPlatform.getModuleContent()); + } + + public static BDependency[] getStationDependencies(BDaemonPlatform bDaemonPlatform, FilePath filePath, BModuleContent bModuleContent) throws ConnectException, AuthenticationException { + try { + BDaemonFileStore bDaemonFileStore = new BDaemonFileStore(bDaemonPlatform.getDaemonSession().getFileSpace(), filePath.merge("config.bog")); + InputStream inputStream = bDaemonFileStore.getInputStream(); + Set set = DependencyUtil.accumBogModuleDeps(DependencyUtil.getWebUiModules(bDaemonPlatform, bModuleContent), inputStream, "platform", "DependencyUtil.parseConfigBog"); + DependencyUtil.accumPlatformDeps(set, bDaemonPlatform); + return DependencyUtil.getModuleDeps(set); + } + catch (IOException iOException) { + throw new LocalizableRuntimeException("platform", "DependencyUtil.parseConfigBog", (Throwable)iOException); + } + } + + public static BDependency[] getStationDependencies(BDaemonPlatform bDaemonPlatform, BDirectory bDirectory) throws ConnectException, AuthenticationException { + try { + Object object; + InputStream inputStream; + if (bDirectory == null) { + inputStream = null; + } else if (bDirectory.getStore() instanceof BDaemonDirectoryStore) { + object = new BDaemonFileStore(bDaemonPlatform.getDaemonSession().getFileSpace(), bDirectory.getFilePath().merge("config.bog")); + inputStream = ((BDaemonFileStore)((Object)object)).getInputStream(); + } else { + object = (BIFile)bDirectory.getNavChild("config.bog"); + inputStream = object == null ? null : object.getInputStream(); + } + object = DependencyUtil.accumBogModuleDeps(null, inputStream, "platform", "DependencyUtil.parseConfigBog"); + DependencyUtil.accumPlatformDeps((Set)object, bDaemonPlatform); + return DependencyUtil.getModuleDeps((Set)object); + } + catch (IOException iOException) { + throw new LocalizableRuntimeException("platform", "DependencyUtil.parseConfigBog", (Throwable)iOException); + } + } + + public static BDependency[] getPlatformModuleDependencies(BDaemonPlatform bDaemonPlatform, BDistribution bDistribution) throws ConnectException { + XElem xElem = bDistribution.getUpdatedPlatformBog(bDaemonPlatform); + return xElem == null ? null : DependencyUtil.getBogModuleDeps(xElem); + } + + private static final Set getWebUiModules(BDaemonPlatform bDaemonPlatform, BModuleContent bModuleContent) { + if (bModuleContent == null) { + bModuleContent = bDaemonPlatform.getModuleContent(); + } + return bModuleContent == BModuleContent.runtime ? new TreeSet() : (Set)ALL_WEB_UI_MODULES.clone(); + } + + public static BDependency[] getBogModuleDeps(XElem xElem) { + TreeSet treeSet = new TreeSet(); + DependencyUtil.accumBogModuleNames(treeSet, xElem); + return DependencyUtil.getModuleDeps(treeSet); + } + + private static final BDependency[] getModuleDeps(Set set) { + BDependency[] bDependencyArray = new BDependency[set.size()]; + int n = 0; + Iterator iterator = set.iterator(); + while (iterator.hasNext()) { + bDependencyArray[n] = BDependency.forModule((String)iterator.next()); + ++n; + } + return bDependencyArray; + } + + private static final Set accumBogModuleNames(Set set, XElem xElem) { + int n; + Object object; + Set set2; + Set set3 = set2 = set == null ? new TreeSet() : set; + if (xElem == null) { + return set2; + } + if (xElem.name().equals("p") && (object = xElem.get("m", null)) != null) { + n = ((String)object).indexOf(61); + Object object2 = n < 0 ? object : ((String)object).substring(n + 1); + set2.add(object2); + } + object = xElem.elems(); + n = 0; + while (n < ((XElem[])object).length) { + DependencyUtil.accumBogModuleNames(set2, (XElem)object[n]); + ++n; + } + return set2; + } + + private static final Set accumBogModuleDeps(Set set, InputStream inputStream, String string, String string2) throws ConnectException, AuthenticationException { + Set set2 = set == null ? new TreeSet() : set; + try { + set2.add("platform"); + if (inputStream != null) { + XParser xParser = XParser.make((InputStream)inputStream); + while (xParser.next() != -1) { + String string3; + if (xParser.type() != 1 || !xParser.elem().name().equals("p") || (string3 = xParser.elem().get("m", null)) == null) continue; + int n = string3.indexOf(61); + String string4 = n < 0 ? string3 : string3.substring(n + 1); + set2.add(string4); + } + } + return set2; + } + catch (ConnectException connectException) { + throw connectException; + } + catch (AuthenticationException authenticationException) { + throw authenticationException; + } + catch (Exception exception) { + throw new LocalizableRuntimeException(string, string2, (Throwable)exception); + } + } + + private static final Set accumPlatformDeps(Set set, BDaemonPlatform bDaemonPlatform) throws ConnectException, AuthenticationException { + Set set2 = set == null ? new TreeSet() : set; + BDaemonFileStore bDaemonFileStore = new BDaemonFileStore(bDaemonPlatform.getDaemonSession().getFileSpace(), new FilePath("!lib/platform.bog")); + try { + InputStream inputStream = bDaemonFileStore.getInputStream(); + if (inputStream == null) { + return set2; + } + return DependencyUtil.accumBogModuleDeps(set2, inputStream, "platform", "DependencyUtil.parsePlatformBog"); + } + catch (IOException iOException) { + throw new LocalizableRuntimeException("platform", "DependencyUtil.parsePlatformBog", (Throwable)iOException); + } + } + + public static AnalysisResults analyzeAllDependencies(BDaemonPlatform bDaemonPlatform, BFileSpace bFileSpace, FilePath filePath, BModuleContent bModuleContent, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + Set set; + if (bModuleContent == null) { + bModuleContent = bDaemonPlatform.getModuleContent(); + } + Set set2 = DependencyUtil.accumPlatformDeps(DependencyUtil.getWebUiModules(bDaemonPlatform, bModuleContent), bDaemonPlatform); + if (filePath == null) { + set = new TreeSet(set2); + } else { + Object object = bFileSpace instanceof BDaemonFileSpace ? new BDaemonFileStore((BDaemonFileSpace)bFileSpace, filePath.merge("config.bog")) : bFileSpace.findStore(filePath.merge("config.bog")); + InputStream inputStream = object.getInputStream(); + set = DependencyUtil.accumBogModuleDeps(new TreeSet(set2), inputStream, "platform", "DependencyUtil.parseConfigBog"); + } + return new AnalysisResults(bDaemonPlatform, set, set2, bModuleContent, new SolutionParameters(daemonSessionTaskListener)); + } + + public static AnalysisResults analyzeAllDependencies(BDaemonPlatform bDaemonPlatform, BDirectory[] bDirectoryArray, BModuleContent bModuleContent, SolutionParameters solutionParameters) throws Exception { + if (bModuleContent == null) { + bModuleContent = bDaemonPlatform.getModuleContent(); + } + Set set = DependencyUtil.accumPlatformDeps(DependencyUtil.getWebUiModules(bDaemonPlatform, bModuleContent), bDaemonPlatform); + Set set2 = new TreeSet(set); + if (bDirectoryArray != null) { + int n = 0; + while (n < bDirectoryArray.length) { + BIFile bIFile = (BIFile)bDirectoryArray[n].getNavChild("config.bog"); + if (bIFile != null) { + InputStream inputStream = bIFile.getInputStream(); + set2 = DependencyUtil.accumBogModuleDeps(set2, inputStream, "platform", "DependencyUtil.parseConfigBog"); + } + ++n; + } + } + return new AnalysisResults(bDaemonPlatform, set2, set, bModuleContent, solutionParameters); + } + + static final /* synthetic */ BDependency[] access$0(Set set) { + return DependencyUtil.getModuleDeps(set); + } + + static { + ALL_WEB_UI_MODULES.add("web"); + ALL_WEB_UI_MODULES.add("icons"); + ALL_WEB_UI_MODULES.add("converters"); + ALL_WEB_UI_MODULES.add("html"); + ALL_WEB_UI_MODULES.add("fonts"); + ALL_WEB_UI_MODULES.add("chart"); + ALL_WEB_UI_MODULES.add("wiresheet"); + ALL_WEB_UI_MODULES.add("workbench"); + ALL_WEB_UI_MODULES.add("pdf"); + ALL_WEB_UI_MODULES.add("kitPx"); + ANALYSIS_REQ_STATION = 1; + ANALYSIS_REQ_PLATFORM = 2; + ANALYSIS_DEP_MISSING = 256; + ANALYSIS_DEP_UNAVAILABLE = 512; + ANALYSIS_DEP_UNSOLVABLE = 1024; + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public static class AnalysisResults { + private InstallScenario solution; + private TreeMap flagsByPartName; + private int status; + static /* synthetic */ Class class$com$tridium$install$installable$BModuleInstallable; + + public InstallScenario getSolution() { + return this.solution; + } + + public boolean anyUnsolvable() { + boolean bl = false; + if ((this.status & ANALYSIS_DEP_UNSOLVABLE) > 0) { + bl = true; + } + return bl; + } + + public boolean anyUnvailable() { + boolean bl = false; + if ((this.status & ANALYSIS_DEP_UNAVAILABLE) > 0) { + bl = true; + } + return bl; + } + + public boolean anyToInstall() { + boolean bl = false; + if ((this.status & ANALYSIS_DEP_MISSING) > 0) { + bl = true; + } + return bl; + } + + public String[] getPartNames() { + Set set = this.flagsByPartName.keySet(); + return set.toArray(new String[set.size()]); + } + + public boolean isStationModule(String string) { + return this.isStatusFlagSet(string, ANALYSIS_REQ_STATION); + } + + public boolean isPlatformModule(String string) { + return this.isStatusFlagSet(string, ANALYSIS_REQ_PLATFORM); + } + + public boolean isMissing(String string) { + return this.isStatusFlagSet(string, ANALYSIS_DEP_MISSING); + } + + public boolean isUnavailable(String string) { + return this.isStatusFlagSet(string, ANALYSIS_DEP_UNAVAILABLE); + } + + public boolean isUnsolvable(String string) { + return this.isStatusFlagSet(string, ANALYSIS_DEP_UNSOLVABLE); + } + + private final void accumModuleDependencies(String string, Set set, Map map, int n) { + if (set.contains(string)) { + return; + } + this.setStatusFlag(string, n); + set.add(string); + BModulePart bModulePart = (BModulePart)((Object)map.get(string)); + if (bModulePart != null) { + BDependency[] bDependencyArray = bModulePart.getDependencyArray(); + int n2 = 0; + while (n2 < bDependencyArray.length) { + if (bDependencyArray[n2].getPartType().equals(BModulePart.TYPE)) { + this.accumModuleDependencies(bDependencyArray[n2].getPartName(), set, map, n); + } + ++n2; + } + } + } + + private final void setStatusFlag(String string, int n) { + Integer n2 = (Integer)this.flagsByPartName.get(string); + int n3 = 0; + if (n2 != null) { + n3 = n2; + } + int n4 = n3; + this.flagsByPartName.put(string, new Integer(n4 | n)); + this.status |= n; + } + + private final boolean isStatusFlagSet(String string, int n) { + Integer n2 = (Integer)this.flagsByPartName.get(string); + boolean bl = false; + if (n2 != null && (n2 & n) > 0) { + bl = true; + } + return bl; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.flagsByPartName = new TreeMap(); + this.status = 0; + } + + /* + * Unable to fully structure code + */ + public AnalysisResults(BDaemonPlatform var1_1, Set var2_2, Set var3_3, BModuleContent var4_4, SolutionParameters var5_5) throws Exception { + super(); + this.this(); + this.solution = new InstallScenario(var1_1, null, DependencyUtil.access$0(var2_2), null, null, null, var4_4, var5_5, (InstallableRegistry)LocalInstallableRegistry.getInstance()).solve(); + var6_6 = false; + var7_7 = 0; + while (var7_7 < this.solution.getToInstall().length) { + if (this.solution.getToInstall()[var7_7] instanceof BDistribution && (var8_9 = DependencyUtil.getPlatformModuleDependencies(var1_1, (BDistribution)this.solution.getToInstall()[var7_7])) != null) { + var9_12 = 0; + while (var9_12 < var8_9.length) { + if (var3_3.add(var8_9[var9_12].getPartName())) { + var6_6 = true; + } + if (var2_2.add(var8_9[var9_12].getPartName())) { + var6_6 = true; + } + ++var9_12; + } + } + ++var7_7; + } + if (var6_6) { + this.solution = this.solution.solve(null, null, DependencyUtil.access$0(var2_2), null, LocalInstallableRegistry.getInstance()); + } + var7_8 = new HashMap(); + var8_9 = var1_1.getModuleList().getModules().getProperties(); + if (true) ** GOTO lbl27 + do { + var9_14 = ((BModuleInstallable)var8_9.get()).getModulePart(); + var7_8.put(var9_14.getPartName(), var9_14); +lbl27: + // 2 sources + + if ((v0 = AnalysisResults.class$com$tridium$install$installable$BModuleInstallable) != null) continue; + v0 = AnalysisResults.class("[Lcom.tridium.install.installable.BModuleInstallable;", false); + } while (var8_9.next(v0)); + var8_10 = 0; + while (var8_10 < this.solution.getToInstall().length) { + this.setStatusFlag(this.solution.getToInstall()[var8_10].getInstallableName(), DependencyUtil.access$1()); + if (this.solution.getToInstall()[var8_10] instanceof BModuleInstallable) { + var9_15 = ((BModuleInstallable)this.solution.getToInstall()[var8_10]).getModulePart(); + var7_8.put(var9_15.getPartName(), var9_15); + } + ++var8_10; + } + var8_11 = this.solution.getUnmeetableDependencies(); + var9_16 = 0; + while (var9_16 < var8_11.length) { + var10_18 = var8_11[var9_16].dependency.getPartName(); + if (var8_11[var9_16].isUnsolvable) { + this.setStatusFlag((String)var10_18, DependencyUtil.access$2() | DependencyUtil.access$1()); + } else { + this.setStatusFlag((String)var10_18, DependencyUtil.access$3() | DependencyUtil.access$1()); + } + ++var9_16; + } + var9_17 = new HashSet(); + var10_18 = var3_3.iterator(); + while (var10_18.hasNext()) { + this.accumModuleDependencies((String)var10_18.next(), var9_17, var7_8, DependencyUtil.access$4() | DependencyUtil.access$5()); + } + var10_18 = var2_2.iterator(); + while (var10_18.hasNext()) { + this.accumModuleDependencies((String)var10_18.next(), var9_17, var7_8, DependencyUtil.access$5()); + } + } + } +} + diff --git a/modules/cfr_output/com/tridium/install/FilenameFilterUtil.java b/modules/cfr_output/com/tridium/install/FilenameFilterUtil.java new file mode 100644 index 0000000..3fce2b0 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/FilenameFilterUtil.java @@ -0,0 +1,165 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BIFile + * javax.baja.file.FilePath + * javax.baja.nre.util.IFilter + * javax.baja.util.Lexicon + * javax.baja.util.PatternFilter + */ +package com.tridium.install; + +import javax.baja.file.BIFile; +import javax.baja.file.FilePath; +import javax.baja.nre.util.IFilter; +import javax.baja.util.Lexicon; +import javax.baja.util.PatternFilter; + +public class FilenameFilterUtil { + public static final Lexicon lex = Lexicon.make((String)"platform"); + public static final IFilter NULL_FILTER = new NullFilenameFilter(); + + public static IFilter make(String string, String string2) { + if (string == null || string.trim().length() == 0) { + if (string2 == null || string2.trim().length() == 0) { + return NULL_FILTER; + } + return FilenameFilterUtil.makeExclude(string2); + } + if (string2 == null || string2.trim().length() == 0) { + return FilenameFilterUtil.makeInclude(string); + } + return FilenameFilterUtil.makeAnd(new IFilter[]{FilenameFilterUtil.makeInclude(string), FilenameFilterUtil.makeExclude(string2)}); + } + + public static IFilter makeExclude(String string) { + return FilenameFilterUtil.makeExclude((IFilter[])PatternFilter.parseList((String)string)); + } + + public static IFilter makeExclude(String string, String string2) { + return FilenameFilterUtil.makeExclude((IFilter[])PatternFilter.parseList((String)string, (String)string2)); + } + + private static final IFilter makeExclude(IFilter[] iFilterArray) { + if (iFilterArray.length == 0) { + return NULL_FILTER; + } + IFilter[] iFilterArray2 = new IFilter[iFilterArray.length]; + int n = 0; + while (n < iFilterArray2.length) { + iFilterArray2[n] = FilenameFilterUtil.makeInverse(iFilterArray[n]); + ++n; + } + return FilenameFilterUtil.makeAnd(iFilterArray2); + } + + public static IFilter makeInclude(String string) { + return FilenameFilterUtil.makeOr((IFilter[])PatternFilter.parseList((String)string)); + } + + public static IFilter makeInclude(String string, String string2) { + return FilenameFilterUtil.makeOr((IFilter[])PatternFilter.parseList((String)string, (String)string2)); + } + + public static IFilter makeInverse(IFilter iFilter) { + return new NotFilenameFilter(iFilter); + } + + public static IFilter makeOr(IFilter[] iFilterArray) { + if (iFilterArray.length == 0) { + return NULL_FILTER; + } + return new OrFilenameFilter(iFilterArray); + } + + public static IFilter makeAnd(IFilter[] iFilterArray) { + if (iFilterArray.length == 0) { + return NULL_FILTER; + } + return new AndFilenameFilter(iFilterArray); + } + + private static final String getFilename(Object object) { + if (object instanceof BIFile) { + return ((BIFile)object).getFileName(); + } + if (object instanceof FilePath) { + return ((FilePath)object).getName(); + } + if (object instanceof String) { + return (String)object; + } + throw new IllegalArgumentException("unrecognized file object"); + } + + public static class NotFilenameFilter + implements IFilter { + private IFilter invert; + + public boolean accept(Object object) { + return this.invert.accept((Object)FilenameFilterUtil.getFilename(object)) ^ true; + } + + public NotFilenameFilter(IFilter iFilter) { + this.invert = iFilter; + } + } + + public static class OrFilenameFilter + implements IFilter { + private IFilter[] filters; + + public boolean accept(Object object) { + int n = 0; + while (n < this.filters.length) { + if (this.filters[n].accept((Object)FilenameFilterUtil.getFilename(object))) { + return true; + } + ++n; + } + return false; + } + + public OrFilenameFilter(IFilter[] iFilterArray) { + if (iFilterArray == null || iFilterArray.length == 0) { + throw new IllegalArgumentException(); + } + this.filters = iFilterArray; + } + } + + public static class AndFilenameFilter + implements IFilter { + private IFilter[] filters; + + public boolean accept(Object object) { + int n = 0; + while (n < this.filters.length) { + if (!this.filters[n].accept((Object)FilenameFilterUtil.getFilename(object))) { + return false; + } + ++n; + } + return true; + } + + public AndFilenameFilter(IFilter[] iFilterArray) { + if (iFilterArray == null || iFilterArray.length == 0) { + throw new IllegalArgumentException(); + } + this.filters = iFilterArray; + } + } + + private static class NullFilenameFilter + implements IFilter { + public boolean accept(Object object) { + return true; + } + + private NullFilenameFilter() { + } + } +} + diff --git a/modules/cfr_output/com/tridium/install/GetModuleListMessage.java b/modules/cfr_output/com/tridium/install/GetModuleListMessage.java new file mode 100644 index 0000000..ffda0c5 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/GetModuleListMessage.java @@ -0,0 +1,46 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.install; + +import com.tridium.platform.daemon.message.XmlResponseMessage; + +public class GetModuleListMessage +extends XmlResponseMessage { + private boolean sendCrc; + private boolean full; + private boolean depsOnly; + private String moduleName; + + public String getMessageString() { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("moduleInfo?sendCrc=").append(this.sendCrc).append("&full=").append(this.full); + if (this.depsOnly) { + stringBuffer.append("&depsOnly=").append(this.depsOnly); + } + if (this.moduleName != null && this.moduleName.length() > 0) { + stringBuffer.append("&moduleName=").append(this.moduleName); + } + return stringBuffer.toString(); + } + + public GetModuleListMessage() { + this(false, false); + } + + public GetModuleListMessage(boolean bl, boolean bl2) { + this(bl, bl2, false); + } + + public GetModuleListMessage(boolean bl, boolean bl2, boolean bl3) { + this(bl, bl2, bl3, null); + } + + public GetModuleListMessage(boolean bl, boolean bl2, boolean bl3, String string) { + this.sendCrc = bl; + this.full = bl2; + this.depsOnly = bl3; + this.moduleName = string; + } +} + diff --git a/modules/cfr_output/com/tridium/install/InstallScenario.java b/modules/cfr_output/com/tridium/install/InstallScenario.java new file mode 100644 index 0000000..e06a70a --- /dev/null +++ b/modules/cfr_output/com/tridium/install/InstallScenario.java @@ -0,0 +1,1355 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.util.graph.Digraph + * javax.baja.file.BIFile + * javax.baja.log.Log + * javax.baja.nre.util.Array + * javax.baja.sys.BComponent + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.Clock + * javax.baja.sys.Type + * javax.baja.timezone.BTimeZone + * javax.baja.util.BTypeSpec + * javax.baja.util.Lexicon + */ +package com.tridium.install; + +import com.tridium.install.BDaemonPlatform; +import com.tridium.install.BDependency; +import com.tridium.install.BPartInstallStatus; +import com.tridium.install.BVersion; +import com.tridium.install.InstallableCandidates; +import com.tridium.install.InstallableFilter; +import com.tridium.install.PartSpec; +import com.tridium.install.SolutionParameters; +import com.tridium.install.UnmeetableDependency; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.installable.BModuleInstallable; +import com.tridium.install.installable.ClosableCursor; +import com.tridium.install.installable.InstallableRegistry; +import com.tridium.install.installable.LocalInstallableRegistry; +import com.tridium.install.part.BArchPart; +import com.tridium.install.part.BBrandPart; +import com.tridium.install.part.BGenericPart; +import com.tridium.install.part.BModelPart; +import com.tridium.install.part.BModulePart; +import com.tridium.install.part.BNrePart; +import com.tridium.install.part.BOsPart; +import com.tridium.install.part.BPart; +import com.tridium.install.part.BVmPart; +import com.tridium.platform.daemon.BModuleContent; +import com.tridium.platform.daemon.DaemonFileUtil; +import com.tridium.platform.daemon.file.StoreCache; +import com.tridium.platform.daemon.message.ByteArrayFileTransferElement; +import com.tridium.platform.daemon.message.DaemonMessage; +import com.tridium.platform.daemon.message.DeleteFileTransferMessageElement; +import com.tridium.platform.daemon.message.FileTransferMessage; +import com.tridium.platform.daemon.message.FileTransferMessageElement; +import com.tridium.platform.daemon.message.UpdateTimeMessage; +import com.tridium.platform.daemon.message.XmlResponseMessage; +import com.tridium.platform.daemon.task.DaemonSessionTask; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import com.tridium.platform.tcpip.BTcpIpHostSettings; +import com.tridium.platform.timezone.TimeZoneUtil; +import com.tridium.util.graph.Digraph; +import java.io.ByteArrayOutputStream; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.TreeSet; +import javax.baja.file.BIFile; +import javax.baja.log.Log; +import javax.baja.nre.util.Array; +import javax.baja.platform.ICancelHint; +import javax.baja.platform.install.BVersionRelation; +import javax.baja.sys.BComponent; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.Clock; +import javax.baja.sys.Type; +import javax.baja.timezone.BTimeZone; +import javax.baja.util.BTypeSpec; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class InstallScenario { + public static BDependency BAJA_3_5 = new BDependency("baja", new BVersion("3.5"), BModulePart.TYPE.getTypeSpec()); + public static BDependency NRE_3_7 = new BDependency("*", new BVersion("3.7"), BNrePart.TYPE.getTypeSpec()); + public static BDependency PLATDIALUP_3_7 = new BDependency("platDialup", new BVersion("3.7"), BModulePart.TYPE.getTypeSpec()); + private static Log log = Log.getLog((String)"platform.install"); + private Array toInstall; + private Set modulesToUninstall; + private BDaemonPlatform targetPlatform; + private HostState endStateFixed; + private HostState endStateMutable; + private InstallableCandidates candidates; + private SolutionParameters solutionParms; + private Array excludedInstallables; + private Map statusByPartSpec; + private BModuleContent newModuleContent; + private BTcpIpHostSettings tcpIpChanges; + private BTimeZone newOsTimeZone; + private long processingFlags; + private boolean isSolved; + private int nStandalone; + private InstallableRegistry registry; + static /* synthetic */ Class class$com$tridium$install$part$BPart; + static /* synthetic */ Class class$com$tridium$install$installable$BModuleInstallable; + static /* synthetic */ Class class$com$tridium$install$BDependency; + static /* synthetic */ Class class$com$tridium$install$installable$BInstallable; + static /* synthetic */ Class class$java$lang$String; + + protected InstallScenario copy() { + InstallableCandidates installableCandidates = this.candidates.newCopy(); + TreeSet treeSet = new TreeSet(); + treeSet.addAll(this.modulesToUninstall); + return new InstallScenario(this.targetPlatform, this.toInstall.copy(), this.excludedInstallables.copy(), treeSet, this.endStateFixed, this.endStateMutable.copy(), installableCandidates, this.newModuleContent, this.tcpIpChanges, this.newOsTimeZone, this.processingFlags, this.solutionParms, this.registry); + } + + public boolean hasChanges() { + boolean bl = false; + if (this.toInstall.size() > 0 || this.modulesToUninstall.size() > 0 || this.newModuleContent != null || this.tcpIpChanges != null || (this.processingFlags & 0x200000L) > 0L && !this.newOsTimeZone.isNull()) { + bl = true; + } + return bl; + } + + public BInstallable[] getToInstall() { + return (BInstallable[])this.toInstall.trim(); + } + + public String[] getModulesToUninstall() { + String[] stringArray = new String[this.modulesToUninstall.size()]; + this.modulesToUninstall.toArray(stringArray); + return stringArray; + } + + public InstallableCandidates getInstallableCandidates() { + return this.candidates; + } + + public BDependency[] getUnmetDependencies() { + return this.candidates.getDependencies(); + } + + public UnmeetableDependency[] getUnmeetableDependencies() { + return this.candidates.getUnmeetableDependencies(this); + } + + public BDependency getFailedExclusion(BDependency bDependency) { + return this.candidates.getFailedExclusion(bDependency, this); + } + + public InstallableFilter getFailedFilter(BDependency bDependency) { + return this.candidates.getFailedFilter(bDependency, this); + } + + public boolean installableNotFound(BDependency bDependency) { + return this.candidates.installableNotFound(bDependency, this); + } + + public boolean isDependencyUnsolvable(BDependency bDependency) { + return this.candidates.isDependencyUnsolvable(bDependency, this); + } + + public BInstallable[] getExcludedInstallables() { + return (BInstallable[])this.excludedInstallables.trim(); + } + + public BPart[] getParts() { + Class clazz = class$com$tridium$install$part$BPart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BPart = InstallScenario.class("[Lcom.tridium.install.part.BPart;", false); + } + Array array = new Array(clazz); + array.addAll((Object[])this.endStateFixed.getParts()); + array.addAll((Object[])this.endStateMutable.getParts()); + return (BPart[])array.trim(); + } + + public BModuleContent getNewModuleContent() { + return this.newModuleContent; + } + + public BTcpIpHostSettings getTcpIpChanges() { + return this.tcpIpChanges; + } + + public BTimeZone getNewOsTimeZone() { + return this.newOsTimeZone; + } + + public long getProcessingFlags() { + return this.processingFlags; + } + + public BDaemonPlatform getTargetPlatform() { + return this.targetPlatform; + } + + public BPartInstallStatus getPartStatus(BPart bPart) { + return this.getPartStatus(bPart.getPartName(), bPart.getType().getTypeSpec()); + } + + public synchronized BPartInstallStatus getPartStatus(String string, BTypeSpec bTypeSpec) { + BPartInstallStatus bPartInstallStatus; + BComponent bComponent; + if (this.candidates.size() > 0) { + throw new IllegalStateException("Attempt to get part status from scenario with unmet dependencies"); + } + if (this.excludedInstallables.size() > 0) { + throw new IllegalStateException("Attempt to get part status from scenario with excluded installables"); + } + PartSpec partSpec = new PartSpec(string, bTypeSpec); + if (this.statusByPartSpec == null) { + this.statusByPartSpec = new HashMap(); + Iterator iterator = this.modulesToUninstall.iterator(); + while (iterator.hasNext()) { + this.statusByPartSpec.put(PartSpec.forModule((String)iterator.next()), BPartInstallStatus.uninstall); + } + int n = 0; + while (n < this.toInstall.size()) { + bComponent = (BInstallable)this.toInstall.get(n); + BPart bPart = bComponent.getPart(); + if (bPart != null) { + BPart bPart2 = this.targetPlatform.getPart(bPart); + if (bPart2 == null) { + this.statusByPartSpec.put(bPart.getPartSpec(), BPartInstallStatus.install); + } else { + BVersion bVersion = bPart2.getVersion(); + BVersion bVersion2 = bPart.getVersion(); + switch (bVersion.checkVersionRequirement(bVersion2)) { + case 2: { + if (bPart2 instanceof BModulePart) { + BModulePart bModulePart = (BModulePart)bPart2; + BModulePart bModulePart2 = (BModulePart)bPart; + if (bModulePart.getBuildAbsTime() != null && bModulePart2.getBuildAbsTime() != null) { + int n2 = bModulePart2.getBuildAbsTime().compareTo((Object)bModulePart.getBuildAbsTime()); + if (n2 > 0) { + this.statusByPartSpec.put(bPart.getPartSpec(), BPartInstallStatus.upgrade); + break; + } + if (n2 < 0) { + this.statusByPartSpec.put(bPart.getPartSpec(), BPartInstallStatus.downgrade); + break; + } + this.statusByPartSpec.put(bPart.getPartSpec(), BPartInstallStatus.reinstall); + break; + } + this.statusByPartSpec.put(bPart.getPartSpec(), BPartInstallStatus.reinstall); + break; + } + this.statusByPartSpec.put(bPart.getPartSpec(), BPartInstallStatus.reinstall); + break; + } + case 8: + case 16: { + this.statusByPartSpec.put(bPart.getPartSpec(), BPartInstallStatus.reinstall); + break; + } + case 4: { + this.statusByPartSpec.put(bPart.getPartSpec(), BPartInstallStatus.upgrade); + break; + } + default: { + this.statusByPartSpec.put(bPart.getPartSpec(), BPartInstallStatus.downgrade); + } + } + } + } + ++n; + } + } + if ((bPartInstallStatus = (BPartInstallStatus)((Object)this.statusByPartSpec.get(partSpec))) == null) { + bComponent = this.targetPlatform.getPart(string, bTypeSpec); + bPartInstallStatus = bComponent == null ? BPartInstallStatus.notFound : BPartInstallStatus.noChange; + this.statusByPartSpec.put(partSpec, bPartInstallStatus); + } + return bPartInstallStatus; + } + + public static InstallScenario solve(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener, String[] stringArray, BDependency[] bDependencyArray, BInstallable[] bInstallableArray, InstallableRegistry installableRegistry) throws Exception { + return InstallScenario.solve(bDaemonPlatform, stringArray, bDependencyArray, bInstallableArray, new SolutionParameters(daemonSessionTaskListener), installableRegistry); + } + + public static InstallScenario solve(BDaemonPlatform bDaemonPlatform, String[] stringArray, BDependency[] bDependencyArray, BInstallable[] bInstallableArray, SolutionParameters solutionParameters, InstallableRegistry installableRegistry) throws Exception { + return new InstallScenario(bDaemonPlatform, stringArray, bDependencyArray, bInstallableArray, BTimeZone.NULL, null, null, solutionParameters, installableRegistry).solve(); + } + + public InstallScenario solve() throws Exception { + if (this.isSolved) { + this.traceState("Already solved"); + return this; + } + if (this.candidates.size() == 0) { + if (this.modulesToUninstall.size() == 0) { + InstallScenario installScenario; + BPart bPart; + this.isSolved = true; + this.traceState("Complete solution"); + if (!this.getTargetPlatform().meets(NRE_3_7) && this.endStateMutable.meets(NRE_3_7) && !this.endStateMutable.meets(PLATDIALUP_3_7) && (bPart = this.getTargetPlatform().getModuleList().getPart("platDialup")) != null && (installScenario = this.solve(this.solutionParms.listener, null, new BDependency[]{PLATDIALUP_3_7}, null, this.registry)).canCommit()) { + return installScenario; + } + return this; + } + BModulePart[] bModulePartArray = this.endStateMutable.getModules(); + int n = 0; + while (n < bModulePartArray.length) { + BInstallable bInstallable = this.registry.findInstallable(BDependency.forPart(bModulePartArray[n], BVersionRelation.exact), null); + if (bInstallable == null) { + bInstallable = this.registry.findInstallable(BDependency.forModule(bModulePartArray[n].getPartName()), this.solutionParms.listener); + } + if (bInstallable != null) { + BDependency[] bDependencyArray = bInstallable.getAllDependencies(); + int n2 = 0; + while (n2 < bDependencyArray.length) { + if (bDependencyArray[n2].getPartTypeSpec().equals((Object)BModulePart.TYPE.getTypeSpec()) && this.modulesToUninstall.contains(bDependencyArray[n2].getPartName())) { + this.addCandidates(bDependencyArray[n2]); + break; + } + ++n2; + } + } + ++n; + } + if (this.candidates.size() > 0) { + this.traceState("Uninstalls break dependencies"); + } else { + this.traceState("Complete solution"); + } + this.isSolved = true; + return this; + } + Object object = this.candidates.getFirstKey(); + BInstallable[] bInstallableArray = this.candidates.getCandidates(object); + if (bInstallableArray.length == 0) { + this.traceState("Incomplete solution"); + this.isSolved = true; + return this; + } + log.trace("At least 1 candidate for " + object); + InstallScenario installScenario = null; + int n = 0; + while (n < bInstallableArray.length) { + BInstallable bInstallable = bInstallableArray[n]; + InstallScenario installScenario2 = this.copy(); + installScenario2.install(bInstallable, object); + installScenario2 = installScenario2.solve(); + if (installScenario2.candidates.size() == 0) { + return installScenario2; + } + if (installScenario == null || installScenario2.candidates.size() < installScenario.candidates.size()) { + if (installScenario == null) { + log.trace(object + " candidate " + n + ": " + bInstallable.getInstallableFileName() + " is first result considered"); + } else { + log.trace(object + " candidate " + n + ": " + bInstallable.getInstallableFileName() + " beats best result"); + } + installScenario = installScenario2; + } else { + log.trace(object + " candidate " + n + ": " + bInstallable.getInstallableFileName() + " isn't as good as best result, discarding"); + } + ++n; + } + this.isSolved = true; + return installScenario; + } + + public boolean isSolved() { + return this.isSolved; + } + + public InstallableRegistry getInstallableRegistry() { + return this.registry; + } + + public InstallScenario solve(DaemonSessionTaskListener daemonSessionTaskListener, String[] stringArray, BDependency[] bDependencyArray, BInstallable[] bInstallableArray, InstallableRegistry installableRegistry) throws Exception { + Class clazz; + Class clazz2; + if (this.excludedInstallables.size() > 0) { + throw new IllegalStateException("Some installables are excluded"); + } + Class clazz3 = class$java$lang$String; + if (clazz3 == null) { + clazz3 = class$java$lang$String = InstallScenario.class("[Ljava.lang.String;", false); + } + Array array = new Array(clazz3); + array.addAll((Object[])this.getModulesToUninstall()); + if (stringArray != null) { + array.addAll((Object[])stringArray); + } + if ((clazz2 = class$com$tridium$install$BDependency) == null) { + clazz2 = class$com$tridium$install$BDependency = InstallScenario.class("[Lcom.tridium.install.BDependency;", false); + } + Array array2 = new Array(clazz2); + array2.addAll((Object[])this.getUnmetDependencies()); + if (bDependencyArray != null) { + array2.addAll((Object[])bDependencyArray); + } + if ((clazz = class$com$tridium$install$installable$BInstallable) == null) { + clazz = class$com$tridium$install$installable$BInstallable = InstallScenario.class("[Lcom.tridium.install.installable.BInstallable;", false); + } + Array array3 = new Array(clazz); + array3.addAll((Object[])this.getToInstall()); + if (bInstallableArray != null) { + array3.addAll((Object[])bInstallableArray); + } + return new InstallScenario(this.getTargetPlatform(), (String[])array.trim(), (BDependency[])array2.trim(), (BInstallable[])array3.trim(), this.getNewOsTimeZone(), this.getTcpIpChanges(), this.getNewModuleContent(), this.solutionParms, installableRegistry).solve(); + } + + public boolean canCommit() { + boolean bl = false; + if (this.candidates.size() == 0 && this.excludedInstallables.size() == 0 && this.targetPlatform != null && (this.nStandalone == 0 || this.nStandalone == 1 && this.toInstall.size() == 1)) { + bl = true; + } + return bl; + } + + public void commit(DaemonSessionTaskListener daemonSessionTaskListener, ICancelHint iCancelHint, boolean bl) throws Exception { + this.commit(daemonSessionTaskListener, new StoreCache(), iCancelHint, bl); + } + + public void commit(DaemonSessionTaskListener daemonSessionTaskListener, ICancelHint iCancelHint) throws Exception { + this.commit(daemonSessionTaskListener, new StoreCache(), iCancelHint, false); + } + + public void commit(DaemonSessionTaskListener daemonSessionTaskListener, StoreCache storeCache, ICancelHint iCancelHint) throws Exception { + this.commit(daemonSessionTaskListener, storeCache, iCancelHint, false); + } + + /* + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void commit(DaemonSessionTaskListener daemonSessionTaskListener, StoreCache storeCache, ICancelHint iCancelHint, boolean bl) throws Exception { + FileTransferMessageElement[] fileTransferMessageElementArray; + BComponent bComponent; + Object object; + if (this.candidates.size() > 0) { + throw new IllegalStateException("Cannot commit a scenario having unmet dependencies"); + } + if (this.excludedInstallables.size() > 0) { + throw new IllegalStateException("Cannot commit a scenario having excluded installables"); + } + if (this.targetPlatform == null) { + throw new IllegalStateException("Cannot commit a scenario having no target platform"); + } + if (this.nStandalone > 2 || this.nStandalone == 1 && this.toInstall.size() > 1) { + throw new IllegalStateException("Cannot commit a scenario having a standalone installable with any other installables"); + } + if (daemonSessionTaskListener == null) { + daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER; + } + if ((this.processingFlags & 0x200000L) > 0L) { + object = new DaemonSessionTask(Lexicon.make((String)"platform"), "InstallManifest.newOsTimeZone.title", "InstallManifest.newOsTimeZone.message", new Object[]{this.getNewOsTimeZone()}); + daemonSessionTaskListener.taskStarted((DaemonSessionTask)object); + try { + this.targetPlatform.getDaemonSession().sendMessage(new UpdateTimeMessage(null, null, TimeZoneUtil.makeCompatible(this.getNewOsTimeZone(), this.targetPlatform.getDaemonSession().getHostProperties().getTimezoneDayModeSupport()))); + } + catch (Throwable throwable) { + Object var7_11 = null; + daemonSessionTaskListener.taskFinished((DaemonSessionTask)object); + throw throwable; + } + { + bComponent = null; + daemonSessionTaskListener.taskFinished((DaemonSessionTask)object); + } + } + if (!this.targetPlatform.meets(NRE_3_7) && this.endStateMutable.meets(NRE_3_7) && this.targetPlatform.getDaemonSession().getHostProperties().supportsServlet("dialup")) { + this.targetPlatform.getDaemonSession().sendMessage(new DaemonMessage(){ + + public final String getMessageString() { + return "dialup/stop"; + } + }); + } + if (storeCache == null) { + storeCache = new StoreCache(); + } + object = new FileTransferMessage(false, storeCache, this.targetPlatform.getDaemonSession().getFileSpace()); + if ((this.processingFlags & 0x100000L) > 0L && this.getNewModuleContent() != null) { + DaemonSessionTask daemonSessionTask = new DaemonSessionTask(Lexicon.make((String)"platform"), "InstallManifest.newModuleContent.title", "InstallManifest.newModuleContent.message", new Object[]{this.getNewModuleContent()}); + daemonSessionTaskListener.taskStarted(daemonSessionTask); + try { + this.targetPlatform.getDaemonSession().sendMessage(new UpdateModuleContentMessage(this.getNewModuleContent())); + this.targetPlatform.setModuleContent(this.getNewModuleContent()); + } + catch (Throwable throwable) { + Object var8_15 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + throw throwable; + } + { + fileTransferMessageElementArray = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + } + } + int n = 0; + block6: while (true) { + if (n >= this.toInstall.size()) break; + bComponent = (BInstallable)this.toInstall.get(n); + log.trace("Getting transfer elements for " + bComponent.getInstallableName()); + fileTransferMessageElementArray = bComponent.getTransferElements(this.targetPlatform, storeCache, iCancelHint, daemonSessionTaskListener); + log.trace("Adding transfer elements for " + bComponent.getInstallableName()); + int n2 = 0; + while (true) { + if (n2 >= fileTransferMessageElementArray.length) { + ++n; + continue block6; + } + if (bl && fileTransferMessageElementArray[n2].getRequestMethod().equals("POST") && (fileTransferMessageElementArray[n2].getFilePath().getBody().equals("!daemon/daemon.properties") || fileTransferMessageElementArray[n2].getFilePath().getBody().equals("/niagara/daemon/daemon.properties"))) { + ((FileTransferMessage)object).addElement(this.revertAuthProperties(fileTransferMessageElementArray[n2], this.targetPlatform)); + } else { + ((FileTransferMessage)object).addElement(fileTransferMessageElementArray[n2]); + } + ++n2; + } + break; + } + Iterator iterator = this.modulesToUninstall.iterator(); + while (true) { + if (!iterator.hasNext()) break; + bComponent = (BModulePart)this.targetPlatform.getPart((String)iterator.next(), BModulePart.TYPE.getTypeSpec(), daemonSessionTaskListener); + if (bComponent == null) continue; + ((FileTransferMessage)object).addElement(new DeleteFileTransferMessageElement(bComponent.getDestinationPath(), this.targetPlatform.getDaemonSession().getFileSpace())); + } + log.trace("Starting file transfer"); + boolean bl2 = DaemonFileUtil.transfer(this.targetPlatform.getDaemonSession(), (FileTransferMessage)object, iCancelHint, daemonSessionTaskListener); + int n3 = 0; + while (true) { + if (n3 >= this.toInstall.size()) { + if (bl2) break; + throw new BajaRuntimeException("transfer failed"); + } + ((BInstallable)this.toInstall.get(n3)).close(); + ++n3; + } + this.targetPlatform.getModuleList().reset(); + } + + /* + * Unable to fully structure code + */ + public static InstallScenario upgradeOutOfDate(InstallScenario var0, InstallableRegistry var1_1) throws Exception { + if (var0.nStandalone > 0) { + return var0; + } + if (var0.candidates.size() > 0) { + throw new IllegalArgumentException("Scenario has unmet dependencies"); + } + if (var0.excludedInstallables.size() > 0) { + throw new IllegalArgumentException("Scenario has excluded installables"); + } + var2_2 = var0; + var3_3 = var2_2.getTargetPlatform(); + var3_3.checkSession(var0.getSolutionParameters().listener); + var4_4 = new HashMap(); + var5_5 = var2_2.getModulesToUninstall(); + var6_6 = 0; + while (var6_6 < var5_5.length) { + var4_4.put(var5_5[var6_6], null); + ++var6_6; + } + var6_7 = var2_2.getToInstall(); + var7_8 = 0; + while (var7_8 < var6_7.length) { + var8_10 = var6_7[var7_8].getPart(); + if (var8_10 != null && var8_10 instanceof BModulePart) { + var4_4.put(var8_10.getPartName(), var8_10); + } + ++var7_8; + } + var2_2 = var2_2.solve(); + v0 = InstallScenario.class$com$tridium$install$installable$BInstallable; + if (v0 == null) { + v0 = InstallScenario.class$com$tridium$install$installable$BInstallable = InstallScenario.class("[Lcom.tridium.install.installable.BInstallable;", false); + } + var7_9 = new Array(v0); + var7_9.addAll((Object[])var2_2.getToInstall()); + var3_3.getModuleList().init(var0.getSolutionParameters().listener); + var8_10 = new Digraph(); + var9_11 = var3_3.getModuleList().getModules().getProperties(); + if (true) ** GOTO lbl50 + do { + if (!var8_10.hasVertex(var11_14 = (var10_12 = (BModuleInstallable)var9_11.get()).getModulePart().getPartName())) { + var8_10.addVertex(var11_14); + } + var12_15 = var10_12.getAllDependencies(); + var13_16 = 0; + while (var13_16 < var12_15.length) { + if (var12_15[var13_16].getPartType().equals(BModulePart.TYPE)) { + var14_17 = var12_15[var13_16].getPartName(); + if (!var8_10.hasVertex(var14_17)) { + var8_10.addVertex(var14_17); + } + var8_10.addEdge(var14_17, var11_14); + } + ++var13_16; + } +lbl50: + // 2 sources + + if ((v1 = InstallScenario.class$com$tridium$install$installable$BModuleInstallable) != null) continue; + v1 = InstallScenario.class("[Lcom.tridium.install.installable.BModuleInstallable;", false); + } while (var9_11.next(v1)); + var9_11 = var8_10.topologicalSort(); + var10_13 = 0; + while (var10_13 < var9_11.length) { + var11_14 = var3_3.getModuleList().getModuleInstallable(var9_11[var10_13].toString()); + if (var11_14 != null) { + var2_2 = InstallScenario.checkModuleForUpgrades(var2_2, var11_14.getModulePart(), var4_4, var1_1); + } + ++var10_13; + } + return var2_2; + } + + protected void addCandidates(BDependency bDependency) throws Exception { + this.addCandidates(bDependency, this.candidates); + } + + protected boolean addCandidates(BDependency bDependency, InstallableCandidates installableCandidates) throws Exception { + if (installableCandidates.containsKey((Object)bDependency)) { + boolean bl = false; + if (installableCandidates.getCandidates((Object)bDependency).length > 0) { + bl = true; + } + return bl; + } + installableCandidates.addAll(this.solutionParms.getAdditionalCandidates(this, bDependency)); + Class clazz = class$com$tridium$install$installable$BInstallable; + if (clazz == null) { + clazz = class$com$tridium$install$installable$BInstallable = InstallScenario.class("[Lcom.tridium.install.installable.BInstallable;", false); + } + Array array = new Array(clazz); + if (bDependency.canSolveWith(this.solutionParms.solvers) && this.registry != null && this.nStandalone == 0) { + ClosableCursor closableCursor = this.registry.getInstallables(bDependency, this.solutionParms.listener); + while (closableCursor.next()) { + BInstallable bInstallable = (BInstallable)closableCursor.get(); + if (!this.solutionParms.acceptInstallable(bInstallable) || bInstallable.getPart() == null || this.shouldExclude(bInstallable)) continue; + boolean bl = false; + BDependency[] bDependencyArray = bInstallable.getAllDependencies(); + int n = 0; + while (n < bDependencyArray.length) { + Type type = bDependencyArray[n].getPartType(); + if ((type == BArchPart.TYPE || type == BGenericPart.TYPE || type == BModelPart.TYPE || type == BOsPart.TYPE && !this.targetPlatform.getOsPart().isInstallable()) && !this.targetPlatform.meets(bDependencyArray[n])) { + bl = true; + break; + } + ++n; + } + if (bl) continue; + array.add((Object)bInstallable); + if (this.solutionParms.latestOnly) break; + } + } + installableCandidates.set((Object)bDependency, (BInstallable[])array.trim()); + boolean bl = false; + if (array.size() > 0) { + bl = true; + } + return bl; + } + + private final FileTransferMessageElement revertAuthProperties(FileTransferMessageElement fileTransferMessageElement, BDaemonPlatform bDaemonPlatform) throws Exception { + Object object; + BIFile bIFile = bDaemonPlatform.getDaemonSession().getFileSpace().findFile(fileTransferMessageElement.getFilePath()); + boolean bl = false; + Properties properties = new Properties(); + properties.load(fileTransferMessageElement.getStream()); + boolean bl2 = false; + if (properties.remove("authtype") != null || bl) { + bl2 = true; + } + bl = bl2; + boolean bl3 = false; + if (properties.remove("user") != null || bl) { + bl3 = true; + } + bl = bl3; + boolean bl4 = false; + if (properties.remove("usergroupsid") != null || bl) { + bl4 = true; + } + bl = bl4; + boolean bl5 = false; + if (properties.remove("admingroupsid") != null || bl) { + bl5 = true; + } + bl = bl5; + boolean bl6 = false; + if (properties.remove("password") != null || bl) { + bl6 = true; + } + bl = bl6; + boolean bl7 = false; + if (properties.remove("stationIsAdmin") != null || bl) { + bl7 = bl = true; + } + if (bIFile != null) { + object = new Properties(); + ((Properties)object).load(bIFile.getInputStream()); + if (((Properties)object).getProperty("authtype") != null) { + bl = true; + properties.setProperty("authtype", ((Properties)object).getProperty("authtype")); + } + if (((Properties)object).getProperty("user") != null) { + bl = true; + properties.setProperty("user", ((Properties)object).getProperty("user")); + } + if (((Properties)object).getProperty("usergroupsid") != null) { + bl = true; + properties.setProperty("usergroupsid", ((Properties)object).getProperty("usergroupsid")); + } + if (((Properties)object).getProperty("admingroupsid") != null) { + bl = true; + properties.setProperty("admingroupsid", ((Properties)object).getProperty("admingroupsid")); + } + if (((Properties)object).getProperty("password") != null) { + bl = true; + properties.setProperty("password", ((Properties)object).getProperty("password")); + } + if (((Properties)object).getProperty("stationIsAdmin") != null) { + bl = true; + properties.setProperty("stationIsAdmin", ((Properties)object).getProperty("stationIsAdmin")); + } + } + if (bl) { + object = new ByteArrayOutputStream(); + properties.store((OutputStream)object, null); + ((OutputStream)object).flush(); + ((ByteArrayOutputStream)object).close(); + return new ByteArrayFileTransferElement(fileTransferMessageElement.getFilePath(), ((ByteArrayOutputStream)object).toByteArray(), bDaemonPlatform.getDaemonSession().getFileSpace()); + } + return fileTransferMessageElement; + } + + protected void registerLocalInstallables(BInstallable bInstallable) { + if (this.registry == LocalInstallableRegistry.getInstance()) { + try { + bInstallable.registerInstallableResources(this.solutionParms.listener); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + } + + protected void install(BInstallable bInstallable, Object object) throws Exception { + Object object2; + long l = Clock.ticks(); + log.trace("installing " + bInstallable.getInstallableFileName() + " to meet " + object); + Class clazz = class$com$tridium$install$BDependency; + if (clazz == null) { + clazz = class$com$tridium$install$BDependency = InstallScenario.class("[Lcom.tridium.install.BDependency;", false); + } + Array array = new Array(clazz); + this.candidates.removeKey(object); + this.toInstall.add((Object)bInstallable); + this.endStateMutable.add(bInstallable); + this.registerLocalInstallables(bInstallable); + long l2 = bInstallable.getProcessingFlags(this.targetPlatform, this.solutionParms.listener); + if ((l2 & 0x100000L) > 0L) { + this.newModuleContent = bInstallable.getNewModuleContent(); + } + if ((l2 & 0x80000L) > 0L && bInstallable.getTcpIpChanges() != null && !bInstallable.getTcpIpChanges().getIsReadonly()) { + this.tcpIpChanges = bInstallable.getTcpIpChanges(); + } + if ((l2 & 0x200000L) > 0L) { + this.newOsTimeZone = bInstallable.getNewOsTimeZone(); + } + if ((l2 & 0x100000L) > 0L) { + object2 = this.endStateMutable.getModules(); + int n = 0; + while (n < ((BModulePart[])object2).length) { + if (this.newModuleContent.getOrdinal() > object2[n].getArchiveContent().getOrdinal()) { + array.add((Object)BDependency.forPart(object2[n])); + this.endStateMutable.remove(object2[n]); + } + ++n; + } + } + if ((l2 & (long)4) > 0L && (l2 & (long)2) == 0L && (this.processingFlags & (long)2) == 0L && !this.targetPlatform.meets(BAJA_3_5)) { + l2 |= (long)2; + } + this.processingFlags |= l2; + if (bInstallable instanceof BModuleInstallable) { + this.modulesToUninstall.remove(bInstallable.getPart().getPartName()); + } + array.addAll((Object[])bInstallable.getAllDependencies()); + object2 = new HashSet(); + InstallableCandidates installableCandidates = new InstallableCandidates(); + int n = 0; + while (n < array.size()) { + BDependency bDependency = (BDependency)((Object)array.get(n)); + if (!this.endStateFixed.meets(bDependency) && !this.endStateMutable.meets(bDependency)) { + boolean bl = true; + Object[] objectArray = this.candidates.getKeys(); + int n2 = 0; + while (n2 < objectArray.length) { + if (objectArray[n2] instanceof BDependency) { + BDependency bDependency2 = (BDependency)((Object)objectArray[n2]); + BDependency.DependencySync dependencySync = BDependency.sync(bDependency2, bDependency); + if (dependencySync == BDependency.DEP_SYNC_KEEP_SECOND) { + object2.add(bDependency2); + break; + } + if (dependencySync == BDependency.DEP_SYNC_KEEP_FIRST) { + bl = false; + break; + } + if (dependencySync != BDependency.DEP_SYNC_NO_CHANGE && dependencySync != BDependency.DEP_SYNC_CONFLICT) { + object2.add(bDependency2); + bDependency = dependencySync.mergedResult; + break; + } + } + ++n2; + } + if (bl) { + this.addCandidates(bDependency, installableCandidates); + } + } + ++n; + } + Iterator iterator = object2.iterator(); + while (iterator.hasNext()) { + this.candidates.removeKey(iterator.next()); + } + this.candidates.addAll(installableCandidates); + log.trace("install exits " + (Clock.ticks() - l) + "ms"); + } + + public boolean shouldExclude(BInstallable bInstallable) { + boolean bl = false; + if (this.getFailedExclusion(bInstallable) != null) { + bl = true; + } + return bl; + } + + public BDependency getFailedExclusion(BInstallable bInstallable) { + BDependency[] bDependencyArray = bInstallable.getAllExclusions(); + int n = 0; + while (n < bDependencyArray.length) { + if (this.endStateFixed.meets(bDependencyArray[n]) || this.endStateMutable.meets(bDependencyArray[n])) { + return bDependencyArray[n]; + } + ++n; + } + BPart bPart = bInstallable.getPart(); + if (bPart != null) { + int n2 = 0; + while (n2 < this.toInstall.size()) { + bDependencyArray = ((BInstallable)this.toInstall.get(n2)).getAllExclusions(); + int n3 = 0; + while (n3 < bDependencyArray.length) { + if (bPart.meets(bDependencyArray[n3])) { + return bDependencyArray[n3]; + } + ++n3; + } + ++n2; + } + } + return null; + } + + protected void traceState(String string) { + int n; + log.trace(string); + BPart[] bPartArray = this.getParts(); + if (bPartArray.length == 0) { + log.trace(" no parts"); + } else { + log.trace(" parts:"); + n = 0; + while (n < bPartArray.length) { + log.trace(" " + (Object)((Object)bPartArray[n])); + ++n; + } + } + if (this.toInstall.size() == 0 && this.modulesToUninstall.size() == 0) { + log.trace(" no actions"); + } else { + log.trace(" actions:"); + n = 0; + while (n < this.toInstall.size()) { + log.trace(" install " + ((BInstallable)this.toInstall.get(n)).getInstallableFileName()); + ++n; + } + Iterator iterator = this.modulesToUninstall.iterator(); + while (iterator.hasNext()) { + log.trace(" uninstall module " + iterator.next()); + } + } + if (this.candidates.size() == 0) { + log.trace(" no unresolved dependencies"); + } else { + log.trace(" unresolved dependencies:"); + BDependency[] bDependencyArray = this.candidates.getDependencies(); + int n2 = 0; + while (n2 < bDependencyArray.length) { + log.trace(" " + (Object)((Object)bDependencyArray[n2])); + ++n2; + } + } + if (this.excludedInstallables.size() == 0) { + log.trace(" no excluded installables"); + } else { + log.trace(" excluded installables:"); + int n3 = 0; + while (n3 < this.excludedInstallables.size()) { + log.trace(" " + ((BInstallable)this.excludedInstallables.get(n3)).getInstallableFileName()); + ++n3; + } + } + } + + private static final InstallScenario checkModuleForUpgrades(InstallScenario installScenario, BModulePart bModulePart, Map map, InstallableRegistry installableRegistry) throws Exception { + if (map.containsKey(bModulePart.getPartName()) || installScenario.nStandalone > 0) { + return installScenario; + } + BDependency bDependency = BDependency.forPart(bModulePart, BVersionRelation.minimum); + ClosableCursor closableCursor = installableRegistry.getInstallables(bDependency, installScenario.getSolutionParameters().listener); + while (closableCursor.next()) { + Object object; + BModuleInstallable bModuleInstallable = (BModuleInstallable)closableCursor.get(); + if (!((BModulePart)bModuleInstallable.getPart()).isUpgradeFor(bModulePart)) continue; + boolean bl = true; + BDependency[] bDependencyArray = bModuleInstallable.getAllDependencies(); + int n = 0; + while (n < bDependencyArray.length) { + if (map.containsKey(bDependencyArray[n].getPartName())) { + object = (BModulePart)((Object)map.get(bDependencyArray[n].getPartName())); + if (object == null || !object.meets(bDependencyArray[n])) { + bl = false; + break; + } + } else if (!(bDependencyArray[n].canSolveWith(installScenario.getSolutionParameters().solvers) || installScenario.endStateMutable.meets(bDependencyArray[n]) || installScenario.endStateFixed.meets(bDependencyArray[n]))) { + bl = false; + break; + } + ++n; + } + if (bl) { + BInstallable[] bInstallableArray = installScenario.getToInstall(); + object = new BInstallable[bInstallableArray.length + 1]; + object[0] = bModuleInstallable; + System.arraycopy(bInstallableArray, 0, object, 1, bInstallableArray.length); + InstallScenario installScenario2 = new InstallScenario(installScenario.getTargetPlatform(), installScenario.getModulesToUninstall(), installScenario.getUnmetDependencies(), (BInstallable[])object, installScenario.getNewOsTimeZone(), installScenario.getTcpIpChanges(), installScenario.getNewModuleContent(), installScenario.getSolutionParameters(), installableRegistry).solve(); + if (installScenario2.canCommit()) { + map.put(bModulePart.getPartName(), bModuleInstallable.getModulePart()); + return installScenario2; + } + } + if (installScenario.getSolutionParameters().latestOnly) break; + } + closableCursor.close(); + map.put(bModulePart.getPartName(), bModulePart); + return installScenario; + } + + public SolutionParameters getSolutionParameters() { + return this.solutionParms; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.statusByPartSpec = null; + this.newModuleContent = null; + this.tcpIpChanges = null; + this.newOsTimeZone = BTimeZone.NULL; + this.processingFlags = 0L; + this.isSolved = false; + this.nStandalone = 0; + } + + public InstallScenario(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener, String[] stringArray, BDependency[] bDependencyArray, BInstallable[] bInstallableArray, InstallableRegistry installableRegistry) throws Exception { + this(bDaemonPlatform, stringArray, bDependencyArray, bInstallableArray, BTimeZone.NULL, null, null, new SolutionParameters(daemonSessionTaskListener), installableRegistry); + } + + public InstallScenario(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener, String[] stringArray, BDependency[] bDependencyArray, BInstallable[] bInstallableArray, BTimeZone bTimeZone, BTcpIpHostSettings bTcpIpHostSettings, BModuleContent bModuleContent, InstallableRegistry installableRegistry) throws Exception { + this(bDaemonPlatform, stringArray, bDependencyArray, bInstallableArray, bTimeZone, bTcpIpHostSettings, bModuleContent, new SolutionParameters(daemonSessionTaskListener), installableRegistry); + } + + /* + * Unable to fully structure code + */ + public InstallScenario(BDaemonPlatform var1_1, String[] var2_2, BDependency[] var3_3, BInstallable[] var4_4, BTimeZone var5_5, BTcpIpHostSettings var6_6, BModuleContent var7_7, SolutionParameters var8_8, InstallableRegistry var9_9) throws Exception { + block27: { + block26: { + super(); + this.this(); + this.registry = var9_9; + this.solutionParms = var8_8; + if (var8_8 == null) { + throw new IllegalArgumentException("solutionParms may not be null"); + } + this.targetPlatform = var1_1; + this.newOsTimeZone = var5_5 == null ? BTimeZone.NULL : var5_5; + this.tcpIpChanges = var6_6; + this.newModuleContent = var7_7; + if (var1_1 != null) { + var1_1.checkSession(var8_8.listener); + var1_1.getModuleList().init(var8_8.listener); + if (var7_7 != null && var7_7 != var1_1.getModuleContent()) { + this.processingFlags |= 0x100000L; + } + } + this.endStateFixed = new HostState(); + if (var1_1 == null) break block26; + this.endStateFixed.add(var1_1.getArchPart()); + this.endStateFixed.add(var1_1.getBrandPart()); + this.endStateFixed.add(var1_1.getModelPart()); + var10_10 = var1_1.getOtherParts().getProperties(); + if (true) ** GOTO lbl25 + do { + this.endStateFixed.add((BPart)var10_10.get()); +lbl25: + // 2 sources + + if ((v0 = InstallScenario.class$com$tridium$install$part$BPart) != null) continue; + v0 = InstallScenario.class("[Lcom.tridium.install.part.BPart;", false); + } while (var10_10.next(v0)); + } + this.endStateMutable = new HostState(); + if (var1_1 == null) break block27; + this.endStateMutable.add(var1_1.getOsPart()); + this.endStateMutable.add(var1_1.getNrePart()); + this.endStateMutable.add(var1_1.getVmPart()); + var10_10 = var1_1.getModuleList().getModules().getProperties(); + if (true) ** GOTO lbl38 + do { + this.endStateMutable.add((BModuleInstallable)var10_10.get()); +lbl38: + // 2 sources + + if ((v1 = InstallScenario.class$com$tridium$install$installable$BModuleInstallable) != null) continue; + v1 = InstallScenario.class("[Lcom.tridium.install.installable.BModuleInstallable;", false); + } while (var10_10.next(v1)); + } + this.modulesToUninstall = new TreeSet(); + if (var2_2 != null) { + var10_11 = 0; + while (var10_11 < var2_2.length) { + this.processingFlags |= (long)2; + this.endStateMutable.remove(var2_2[var10_11]); + this.modulesToUninstall.add(var2_2[var10_11]); + ++var10_11; + } + } + if (var3_3 == null) { + v2 = InstallScenario.class$com$tridium$install$BDependency; + if (v2 == null) { + v2 = InstallScenario.class$com$tridium$install$BDependency = InstallScenario.class("[Lcom.tridium.install.BDependency;", false); + } + var10_12 = new Array(v2); + } else { + var10_12 = new Array((Object[])var3_3); + } + if ((v3 = InstallScenario.class$com$tridium$install$installable$BInstallable) == null) { + v3 = InstallScenario.class$com$tridium$install$installable$BInstallable = InstallScenario.class("[Lcom.tridium.install.installable.BInstallable;", false); + } + this.toInstall = new Array(v3); + v4 = InstallScenario.class$com$tridium$install$installable$BInstallable; + if (v4 == null) { + v4 = InstallScenario.class$com$tridium$install$installable$BInstallable = InstallScenario.class("[Lcom.tridium.install.installable.BInstallable;", false); + } + this.excludedInstallables = new Array(v4); + this.nStandalone = 0; + if (var4_4 != null) { + var11_13 = 0; + while (var11_13 < var4_4.length) { + if (this.shouldExclude(var4_4[var11_13])) { + this.excludedInstallables.add((Object)var4_4[var11_13]); + } else { + if (var4_4[var11_13].getIsStandalone()) { + ++this.nStandalone; + } + this.toInstall.add((Object)var4_4[var11_13]); + var12_16 = var4_4[var11_13].getProcessingFlags(var1_1, var8_8.listener); + if ((var12_16 & 0x100000L) > 0L) { + this.newModuleContent = var4_4[var11_13].getNewModuleContent(); + } + if ((var12_16 & 524288L) > 0L && var4_4[var11_13].getTcpIpChanges() != null && !var4_4[var11_13].getTcpIpChanges().getIsReadonly()) { + this.tcpIpChanges = var4_4[var11_13].getTcpIpChanges(); + } + if ((var12_16 & 0x200000L) > 0L) { + this.newOsTimeZone = var4_4[var11_13].getNewOsTimeZone(); + } + if ((var12_16 & (long)4) > 0L && (var12_16 & (long)2) == 0L && (this.processingFlags & (long)2) == 0L && !var1_1.meets(InstallScenario.BAJA_3_5)) { + var12_16 |= (long)2; + } + this.processingFlags |= var12_16; + this.endStateMutable.add(var4_4[var11_13]); + this.registerLocalInstallables(var4_4[var11_13]); + var10_12.addAll((Object[])var4_4[var11_13].getAllDependencies()); + } + ++var11_13; + } + } + if ((this.processingFlags & 0x100000L) > 0L) { + var11_14 = this.endStateMutable.getModules(); + var12_17 = 0; + while (var12_17 < var11_14.length) { + if (this.newModuleContent.getOrdinal() > var11_14[var12_17].getArchiveContent().getOrdinal()) { + var10_12.add((Object)BDependency.forPart(var11_14[var12_17])); + this.endStateMutable.remove(var11_14[var12_17]); + } + ++var12_17; + } + } + var10_12 = new Array((Object[])BDependency.merge((BDependency[])var10_12.trim())); + this.candidates = new InstallableCandidates(); + var11_15 = 0; + while (var11_15 < var10_12.size()) { + var12_19 = (BDependency)var10_12.get(var11_15); + if (!this.endStateFixed.meets(var12_19) && !this.endStateMutable.meets(var12_19)) { + this.addCandidates(var12_19); + } + ++var11_15; + } + this.traceState("Initial state"); + } + + protected InstallScenario(BDaemonPlatform bDaemonPlatform, Array array, Array array2, Set set, HostState hostState, HostState hostState2, InstallableCandidates installableCandidates, BModuleContent bModuleContent, BTcpIpHostSettings bTcpIpHostSettings, BTimeZone bTimeZone, long l, SolutionParameters solutionParameters, InstallableRegistry installableRegistry) { + this.this(); + this.targetPlatform = bDaemonPlatform; + this.toInstall = array; + this.excludedInstallables = array2; + this.modulesToUninstall = set; + this.endStateFixed = hostState; + this.endStateMutable = hostState2; + this.candidates = installableCandidates; + this.registry = installableRegistry; + this.newModuleContent = bModuleContent; + this.tcpIpChanges = bTcpIpHostSettings; + this.solutionParms = solutionParameters; + this.newOsTimeZone = bTimeZone == null ? BTimeZone.NULL : bTimeZone; + this.processingFlags = l; + this.nStandalone = 0; + int n = 0; + while (n < array.size()) { + if (((BInstallable)array.get(n)).getIsStandalone()) { + ++this.nStandalone; + } + ++n; + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public static class HostState { + private Map partsByType; + static /* synthetic */ Class class$com$tridium$install$part$BPart; + + public HostState copy() { + HostState hostState = new HostState(); + Iterator iterator = this.partsByType.keySet().iterator(); + while (iterator.hasNext()) { + BTypeSpec bTypeSpec = (BTypeSpec)iterator.next(); + if (this.isUniquePartType(bTypeSpec)) { + hostState.add((BPart)((Object)this.partsByType.get(bTypeSpec))); + continue; + } + Map map = (Map)this.partsByType.get(bTypeSpec); + Iterator iterator2 = map.values().iterator(); + while (iterator2.hasNext()) { + hostState.add((BPart)((Object)iterator2.next())); + } + } + return hostState; + } + + public void add(BInstallable bInstallable) { + BPart bPart = bInstallable.getPart(); + if (bPart != null) { + this.add(bPart); + } + } + + public void add(BPart bPart) { + if (bPart != null) { + if (this.isUniquePartType(bPart.getType().getTypeSpec())) { + this.partsByType.put(bPart.getType().getTypeSpec(), bPart); + } else { + HashMap hashMap = (HashMap)this.partsByType.get(bPart.getType().getTypeSpec()); + if (hashMap == null) { + hashMap = new HashMap(); + this.partsByType.put(bPart.getType().getTypeSpec(), hashMap); + } + hashMap.put(bPart.getPartName(), bPart); + } + } + } + + public void remove(BInstallable bInstallable) { + if (bInstallable != null) { + this.remove(bInstallable.getPart()); + } + } + + public void remove(BPart bPart) { + if (bPart != null) { + if (this.isUniquePartType(bPart.getType().getTypeSpec())) { + BPart bPart2 = (BPart)((Object)this.partsByType.get(bPart.getType().getTypeSpec())); + if (bPart2 != null && bPart2.equivalent((Object)bPart)) { + this.partsByType.remove(bPart.getType().getTypeSpec()); + } + } else { + Map map = (Map)this.partsByType.get(bPart.getType().getTypeSpec()); + if (map != null) { + map.remove(bPart.getPartName()); + } + } + } + } + + public void remove(String string) { + Iterator iterator = this.partsByType.keySet().iterator(); + while (iterator.hasNext()) { + Object object; + BTypeSpec bTypeSpec = (BTypeSpec)iterator.next(); + if (this.isUniquePartType(bTypeSpec)) { + object = (BPart)((Object)this.partsByType.get(bTypeSpec)); + if (!object.getPartName().equals(string)) continue; + this.partsByType.remove(bTypeSpec); + return; + } + object = (Map)this.partsByType.get(bTypeSpec); + if (object.remove(string) == null) continue; + return; + } + } + + public boolean meets(BDependency bDependency) { + if (this.isUniquePartType(bDependency.getPartTypeSpec())) { + BPart bPart = (BPart)((Object)this.partsByType.get(bDependency.getPartTypeSpec())); + boolean bl = false; + if (bPart != null && bPart.meets(bDependency)) { + bl = true; + } + return bl; + } + Map map = (Map)this.partsByType.get(bDependency.getPartTypeSpec()); + if (map != null) { + if (BPart.isWildcardName(bDependency.getPartName())) { + Iterator iterator = map.values().iterator(); + while (iterator.hasNext()) { + BPart bPart = (BPart)((Object)iterator.next()); + if (!bPart.meets(bDependency)) continue; + return true; + } + } else { + BPart bPart = (BPart)((Object)map.get(bDependency.getPartName())); + if (bPart != null && bPart.meets(bDependency)) { + return true; + } + } + } + return false; + } + + public BModulePart[] getModules() { + Map map = (Map)this.partsByType.get(BModulePart.TYPE.getTypeSpec()); + if (map == null) { + return new BModulePart[0]; + } + BModulePart[] bModulePartArray = new BModulePart[map.size()]; + int n = 0; + Iterator iterator = map.values().iterator(); + while (iterator.hasNext()) { + bModulePartArray[n++] = (BModulePart)((Object)iterator.next()); + } + return bModulePartArray; + } + + private final boolean isUniquePartType(BTypeSpec bTypeSpec) { + boolean bl = false; + if (!bTypeSpec.equals((Object)BModulePart.TYPE.getTypeSpec()) && (bTypeSpec.equals((Object)BArchPart.TYPE.getTypeSpec()) || bTypeSpec.equals((Object)BOsPart.TYPE.getTypeSpec()) || bTypeSpec.equals((Object)BNrePart.TYPE.getTypeSpec()) || bTypeSpec.equals((Object)BBrandPart.TYPE.getTypeSpec()) || bTypeSpec.equals((Object)BVmPart.TYPE.getTypeSpec()) || bTypeSpec.equals((Object)BModelPart.TYPE.getTypeSpec()))) { + bl = true; + } + return bl; + } + + public BPart[] getParts() { + Class clazz = class$com$tridium$install$part$BPart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BPart = HostState.class("[Lcom.tridium.install.part.BPart;", false); + } + Array array = new Array(clazz); + Iterator iterator = this.partsByType.keySet().iterator(); + while (iterator.hasNext()) { + BTypeSpec bTypeSpec = (BTypeSpec)iterator.next(); + if (this.isUniquePartType(bTypeSpec)) { + array.add(this.partsByType.get(bTypeSpec)); + continue; + } + Map map = (Map)this.partsByType.get(bTypeSpec); + array.addAll(map.values()); + } + return (BPart[])array.trim(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.partsByType = new HashMap(); + } + + public HostState() { + this.this(); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class UpdateModuleContentMessage + extends XmlResponseMessage { + private BModuleContent flag; + + public String getMessageString() { + return "updatedaemon?installFlag=" + this.flag.getTag(); + } + + public UpdateModuleContentMessage(BModuleContent bModuleContent) { + this.flag = bModuleContent; + } + } +} + diff --git a/modules/cfr_output/com/tridium/install/InstallableCandidates.java b/modules/cfr_output/com/tridium/install/InstallableCandidates.java new file mode 100644 index 0000000..19d6715 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/InstallableCandidates.java @@ -0,0 +1,367 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nre.util.Array + * javax.baja.sys.BInteger + */ +package com.tridium.install; + +import com.tridium.install.BDependency; +import com.tridium.install.InstallScenario; +import com.tridium.install.InstallableFilter; +import com.tridium.install.PartSpec; +import com.tridium.install.UnmeetableDependency; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.part.BModulePart; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.TreeMap; +import java.util.TreeSet; +import javax.baja.nre.util.Array; +import javax.baja.sys.BInteger; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class InstallableCandidates { + protected static final Comparator CANDIDATE_KEY_COMPARATOR = new Comparator(){ + + public final int compare(Object object, Object object2) { + if (object instanceof BDependency) { + if (object2 instanceof BDependency) { + return BDependency.COMPARATOR.compare(object, object2); + } + return 1; + } + if (object2 instanceof BDependency) { + return -1; + } + return object.toString().compareTo(object2.toString()); + } + }; + private Map candidatesByKey; + private Map keyByNumCandidates; + private Map unmeetableDependencyByPartSpec; + static /* synthetic */ Class class$com$tridium$install$BDependency; + static /* synthetic */ Class class$com$tridium$install$installable$BInstallable; + + public void addAll(InstallableCandidates installableCandidates) { + if (installableCandidates == null) { + return; + } + Object[] objectArray = installableCandidates.getKeys(); + int n = 0; + while (n < objectArray.length) { + TreeSet treeSet; + BInteger bInteger; + Object[] objectArray2 = installableCandidates.getCandidates(objectArray[n]); + Array array = (Array)this.candidatesByKey.get(objectArray[n]); + if (array == null) { + array = new Array(objectArray2); + this.candidatesByKey.put(objectArray[n], array); + } else { + bInteger = BInteger.make((int)array.size()); + treeSet = (TreeSet)this.keyByNumCandidates.get(bInteger); + treeSet.remove(objectArray[n]); + if (treeSet.size() == 0) { + this.keyByNumCandidates.remove(bInteger); + } + array.addAll(objectArray2); + } + bInteger = BInteger.make((int)array.size()); + treeSet = (TreeSet)this.keyByNumCandidates.get(bInteger); + if (treeSet == null) { + treeSet = new TreeSet(CANDIDATE_KEY_COMPARATOR); + this.keyByNumCandidates.put(bInteger, treeSet); + } + treeSet.add(objectArray[n]); + ++n; + } + } + + public InstallableCandidates newCopy() { + InstallableCandidates installableCandidates = new InstallableCandidates(); + Iterator iterator = this.candidatesByKey.keySet().iterator(); + while (iterator.hasNext()) { + Object k = iterator.next(); + Array array = (Array)this.candidatesByKey.get(k); + installableCandidates.candidatesByKey.put(k, array.copy()); + BInteger bInteger = BInteger.make((int)array.size()); + TreeSet treeSet = (TreeSet)installableCandidates.keyByNumCandidates.get(bInteger); + if (treeSet == null) { + treeSet = new TreeSet(CANDIDATE_KEY_COMPARATOR); + installableCandidates.keyByNumCandidates.put(bInteger, treeSet); + } + treeSet.add(k); + } + return installableCandidates; + } + + public int size() { + return this.candidatesByKey.size(); + } + + public String toString() { + return this.candidatesByKey.toString(); + } + + public boolean isDependencyUnsolvable(BDependency bDependency, InstallScenario installScenario) { + UnmeetableDependency unmeetableDependency = this.getUnmeetableDependency(bDependency.getPartSpec(), installScenario); + boolean bl = false; + if (unmeetableDependency != null) { + bl = unmeetableDependency.isUnsolvable; + } + return bl; + } + + public BDependency getFailedExclusion(BDependency bDependency, InstallScenario installScenario) { + UnmeetableDependency unmeetableDependency = this.getUnmeetableDependency(bDependency.getPartSpec(), installScenario); + return unmeetableDependency == null ? null : unmeetableDependency.failedExclusion; + } + + public InstallableFilter getFailedFilter(BDependency bDependency, InstallScenario installScenario) { + UnmeetableDependency unmeetableDependency = this.getUnmeetableDependency(bDependency.getPartSpec(), installScenario); + return unmeetableDependency == null ? null : unmeetableDependency.failedFilter; + } + + public boolean installableNotFound(BDependency bDependency, InstallScenario installScenario) { + UnmeetableDependency unmeetableDependency = this.getUnmeetableDependency(bDependency.getPartSpec(), installScenario); + boolean bl = true; + if (unmeetableDependency != null) { + bl = unmeetableDependency.isSoftwareNotFound; + } + return bl; + } + + public UnmeetableDependency getUnmeetableDependency(PartSpec partSpec, InstallScenario installScenario) { + this.getUnmeetableDependencies(installScenario); + return (UnmeetableDependency)this.unmeetableDependencyByPartSpec.get(partSpec); + } + + public UnmeetableDependency[] getUnmeetableDependencies(InstallScenario installScenario) { + if (installScenario.isSolved()) { + if (this.unmeetableDependencyByPartSpec == null) { + this.unmeetableDependencyByPartSpec = new HashMap(); + Iterator iterator = this.candidatesByKey.keySet().iterator(); + while (iterator.hasNext()) { + Object k = iterator.next(); + if (!(k instanceof BDependency)) continue; + BDependency bDependency = (BDependency)((Object)k); + boolean bl = installScenario.getTargetPlatform().meets(bDependency); + if (bl && bDependency.getPartType() == BModulePart.TYPE && installScenario.getNewModuleContent() != null && installScenario.getNewModuleContent().getOrdinal() > ((BModulePart)installScenario.getTargetPlatform().getPart(bDependency)).getArchiveContent().getOrdinal()) { + bl = false; + } + if (bl) continue; + if (bDependency.canSolveWith(installScenario.getSolutionParameters().solvers)) { + Object object; + try { + Object object2; + boolean bl2 = false; + object = installScenario.getInstallableRegistry().getInstallables(bDependency, installScenario.getSolutionParameters().listener); + Object object3 = null; + while (object.next()) { + object2 = (BInstallable)object.get(); + BDependency bDependency2 = installScenario.getFailedExclusion((BInstallable)object2); + if (bDependency2 == null) { + InstallableFilter installableFilter = installScenario.getSolutionParameters().getFailedFilter((BInstallable)object2); + if (installableFilter == null) { + bl2 = true; + break; + } + if (object3 != null) continue; + object3 = installableFilter; + continue; + } + if (object3 != null) continue; + object3 = bDependency2; + } + try { + object.close(); + } + catch (Exception exception) {} + if (bl2) continue; + object2 = (UnmeetableDependency)this.unmeetableDependencyByPartSpec.get(bDependency.getPartSpec()); + if (object2 == null) { + object2 = new UnmeetableDependency(bDependency); + this.unmeetableDependencyByPartSpec.put(bDependency.getPartSpec(), object2); + } + if (object3 == null) { + ((UnmeetableDependency)object2).isSoftwareNotFound = true; + continue; + } + if (object3 instanceof BDependency) { + ((UnmeetableDependency)object2).failedExclusion = object3; + } else { + ((UnmeetableDependency)object2).failedFilter = (InstallableFilter)object3; + } + this.unmeetableDependencyByPartSpec.put(bDependency.getPartSpec(), object2); + } + catch (Exception exception) { + object = (UnmeetableDependency)this.unmeetableDependencyByPartSpec.get(bDependency.getPartSpec()); + if (object == null) { + object = new UnmeetableDependency(bDependency); + this.unmeetableDependencyByPartSpec.put(bDependency.getPartSpec(), object); + } + ((UnmeetableDependency)object).isSoftwareNotFound = true; + } + continue; + } + UnmeetableDependency unmeetableDependency = (UnmeetableDependency)this.unmeetableDependencyByPartSpec.get(bDependency.getPartSpec()); + if (unmeetableDependency == null) { + unmeetableDependency = new UnmeetableDependency(bDependency); + this.unmeetableDependencyByPartSpec.put(bDependency.getPartSpec(), unmeetableDependency); + } + unmeetableDependency.isUnsolvable = true; + } + } + return this.unmeetableDependencyByPartSpec.values().toArray(new UnmeetableDependency[this.unmeetableDependencyByPartSpec.size()]); + } + throw new IllegalStateException("Cannot call getUnavailableDependencies() on a scenario that has not been solved"); + } + + public BDependency[] getDependencies() { + Class clazz = class$com$tridium$install$BDependency; + if (clazz == null) { + clazz = class$com$tridium$install$BDependency = InstallableCandidates.class("[Lcom.tridium.install.BDependency;", false); + } + Array array = new Array(clazz); + Iterator iterator = this.candidatesByKey.keySet().iterator(); + while (iterator.hasNext()) { + Object k = iterator.next(); + if (!(k instanceof BDependency)) continue; + array.add(k); + } + return (BDependency[])array.trim(); + } + + public Object[] getKeys() { + return this.candidatesByKey.keySet().toArray(); + } + + public boolean containsKey(Object object) { + return this.candidatesByKey.containsKey(object); + } + + public void addKey(Object object) { + this.add(object, null); + } + + public void add(Object object, BInstallable bInstallable) { + TreeSet treeSet; + BInteger bInteger; + Array array = (Array)this.candidatesByKey.get(object); + if (array == null) { + if (bInstallable == null) { + Class clazz = class$com$tridium$install$installable$BInstallable; + if (clazz == null) { + clazz = class$com$tridium$install$installable$BInstallable = InstallableCandidates.class("[Lcom.tridium.install.installable.BInstallable;", false); + } + array = new Array(clazz); + } else { + array = new Array((Object[])new BInstallable[]{bInstallable}); + } + this.candidatesByKey.put(object, array); + } else { + bInteger = BInteger.make((int)array.size()); + treeSet = (TreeSet)this.keyByNumCandidates.get(bInteger); + treeSet.remove(object); + if (treeSet.size() == 0) { + this.keyByNumCandidates.remove(bInteger); + } + if (bInstallable != null) { + array.add((Object)bInstallable); + } + } + bInteger = BInteger.make((int)array.size()); + treeSet = (TreeSet)this.keyByNumCandidates.get(bInteger); + if (treeSet == null) { + treeSet = new TreeSet(CANDIDATE_KEY_COMPARATOR); + this.keyByNumCandidates.put(bInteger, treeSet); + } + treeSet.add(object); + } + + public void set(Object object, BInstallable[] bInstallableArray) { + TreeSet treeSet; + BInteger bInteger; + Array array = (Array)this.candidatesByKey.get(object); + if (array != null) { + bInteger = BInteger.make((int)array.size()); + treeSet = (TreeSet)this.keyByNumCandidates.get(bInteger); + treeSet.remove(object); + if (treeSet.size() == 0) { + this.keyByNumCandidates.remove(bInteger); + } + } + Array array2 = new Array((Object[])bInstallableArray); + this.candidatesByKey.put(object, array2); + bInteger = BInteger.make((int)array2.size()); + treeSet = (TreeSet)this.keyByNumCandidates.get(bInteger); + if (treeSet == null) { + treeSet = new TreeSet(CANDIDATE_KEY_COMPARATOR); + this.keyByNumCandidates.put(bInteger, treeSet); + } + treeSet.add(object); + } + + public void removeKey(Object object) { + Array array = (Array)this.candidatesByKey.get(object); + if (array != null) { + BInteger bInteger = BInteger.make((int)array.size()); + TreeSet treeSet = (TreeSet)this.keyByNumCandidates.get(bInteger); + if (treeSet != null) { + treeSet.remove(object); + if (treeSet.size() == 0) { + this.keyByNumCandidates.remove(bInteger); + } + } + this.candidatesByKey.remove(object); + } + } + + public Object getFirstKey() { + Iterator iterator = this.keyByNumCandidates.values().iterator(); + while (iterator.hasNext()) { + TreeSet treeSet = (TreeSet)iterator.next(); + Iterator iterator2 = treeSet.iterator(); + if (!iterator2.hasNext()) continue; + return iterator2.next(); + } + return null; + } + + public BInstallable[] getCandidates(Object object) { + Array array = (Array)this.candidatesByKey.get(object); + if (array == null) { + return new BInstallable[0]; + } + return (BInstallable[])array.trim(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.unmeetableDependencyByPartSpec = null; + } + + public InstallableCandidates() { + this.this(); + this.candidatesByKey = new TreeMap(CANDIDATE_KEY_COMPARATOR); + this.keyByNumCandidates = new TreeMap(); + } +} + diff --git a/modules/cfr_output/com/tridium/install/InstallableFilter.java b/modules/cfr_output/com/tridium/install/InstallableFilter.java new file mode 100644 index 0000000..7fc7176 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/InstallableFilter.java @@ -0,0 +1,11 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.install; + +import com.tridium.install.installable.BInstallable; + +public interface InstallableFilter { + public boolean acceptInstallable(BInstallable var1); +} + diff --git a/modules/cfr_output/com/tridium/install/PartSpec.java b/modules/cfr_output/com/tridium/install/PartSpec.java new file mode 100644 index 0000000..d9939d8 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/PartSpec.java @@ -0,0 +1,69 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.Type + * javax.baja.util.BTypeSpec + */ +package com.tridium.install; + +import com.tridium.install.part.BModulePart; +import javax.baja.sys.Type; +import javax.baja.util.BTypeSpec; + +public class PartSpec +implements Comparable { + private String spec; + private String partName; + private BTypeSpec partType; + + public static PartSpec forModule(String string) { + return new PartSpec(string, BModulePart.TYPE); + } + + public String getPartName() { + return this.partName; + } + + public BTypeSpec getPartType() { + return this.partType; + } + + public boolean equals(Object object) { + boolean bl = false; + if (object instanceof PartSpec && ((PartSpec)object).spec.equals(this.spec)) { + bl = true; + } + return bl; + } + + public String toString() { + return this.spec; + } + + public int hashCode() { + return this.spec.hashCode(); + } + + public int compareTo(Object object) { + if (this == object) { + return 0; + } + PartSpec partSpec = (PartSpec)object; + if (this.getPartType().equals((Object)partSpec.getPartType())) { + return this.getPartName().compareTo(partSpec.getPartName()); + } + return this.getPartType().toString().compareTo(partSpec.getPartType().toString()); + } + + public PartSpec(String string, Type type) { + this(string, type.getTypeSpec()); + } + + public PartSpec(String string, BTypeSpec bTypeSpec) { + this.spec = string + ':' + bTypeSpec.toString(); + this.partName = string; + this.partType = bTypeSpec; + } +} + diff --git a/modules/cfr_output/com/tridium/install/SolutionParameters.java b/modules/cfr_output/com/tridium/install/SolutionParameters.java new file mode 100644 index 0000000..5a1a1ec --- /dev/null +++ b/modules/cfr_output/com/tridium/install/SolutionParameters.java @@ -0,0 +1,84 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.install; + +import com.tridium.install.BDependency; +import com.tridium.install.InstallScenario; +import com.tridium.install.InstallableCandidates; +import com.tridium.install.InstallableFilter; +import com.tridium.install.installable.BInstallable; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class SolutionParameters { + public DaemonSessionTaskListener listener; + public boolean latestOnly; + public String[] solvers; + public InstallableFilter[] installableFilters; + + public InstallableFilter getFailedFilter(BInstallable bInstallable) { + int n = 0; + while (n < this.installableFilters.length) { + if (!this.installableFilters[n].acceptInstallable(bInstallable)) { + return this.installableFilters[n]; + } + ++n; + } + return null; + } + + public boolean acceptInstallable(BInstallable bInstallable) { + boolean bl = false; + if (this.getFailedFilter(bInstallable) == null) { + bl = true; + } + return bl; + } + + public void addFilter(InstallableFilter installableFilter) { + InstallableFilter[] installableFilterArray = new InstallableFilter[this.installableFilters.length + 1]; + System.arraycopy(this.installableFilters, 0, installableFilterArray, 0, this.installableFilters.length); + installableFilterArray[this.installableFilters.length] = installableFilter; + this.installableFilters = installableFilterArray; + } + + public SolutionParameters newCopy() { + SolutionParameters solutionParameters = new SolutionParameters(this.listener); + solutionParameters.latestOnly = this.latestOnly; + solutionParameters.installableFilters = new InstallableFilter[this.installableFilters.length]; + System.arraycopy(this.installableFilters, 0, solutionParameters.installableFilters, 0, this.installableFilters.length); + solutionParameters.solvers = new String[this.solvers.length]; + System.arraycopy(this.solvers, 0, solutionParameters.solvers, 0, this.solvers.length); + return solutionParameters; + } + + public InstallableCandidates getAdditionalCandidates(InstallScenario installScenario, BDependency bDependency) throws Exception { + return new InstallableCandidates(); + } + + private final /* synthetic */ void this() { + this.latestOnly = false; + this.solvers = new String[]{"default"}; + this.installableFilters = new InstallableFilter[0]; + } + + public SolutionParameters(DaemonSessionTaskListener daemonSessionTaskListener) { + this.this(); + this.listener = daemonSessionTaskListener; + } + + public SolutionParameters(DaemonSessionTaskListener daemonSessionTaskListener, boolean bl, String string) { + this(daemonSessionTaskListener, bl, new String[]{string}); + } + + public SolutionParameters(DaemonSessionTaskListener daemonSessionTaskListener, boolean bl, String[] stringArray) { + this.this(); + this.listener = daemonSessionTaskListener; + this.latestOnly = bl; + this.solvers = stringArray; + } +} + diff --git a/modules/cfr_output/com/tridium/install/UnmeetableDependency.java b/modules/cfr_output/com/tridium/install/UnmeetableDependency.java new file mode 100644 index 0000000..92a9420 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/UnmeetableDependency.java @@ -0,0 +1,60 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.data.BIDataValue + * javax.baja.gx.BImage + * javax.baja.sys.BFacets + * javax.baja.sys.BIcon + * javax.baja.sys.BasicContext + * javax.baja.sys.Context + */ +package com.tridium.install; + +import com.tridium.install.BDependency; +import com.tridium.install.InstallableFilter; +import javax.baja.data.BIDataValue; +import javax.baja.gx.BImage; +import javax.baja.sys.BFacets; +import javax.baja.sys.BIcon; +import javax.baja.sys.BasicContext; +import javax.baja.sys.Context; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class UnmeetableDependency { + public BDependency dependency; + public boolean isUnsolvable; + public boolean isSoftwareNotFound; + public BDependency failedExclusion; + public InstallableFilter failedFilter; + + public String toString() { + return this.toString(null); + } + + public String toString(Context context) { + if (this.failedExclusion == null) { + return this.dependency.toString(context); + } + return this.dependency.toString((Context)new BasicContext(context, BFacets.make((String)"exclusion", (BIDataValue)this.failedExclusion))); + } + + public BImage getIcon() { + return BImage.make((BIcon)this.dependency.getIcon()); + } + + private final /* synthetic */ void this() { + this.isUnsolvable = false; + this.isSoftwareNotFound = false; + this.failedExclusion = null; + this.failedFilter = null; + } + + public UnmeetableDependency(BDependency bDependency) { + this.this(); + this.dependency = bDependency; + } +} + diff --git a/modules/cfr_output/com/tridium/install/installable/BByteInstallable.java b/modules/cfr_output/com/tridium/install/installable/BByteInstallable.java new file mode 100644 index 0000000..05db26e --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/BByteInstallable.java @@ -0,0 +1,117 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.FilePath + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.install.installable; + +import com.tridium.install.BDaemonPlatform; +import com.tridium.install.installable.BInstallable; +import com.tridium.platform.daemon.file.StoreCache; +import com.tridium.platform.daemon.message.ByteArrayFileTransferElement; +import com.tridium.platform.daemon.message.FileTransferMessageElement; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import javax.baja.file.FilePath; +import javax.baja.platform.ICancelHint; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BByteInstallable +extends BInstallable { + public static final Property destinationDirPathBody = BByteInstallable.newProperty((int)0, (String)"!", null); + public static final Property contents = BByteInstallable.newProperty((int)0, (String)"", null); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$install$installable$BByteInstallable; + + public String getDestinationDirPathBody() { + return this.getString(destinationDirPathBody); + } + + public void setDestinationDirPathBody(String string) { + this.setString(destinationDirPathBody, string, null); + } + + public String getContents() { + return this.getString(contents); + } + + public void setContents(String string) { + this.setString(contents, string, null); + } + + public Type getType() { + return TYPE; + } + + public void close() { + } + + public FileTransferMessageElement[] getTransferElements(BDaemonPlatform bDaemonPlatform, StoreCache storeCache, ICancelHint iCancelHint, DaemonSessionTaskListener daemonSessionTaskListener) { + return new FileTransferMessageElement[]{new ByteArrayFileTransferElement(new FilePath(this.getDestinationDirPathBody()), this.getContents().getBytes(), bDaemonPlatform.getDaemonSession().getFileSpace())}; + } + + public long getProcessingFlags(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener) { + return 0L; + } + + public boolean equivalent(Object object) { + if (object instanceof BByteInstallable) { + BByteInstallable bByteInstallable = (BByteInstallable)object; + boolean bl = false; + if (bByteInstallable.getDestinationDirPathBody().equals(this.getDestinationDirPathBody()) && bByteInstallable.getContents().equals(this.getContents())) { + bl = true; + } + return bl; + } + return false; + } + + public BInstallable makeLocalInstance() { + return this; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BByteInstallable() { + } + + public BByteInstallable(FilePath filePath, byte[] byArray) { + this.setDestinationDirPathBody(filePath.getBody()); + this.setContents(new String(byArray)); + this.setInstallableName(filePath.getBody()); + } + + public BByteInstallable(FilePath filePath, String string) { + this.setDestinationDirPathBody(filePath.getBody()); + this.setContents(string); + this.setInstallableName(filePath.getBody()); + } + + static { + Class clazz = class$com$tridium$install$installable$BByteInstallable; + if (clazz == null) { + clazz = class$com$tridium$install$installable$BByteInstallable = BByteInstallable.class("[Lcom.tridium.install.installable.BByteInstallable;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/install/installable/BDeleteFileInstallable.java b/modules/cfr_output/com/tridium/install/installable/BDeleteFileInstallable.java new file mode 100644 index 0000000..f96568f --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/BDeleteFileInstallable.java @@ -0,0 +1,127 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BIFile + * javax.baja.file.FilePath + * javax.baja.naming.BOrd + * javax.baja.naming.OrdQuery + * javax.baja.sys.BIcon + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.install.installable; + +import com.tridium.install.BDaemonPlatform; +import com.tridium.install.installable.BInstallable; +import com.tridium.platform.daemon.file.StoreCache; +import com.tridium.platform.daemon.message.DeleteFileTransferMessageElement; +import com.tridium.platform.daemon.message.FileTransferMessageElement; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import javax.baja.file.BIFile; +import javax.baja.file.FilePath; +import javax.baja.naming.BOrd; +import javax.baja.naming.OrdQuery; +import javax.baja.platform.ICancelHint; +import javax.baja.sys.BIcon; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BDeleteFileInstallable +extends BInstallable { + public static final Type TYPE; + private static final BIcon icon; + private boolean localInstance; + static /* synthetic */ Class class$com$tridium$install$installable$BDeleteFileInstallable; + + public Type getType() { + return TYPE; + } + + public void close() { + } + + public FileTransferMessageElement[] getTransferElements(BDaemonPlatform bDaemonPlatform, StoreCache storeCache, ICancelHint iCancelHint, DaemonSessionTaskListener daemonSessionTaskListener) { + if (!this.localInstance) { + throw new IllegalStateException("illegal call on proxy instance of BDeleteFileInstallable"); + } + if (this.getInstallableFileOrd().isNull()) { + return new FileTransferMessageElement[0]; + } + OrdQuery[] ordQueryArray = this.getInstallableFileOrd().parse(); + return new FileTransferMessageElement[]{new DeleteFileTransferMessageElement((FilePath)ordQueryArray[ordQueryArray.length - 1], bDaemonPlatform.getDaemonSession().getFileSpace())}; + } + + public long getProcessingFlags(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener) { + if (!this.localInstance) { + throw new IllegalStateException("illegal call on proxy instance of BDeleteFileInstallable"); + } + return 0L; + } + + public BInstallable makeLocalInstance() { + if (this.localInstance) { + return this; + } + try { + OrdQuery[] ordQueryArray = this.getInstallableFileOrd().parse(); + return new BDeleteFileInstallable((FilePath)ordQueryArray[ordQueryArray.length - 1]); + } + catch (RuntimeException runtimeException) { + System.out.println("ord: " + this.getInstallableFileOrd()); + throw runtimeException; + } + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.localInstance = false; + } + + public BDeleteFileInstallable() { + this.this(); + } + + public BDeleteFileInstallable(BIFile bIFile) { + this.this(); + this.setInstallableFileOrd(bIFile.getOrdInSession()); + this.localInstance = true; + this.setInstallableName(bIFile.getFilePath().getBody()); + } + + public BDeleteFileInstallable(FilePath filePath) { + this.this(); + this.setInstallableFileOrd(BOrd.make((OrdQuery)filePath)); + this.localInstance = true; + this.setInstallableName(filePath.getBody()); + } + + static { + Class clazz = class$com$tridium$install$installable$BDeleteFileInstallable; + if (clazz == null) { + clazz = class$com$tridium$install$installable$BDeleteFileInstallable = BDeleteFileInstallable.class("[Lcom.tridium.install.installable.BDeleteFileInstallable;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BIcon.std((String)"delete.png"); + } +} + diff --git a/modules/cfr_output/com/tridium/install/installable/BDistribution.java b/modules/cfr_output/com/tridium/install/installable/BDistribution.java new file mode 100644 index 0000000..23b510c --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/BDistribution.java @@ -0,0 +1,1219 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BIDirectory + * javax.baja.file.BIFile + * javax.baja.file.BIFileStore + * javax.baja.file.BLocalFileStore + * javax.baja.file.FilePath + * javax.baja.file.zip.BZipFile + * javax.baja.file.zip.BZipSpace + * javax.baja.file.zip.ZipPath + * javax.baja.log.Log + * javax.baja.naming.SlotPath + * javax.baja.naming.UnresolvedException + * javax.baja.nre.util.Array + * javax.baja.security.AuthenticationException + * javax.baja.sys.BIcon + * javax.baja.sys.BValue + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.LocalizableRuntimeException + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.PatternFilter + * javax.baja.xml.XContent + * javax.baja.xml.XElem + * javax.baja.xml.XParser + * javax.baja.xml.XWriter + */ +package com.tridium.install.installable; + +import com.tridium.install.BDaemonPlatform; +import com.tridium.install.BDependency; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.installable.BundleManifest; +import com.tridium.install.installable.DistributionManifest; +import com.tridium.install.installable.LocalInstallableRegistry; +import com.tridium.install.part.BPart; +import com.tridium.platform.daemon.BModuleContent; +import com.tridium.platform.daemon.DaemonFileUtil; +import com.tridium.platform.daemon.file.BCacheAccessPolicy; +import com.tridium.platform.daemon.file.BDaemonDirectoryStore; +import com.tridium.platform.daemon.file.BDaemonFileSpace; +import com.tridium.platform.daemon.file.BDaemonFileStore; +import com.tridium.platform.daemon.file.DirectoryCursor; +import com.tridium.platform.daemon.file.FilePathComparator; +import com.tridium.platform.daemon.file.StoreCache; +import com.tridium.platform.daemon.message.ByteArrayFileTransferElement; +import com.tridium.platform.daemon.message.DeleteFileTransferMessageElement; +import com.tridium.platform.daemon.message.FileFileTransferElement; +import com.tridium.platform.daemon.message.FileTransferMessageElement; +import com.tridium.platform.daemon.message.GetFileMessage; +import com.tridium.platform.daemon.task.CancelableDaemonSessionTask; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import com.tridium.platform.tcpip.BTcpIpHostSettings; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.ConnectException; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import javax.baja.file.BIDirectory; +import javax.baja.file.BIFile; +import javax.baja.file.BIFileStore; +import javax.baja.file.BLocalFileStore; +import javax.baja.file.FilePath; +import javax.baja.file.zip.BZipFile; +import javax.baja.file.zip.BZipSpace; +import javax.baja.file.zip.ZipPath; +import javax.baja.log.Log; +import javax.baja.naming.SlotPath; +import javax.baja.naming.UnresolvedException; +import javax.baja.nre.util.Array; +import javax.baja.platform.ICancelHint; +import javax.baja.platform.install.BFileReconciler; +import javax.baja.security.AuthenticationException; +import javax.baja.sys.BIcon; +import javax.baja.sys.BValue; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.LocalizableRuntimeException; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.PatternFilter; +import javax.baja.xml.XContent; +import javax.baja.xml.XElem; +import javax.baja.xml.XParser; +import javax.baja.xml.XWriter; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BDistribution +extends BInstallable { + public static final Property buildDate = BDistribution.newProperty((int)1, (String)"unknown", null); + public static final Property buildHost = BDistribution.newProperty((int)1, (String)"unknown", null); + public static final Property reboot = BDistribution.newProperty((int)1, (boolean)false, null); + public static final Property requiredModuleContent = BDistribution.newProperty((int)1, (BValue)BModuleContent.doc, null); + public static final Property noRunningApp = BDistribution.newProperty((int)1, (boolean)true, null); + public static final Property noRunningStation = BDistribution.newProperty((int)1, (boolean)true, null); + public static final Property daemonUpdate = BDistribution.newProperty((int)1, (boolean)false, null); + public static final Property updateOsTz = BDistribution.newProperty((int)1, (boolean)false, null); + public static final Property absoluteElementPaths = BDistribution.newProperty((int)1, (boolean)false, null); + public static final Property osInstall = BDistribution.newProperty((int)1, (boolean)false, null); + public static final Property hostId = BDistribution.newProperty((int)1, (String)"unknown", null); + public static final Type TYPE; + private static final BIcon icon; + public static Log log; + private BZipFile zipFile; + private XElem distFilePlatformElement; + private boolean alwaysReplace; + private TreeSet pathToRemove; + private TreeSet dirPathToClean; + private TreeMap fileRulesByPath; + private TreeMap dirRulesByPath; + private boolean localInstance; + private BTcpIpHostSettings tcpIpChanges; + private DistributionManifest manifest; + private final ElementReplace ALWAYS_REPLACE; + private final ElementReplace NEVER_REPLACE; + private final ElementReplace DO_NOT_COPY; + private final ElementReplace CRC_REPLACE; + private final ElementReplace REPLACE_HOSTID; + private final ElementReplace DEFAULT_REPLACE; + private ElementReplace defaultReplaceRule; + static /* synthetic */ Class class$com$tridium$install$installable$BDistribution; + static /* synthetic */ Class class$com$tridium$platform$daemon$message$FileTransferMessageElement; + static /* synthetic */ Class class$com$tridium$install$part$BPart; + + public String getBuildDate() { + return this.getString(buildDate); + } + + public void setBuildDate(String string) { + this.setString(buildDate, string, null); + } + + public String getBuildHost() { + return this.getString(buildHost); + } + + public void setBuildHost(String string) { + this.setString(buildHost, string, null); + } + + public boolean getReboot() { + return this.getBoolean(reboot); + } + + public void setReboot(boolean bl) { + this.setBoolean(reboot, bl, null); + } + + public BModuleContent getRequiredModuleContent() { + return (BModuleContent)this.get(requiredModuleContent); + } + + public void setRequiredModuleContent(BModuleContent bModuleContent) { + this.set(requiredModuleContent, (BValue)bModuleContent, null); + } + + public boolean getNoRunningApp() { + return this.getBoolean(noRunningApp); + } + + public void setNoRunningApp(boolean bl) { + this.setBoolean(noRunningApp, bl, null); + } + + public boolean getNoRunningStation() { + return this.getBoolean(noRunningStation); + } + + public void setNoRunningStation(boolean bl) { + this.setBoolean(noRunningStation, bl, null); + } + + public boolean getDaemonUpdate() { + return this.getBoolean(daemonUpdate); + } + + public void setDaemonUpdate(boolean bl) { + this.setBoolean(daemonUpdate, bl, null); + } + + public boolean getUpdateOsTz() { + return this.getBoolean(updateOsTz); + } + + public void setUpdateOsTz(boolean bl) { + this.setBoolean(updateOsTz, bl, null); + } + + public boolean getAbsoluteElementPaths() { + return this.getBoolean(absoluteElementPaths); + } + + public void setAbsoluteElementPaths(boolean bl) { + this.setBoolean(absoluteElementPaths, bl, null); + } + + public boolean getOsInstall() { + return this.getBoolean(osInstall); + } + + public void setOsInstall(boolean bl) { + this.setBoolean(osInstall, bl, null); + } + + public String getHostId() { + return this.getString(hostId); + } + + public void setHostId(String string) { + this.setString(hostId, string, null); + } + + public Type getType() { + return TYPE; + } + + public void close() throws Exception { + if (this.zipFile != null) { + this.zipFile.close(); + } + } + + public BInstallable makeLocalInstance() { + if (this.localInstance) { + return this; + } + try { + return new BDistribution((BIFile)this.getInstallableFileOrd().get()); + } + catch (UnresolvedException unresolvedException) { + return null; + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Unable to fully structure code + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public FileTransferMessageElement[] getTransferElements(BDaemonPlatform var1_1, StoreCache var2_2, ICancelHint var3_3, DaemonSessionTaskListener var4_4) throws Exception { + if (!this.getIsValid()) { + throw new IllegalStateException("can't get transfer elements for an invalid distribution file"); + } + var5_5 = this.zipFile; + synchronized (var5_5) { + v0 = BDistribution.class$com$tridium$platform$daemon$message$FileTransferMessageElement; + if (v0 == null) { + v0 = BDistribution.class$com$tridium$platform$daemon$message$FileTransferMessageElement = BDistribution.class("[Lcom.tridium.platform.daemon.message.FileTransferMessageElement;", false); + } + var8_6 = new Array(v0); + var9_7 = new FTMECursor(var1_1, var2_2, var3_3, var4_4); + while (true) { + block7: { + if (var9_7.next()) break block7; + BDistribution.log.trace("FileTransferMessageElement result array:"); + var9_8 = 0; + if (true) ** GOTO lbl26 + } + var8_6.add((Object)var9_7.get()); + } + do { + BDistribution.log.trace("[" + var9_8 + ']' + var8_6.get(var9_8)); + ++var9_8; +lbl26: + // 2 sources + + } while (var9_8 < var8_6.size()); + return (FileTransferMessageElement[])var8_6.trim(); + } + } + + public BTcpIpHostSettings getTcpIpChanges() { + if (!this.getIsValid()) { + throw new IllegalStateException("can't get tcp/ip changes for an invalid distribution file"); + } + return this.tcpIpChanges; + } + + public boolean meets(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) { + if (!this.getIsValid()) { + return false; + } + if (bDependency.getPartType().is(TYPE)) { + boolean bl = false; + if (new PatternFilter(bDependency.getPartName()).accept(this.getInstallableName()) && this.getVersion().meets(bDependency)) { + bl = true; + } + return bl; + } + return super.meets(bDependency, daemonSessionTaskListener); + } + + public long getProcessingFlags(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener) { + if (!this.getIsValid()) { + throw new IllegalStateException("can't get processing flags for an invalid distribution file"); + } + long l = 0L; + if (this.getReboot()) { + l |= 0x10000L; + } + if (this.getOsInstall()) { + l |= 0x20000L; + } + if (this.getDaemonUpdate()) { + l |= 0x40000L; + } + if (this.getNoRunningApp()) { + l |= 1L; + } + if (this.getNoRunningStation()) { + l |= (long)2; + } + if (this.getUpdateOsTz()) { + l |= 0x200000L; + } + if (this.getTcpIpChanges() != null && !this.getTcpIpChanges().getIsReadonly()) { + l |= 0x80000L; + } + if (this.getUpdateModuleContent()) { + l |= 0x100000L; + } + return l; + } + + public void addDirPathToClean(FilePath filePath) { + this.dirPathToClean.add(filePath); + } + + public XElem getUpdatedPlatformBog(BDaemonPlatform bDaemonPlatform) throws ConnectException, AuthenticationException { + if (this.distFilePlatformElement == null) { + return null; + } + InputStream inputStream = bDaemonPlatform.getDaemonSession().getInputStream(new GetFileMessage(new FilePath("!lib/platform.bog"), bDaemonPlatform.getDaemonSession().getFileSpace())); + try { + int n; + XElem[] xElemArray; + XElem xElem; + XElem xElem2; + HashSet hashSet = new HashSet(); + if (inputStream == null) { + xElem2 = this.getDefaultPlatformXML(); + } else if (this.distFilePlatformElement.getb("merge", true)) { + xElem2 = XParser.make((InputStream)inputStream).parse(); + xElem = xElem2.elem(0); + if (!xElem.get("t").endsWith(":PlatformServiceContainer")) { + xElem2 = this.getDefaultPlatformXML(); + } else { + xElemArray = xElem.elems("p"); + n = 0; + while (n < xElemArray.length) { + hashSet.add(xElemArray[n].get("n")); + ++n; + } + } + } else { + inputStream.close(); + xElem2 = this.getDefaultPlatformXML(); + } + xElem = xElem2.elem(0); + xElemArray = this.distFilePlatformElement.elems("p"); + n = 0; + while (n < xElemArray.length) { + if (!hashSet.contains(xElemArray[n].get("n"))) { + xElem.addContent((XContent)xElemArray[n].copy()); + } + ++n; + } + return xElem2; + } + catch (Exception exception) { + throw new LocalizableRuntimeException("platform", "Distribution.exception.platformBog", (Throwable)exception); + } + } + + private final XElem getDefaultPlatformXML() { + XElem xElem = new XElem("bajaObjectGraph"); + xElem.addAttr("version", "1.0"); + XElem xElem2 = new XElem("p"); + xElem2.addAttr("n", "platform"); + xElem2.addAttr("m", "platform=platform"); + xElem2.addAttr("t", "platform:PlatformServiceContainer"); + xElem.addContent((XContent)xElem2); + return xElem; + } + + public DistributionManifest getManifest() { + return this.manifest; + } + + /* + * Exception decompiling + */ + public boolean hasFileUpdates(BDaemonPlatform var1_1, StoreCache var2_2, ICancelHint var3_3, DaemonSessionTaskListener var4_4) throws Exception { + /* + * This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. + * + * org.benf.cfr.reader.util.ConfusedCFRException: Back jump on a try block [egrp 0[TRYBLOCK] [5 : 260->616)] java.lang.Throwable + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.insertExceptionBlocks(Op02WithProcessedDataAndRefs.java:2283) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:415) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201) + * at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94) + * at org.benf.cfr.reader.entities.Method.analyse(Method.java:531) + * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055) + * at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942) + * at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257) + * at org.benf.cfr.reader.Driver.doJar(Driver.java:139) + * at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76) + * at org.benf.cfr.reader.Main.main(Main.java:54) + */ + throw new IllegalStateException("Decompilation failed"); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void registerInstallableResources(DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + if (!this.localInstance) { + throw new IllegalStateException("Cannot call registerInstallableResources() on proxy instance"); + } + BZipFile bZipFile = this.zipFile; + synchronized (bZipFile) { + BundleManifest.InstallableResourceMetadata[] installableResourceMetadataArray = this.manifest.getInstallableResources(); + BZipSpace bZipSpace = null; + int n = 0; + while (n < installableResourceMetadataArray.length) { + BInstallable bInstallable = LocalInstallableRegistry.getInstance().findInstallable(BDependency.make(installableResourceMetadataArray[n].makeDependencyElem()), daemonSessionTaskListener); + if (bInstallable == null) { + if (bZipSpace == null) { + bZipSpace = (BZipSpace)this.zipFile.open(); + } + BIFile bIFile = bZipSpace.findFile((FilePath)new ZipPath(installableResourceMetadataArray[n].getContentEntryPath())); + LocalInstallableRegistry.getInstance().register(installableResourceMetadataArray[n].getInstallableName(), bIFile.getFileName(), installableResourceMetadataArray[n].getVersion(), bIFile.getInputStream(), daemonSessionTaskListener); + } + ++n; + } + return; + } + } + + public void setAlwaysReplace(boolean bl) { + this.alwaysReplace = bl; + } + + private final void checkCanceled(ICancelHint iCancelHint) { + if (this.canceled(iCancelHint)) { + throw new ICancelHint.CanceledException(); + } + } + + private final boolean canceled(ICancelHint iCancelHint) { + boolean bl = false; + if (iCancelHint != null && iCancelHint.isCanceled()) { + bl = true; + } + return bl; + } + + private final BDaemonFileStore getCurrentStore(FilePath filePath, BDaemonPlatform bDaemonPlatform, StoreCache storeCache) { + BDaemonDirectoryStore bDaemonDirectoryStore; + try { + bDaemonDirectoryStore = BDaemonDirectoryStore.make(bDaemonPlatform.getDaemonSession().getFileSpace(), filePath.getParent(), false, true, false, storeCache); + } + catch (IOException iOException) { + throw new LocalizableRuntimeException("platform", "Distribution.exception.readContents", new Object[]{this.zipFile.getFilePath().getBody()}, (Throwable)iOException); + } + return bDaemonDirectoryStore == null ? null : (BDaemonFileStore)bDaemonDirectoryStore.getChild(filePath.getName(), BCacheAccessPolicy.lazyFetch); + } + + private final FilePath getEntryDestPath(FilePath filePath) { + if (this.getAbsoluteElementPaths()) { + return filePath; + } + if (filePath.isLocalAbsolute()) { + return new FilePath("!" + filePath.getBody().substring(1)); + } + return new FilePath("!" + filePath.getBody()); + } + + private final FilePath getEntryDestPath(String string) { + if (this.getAbsoluteElementPaths()) { + if (string.charAt(0) == '/') { + return new FilePath(string); + } + return new FilePath("/" + string); + } + if (string.charAt(0) == '/') { + return new FilePath("!" + string.substring(1)); + } + return new FilePath("!" + string); + } + + private final ElementReplace getReplaceRule(int n) { + switch (n) { + case -1: { + return this.DEFAULT_REPLACE; + } + case 0: { + return this.NEVER_REPLACE; + } + case 1: { + return this.ALWAYS_REPLACE; + } + case 2: { + return this.CRC_REPLACE; + } + case 3: { + return this.DO_NOT_COPY; + } + case 4: { + return this.REPLACE_HOSTID; + } + } + throw new IllegalStateException("Unrecognized replacement rule"); + } + + private final ElementReplace getReplaceRule(BundleManifest.FileHandlingRule fileHandlingRule) { + if (fileHandlingRule.reconciler != null) { + return new Reconcile(fileHandlingRule.reconciler); + } + return this.getReplaceRule(fileHandlingRule.replaceRule); + } + + private final ElementReplace getEntryReplaceRule(FilePath filePath) { + ElementReplace elementReplace = (ElementReplace)this.fileRulesByPath.get(filePath); + if (elementReplace != null) { + if (this.alwaysReplace && elementReplace != this.DO_NOT_COPY && elementReplace != this.REPLACE_HOSTID) { + return this.ALWAYS_REPLACE; + } + return elementReplace; + } + elementReplace = this.defaultReplaceRule; + int n = 0; + Iterator iterator = this.dirRulesByPath.keySet().iterator(); + while (iterator.hasNext()) { + FilePath filePath2 = (FilePath)iterator.next(); + if (filePath2.depth() <= n || !DaemonFileUtil.isSubPath(filePath, filePath2)) continue; + elementReplace = (ElementReplace)this.dirRulesByPath.get(filePath2); + n = filePath2.depth(); + } + return elementReplace; + } + + private final void loadDistManifest(DistributionManifest distributionManifest, ICancelHint iCancelHint) { + if (distributionManifest.getInstallableName().equals("backup")) { + this.setInstallableName("backupdist"); + } else { + this.setInstallableName(distributionManifest.getInstallableName()); + } + this.setDescription(distributionManifest.getDescription()); + this.setBuildDate(distributionManifest.getBuildDate()); + this.setBuildHost(distributionManifest.getBuildHost()); + this.setReboot(distributionManifest.isRebootRequired()); + this.setIsStandalone(distributionManifest.isStandalone()); + this.setNewOsTimeZone(distributionManifest.getNewOsTimeZone()); + this.setUpdateOsTz(this.getNewOsTimeZone().isNull() ^ true); + this.setNoRunningApp(distributionManifest.noRunningApp()); + this.setNoRunningStation(distributionManifest.noRunningStation()); + this.setAbsoluteElementPaths(distributionManifest.useAbsoluteElementPaths()); + this.setOsInstall(distributionManifest.isOsUpdateRequired()); + this.setDaemonUpdate(distributionManifest.isDaemonBinaryUpdateRequired()); + if (distributionManifest.getHostId() != null) { + this.setHostId(distributionManifest.getHostId()); + } + this.setVersion(distributionManifest.getInstallableVersion()); + this.distFilePlatformElement = distributionManifest.getPlatformXml(); + this.defaultReplaceRule = this.getReplaceRule(distributionManifest.getDefaultReplaceRule()); + BundleManifest.FileHandlingRule[] fileHandlingRuleArray = distributionManifest.getFileHandlingRules(); + int n = 0; + while (n < fileHandlingRuleArray.length) { + if (fileHandlingRuleArray[n] instanceof BundleManifest.RemoveRule) { + this.pathToRemove.add(this.getEntryDestPath(fileHandlingRuleArray[n].entryPath)); + } else if (fileHandlingRuleArray[n] instanceof BundleManifest.DirHandlingRule) { + BundleManifest.DirHandlingRule dirHandlingRule = (BundleManifest.DirHandlingRule)fileHandlingRuleArray[n]; + this.dirRulesByPath.put(this.getEntryDestPath(dirHandlingRule.entryPath), this.getReplaceRule(dirHandlingRule)); + if (dirHandlingRule.clean) { + this.dirPathToClean.add(this.getEntryDestPath(dirHandlingRule.entryPath)); + } + } else { + this.fileRulesByPath.put(this.getEntryDestPath(fileHandlingRuleArray[n].entryPath), this.getReplaceRule(fileHandlingRuleArray[n])); + } + ++n; + } + BDependency[] bDependencyArray = distributionManifest.getDependencies(); + int n2 = 0; + while (n2 < bDependencyArray.length) { + this.getDependencies().add("dep?", (BValue)bDependencyArray[n2]); + ++n2; + } + BDependency[] bDependencyArray2 = distributionManifest.getExclusions(); + int n3 = 0; + while (n3 < bDependencyArray2.length) { + this.getExclusions().add("excl?", (BValue)bDependencyArray2[n3]); + ++n3; + } + BPart[] bPartArray = distributionManifest.getProvidedParts(this); + int n4 = 0; + while (n4 < bPartArray.length) { + this.getParts().add(SlotPath.escape((String)bPartArray[n4].getPartName()), (BValue)bPartArray[n4]); + ++n4; + } + this.tcpIpChanges = distributionManifest.getTcpIpSettings(); + BModuleContent bModuleContent = distributionManifest.getUpdateModuleContent(); + if (bModuleContent == null) { + this.setUpdateModuleContent(false); + } else { + this.setUpdateModuleContent(true); + this.setNewModuleContent(bModuleContent); + } + } + + private final void updatePathToKeep(Set set, FilePath filePath) { + Iterator iterator = this.dirPathToClean.iterator(); + while (iterator.hasNext()) { + FilePath filePath2 = (FilePath)iterator.next(); + if (!DaemonFileUtil.isSubPath(filePath, filePath2)) continue; + FilePath filePath3 = filePath; + while (filePath3.depth() > 0) { + set.add(filePath3); + filePath3 = filePath3.getParent(); + } + return; + } + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.alwaysReplace = false; + this.pathToRemove = new TreeSet(FilePathComparator.INSTANCE); + this.dirPathToClean = new TreeSet(FilePathComparator.INSTANCE); + this.fileRulesByPath = new TreeMap(FilePathComparator.INSTANCE); + this.dirRulesByPath = new TreeMap(FilePathComparator.INSTANCE); + this.localInstance = false; + this.tcpIpChanges = null; + this.manifest = null; + this.ALWAYS_REPLACE = new ElementReplace(){ + + public final FileTransferMessageElement getFTME(BIFile bIFile, FilePath filePath, BDaemonPlatform bDaemonPlatform, StoreCache storeCache) { + return new FileFileTransferElement(filePath, bIFile, bDaemonPlatform.getDaemonSession().getFileSpace()); + } + }; + this.NEVER_REPLACE = new ElementReplace(){ + + public final FileTransferMessageElement getFTME(BIFile bIFile, FilePath filePath, BDaemonPlatform bDaemonPlatform, StoreCache storeCache) { + BDaemonFileStore bDaemonFileStore = BDistribution.this.getCurrentStore(filePath, bDaemonPlatform, storeCache); + if (bDaemonFileStore == null) { + return BDistribution.this.ALWAYS_REPLACE.getFTME(bIFile, filePath, bDaemonPlatform, storeCache); + } + log.trace("FTMECursor.nextZipEntry skipping " + filePath.getBody() + " rule=never"); + return null; + } + }; + this.DO_NOT_COPY = new ElementReplace(){ + + public final FileTransferMessageElement getFTME(BIFile bIFile, FilePath filePath, BDaemonPlatform bDaemonPlatform, StoreCache storeCache) { + return null; + } + }; + this.CRC_REPLACE = new ElementReplace(){ + + public final FileTransferMessageElement getFTME(BIFile bIFile, FilePath filePath, BDaemonPlatform bDaemonPlatform, StoreCache storeCache) { + BDaemonFileStore bDaemonFileStore = BDistribution.this.getCurrentStore(filePath, bDaemonPlatform, storeCache); + if (bDaemonFileStore == null) { + log.trace("not found " + filePath.getBody()); + return BDistribution.this.ALWAYS_REPLACE.getFTME(bIFile, filePath, bDaemonPlatform, storeCache); + } + long l = DaemonFileUtil.getCrc(bIFile); + long l2 = -1; + try { + l2 = bDaemonFileStore.getCrc(); + } + catch (IOException iOException) { + log.error("Error calculating CRC for " + filePath.getBody(), (Throwable)iOException); + return BDistribution.this.ALWAYS_REPLACE.getFTME(bIFile, filePath, bDaemonPlatform, storeCache); + } + if (l2 != l) { + log.trace("CRC mismatch for " + filePath.getBody() + ' ' + l2 + " != " + l); + return BDistribution.this.ALWAYS_REPLACE.getFTME(bIFile, filePath, bDaemonPlatform, storeCache); + } + log.trace("FTMECursor.nextZipEntry skipping " + filePath.getBody() + " rule=crc current crc is " + l2 + ", entry crc is " + l); + return null; + } + }; + this.REPLACE_HOSTID = new ElementReplace(){ + + public final FileTransferMessageElement getFTME(BIFile bIFile, FilePath filePath, BDaemonPlatform bDaemonPlatform, StoreCache storeCache) { + String string = bDaemonPlatform.getHostId(); + if (string == null) { + return null; + } + if (string.equalsIgnoreCase(BDistribution.this.getHostId())) { + return BDistribution.this.ALWAYS_REPLACE.getFTME(bIFile, filePath, bDaemonPlatform, storeCache); + } + return null; + } + }; + this.DEFAULT_REPLACE = new ElementReplace(){ + + public final FileTransferMessageElement getFTME(BIFile bIFile, FilePath filePath, BDaemonPlatform bDaemonPlatform, StoreCache storeCache) { + return BDistribution.this.defaultReplaceRule.getFTME(bIFile, filePath, bDaemonPlatform, storeCache); + } + }; + this.defaultReplaceRule = this.CRC_REPLACE; + } + + public BDistribution() { + this.this(); + } + + public BDistribution(BIFile bIFile) { + this(bIFile, null, true); + } + + public BDistribution(BIFile bIFile, boolean bl) { + this(bIFile, null, bl); + } + + public BDistribution(BIFile bIFile, ICancelHint iCancelHint) { + this(bIFile, iCancelHint, true); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public BDistribution(BIFile bIFile, ICancelHint iCancelHint, boolean bl) { + this.this(); + this.checkCanceled(iCancelHint); + this.zipFile = new BZipFile(bIFile.getStore()); + this.localInstance = bIFile.getStore() instanceof BLocalFileStore; + this.checkCanceled(iCancelHint); + BZipFile bZipFile = this.zipFile; + synchronized (bZipFile) { + this.setInstallableFileProperties(bIFile); + try { + if (this.localInstance) { + BZipSpace bZipSpace = (BZipSpace)this.zipFile.open(); + BIFile bIFile2 = bZipSpace.findFile((FilePath)new ZipPath("META-INF/dist.xml")); + if (bIFile2 == null) { + bIFile2 = bZipSpace.findFile((FilePath)new ZipPath("meta-inf/dist.xml")); + } + this.checkCanceled(iCancelHint); + if (bIFile2 != null) { + this.manifest = DistributionManifest.make(bIFile2.getInputStream(), bl); + } + } else { + ZipInputStream zipInputStream = new ZipInputStream(bIFile.getInputStream()); + while (true) { + ZipEntry zipEntry; + if ((zipEntry = zipInputStream.getNextEntry()) == null) { + if (!bl) break; + zipInputStream.close(); + break; + } + if (this.canceled(iCancelHint)) { + if (bl) { + zipInputStream.close(); + } + throw new ICancelHint.CanceledException(); + } + if (!zipEntry.getName().equalsIgnoreCase("meta-inf/dist.xml")) continue; + this.manifest = DistributionManifest.make(XParser.make((InputStream)zipInputStream).parse(false)); + } + } + if (this.manifest == null) { + this.setIsValid(false); + } else { + this.loadDistManifest(this.manifest, iCancelHint); + } + if (bl) { + this.zipFile.close(); + } + } + catch (IOException iOException) { + this.setIsValid(false); + } + catch (ICancelHint.CanceledException canceledException) { + throw canceledException; + } + catch (Exception exception) { + this.setIsValid(false); + } + return; + } + } + + static { + Class clazz = class$com$tridium$install$installable$BDistribution; + if (clazz == null) { + clazz = class$com$tridium$install$installable$BDistribution = BDistribution.class("[Lcom.tridium.install.installable.BDistribution;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BIcon.std((String)"modules.png"); + log = Log.getLog((String)"platform.dist"); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class FTMECursor { + private BDaemonPlatform target; + private StoreCache cache; + private DaemonSessionTaskListener taskListener; + private ICancelHint cancelHint; + private TreeSet pathToKeep; + private Iterator pathToRemoveIterator; + private FileTransferMessageElement current; + private DirectoryCursor entryDirectoryCursor; + private Iterator dirPathToCleanIterator; + private CleanElementsCursor cleanElementsCursor; + private boolean platformBogChecked; + + public FileTransferMessageElement get() { + return this.current; + } + + public boolean next() throws ConnectException, AuthenticationException, IOException { + if (this.nextRemove()) { + return true; + } + Iterator iterator = BDistribution.this.dirPathToClean.iterator(); + while (iterator.hasNext()) { + FilePath filePath = (FilePath)iterator.next(); + BDaemonDirectoryStore.make(this.target.getDaemonSession().getFileSpace(), filePath, true, true, false, this.cache); + } + if (this.nextZipEntry()) { + return true; + } + if (this.nextPlatformBog()) { + return true; + } + return this.nextClean(); + } + + private final boolean nextPlatformBog() throws ConnectException, AuthenticationException { + if (this.platformBogChecked) { + return false; + } + this.platformBogChecked = true; + XElem xElem = BDistribution.this.getUpdatedPlatformBog(this.target); + if (xElem == null) { + return false; + } + try { + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + XWriter xWriter = new XWriter((OutputStream)byteArrayOutputStream); + xWriter.prolog(); + xElem.write(xWriter); + xWriter.flush(); + this.current = new ByteArrayFileTransferElement(new FilePath("!lib/platform.bog"), byteArrayOutputStream.toByteArray(), this.target.getDaemonSession().getFileSpace()); + return true; + } + catch (Exception exception) { + throw new LocalizableRuntimeException("platform", "Distribution.exception.platformBog", (Throwable)exception); + } + } + + private final boolean nextRemove() throws ConnectException, AuthenticationException, IOException { + if (this.pathToRemoveIterator == null) { + this.pathToRemoveIterator = BDistribution.this.pathToRemove.iterator(); + } + if (this.pathToRemoveIterator.hasNext()) { + BDistribution.this.checkCanceled(this.cancelHint); + FilePath filePath = (FilePath)this.pathToRemoveIterator.next(); + BIFileStore bIFileStore = this.target.getDaemonSession().getFileSpace().findStore(this.cache, filePath, false, false); + if (bIFileStore != null) { + this.current = new DeleteFileTransferMessageElement(filePath, this.target.getDaemonSession().getFileSpace()); + return true; + } + } + return false; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + private final boolean nextZipEntry() { + boolean bl; + CancelableDaemonSessionTask cancelableDaemonSessionTask = null; + try { + if (this.entryDirectoryCursor == null) { + BDistribution.this.checkCanceled(this.cancelHint); + this.entryDirectoryCursor = new DirectoryCursor((BIDirectory)((BZipSpace)BDistribution.this.zipFile.open())); + } + while (true) { + if (!this.entryDirectoryCursor.nextNonDirectory()) { + bl = false; + break; + } + BDistribution.this.checkCanceled(this.cancelHint); + FilePath filePath = BDistribution.this.getEntryDestPath(this.entryDirectoryCursor.getFile().getFilePath()); + if (filePath.depth() > 1 && filePath.nameAt(0).equalsIgnoreCase("meta-inf") || filePath.getName().equals("platform.bog")) continue; + BDistribution.this.updatePathToKeep(this.pathToKeep, filePath); + cancelableDaemonSessionTask = new CancelableDaemonSessionTask(BDistribution.this.getLexicon(), "Distribution.fileCheck.title", "Distribution.fileCheck.message", new Object[]{filePath.getBody()}, this.cancelHint); + if (this.taskListener != null) { + this.taskListener.taskStarted(cancelableDaemonSessionTask); + } + this.current = BDistribution.this.getEntryReplaceRule(filePath).getFTME(this.entryDirectoryCursor.getFile(), filePath, this.target, this.cache); + if (this.current != null) { + boolean bl2 = true; + Object var3_5 = null; + if (cancelableDaemonSessionTask == null) return bl2; + if (this.taskListener == null) return bl2; + this.taskListener.taskFinished(cancelableDaemonSessionTask); + return bl2; + } + if (this.taskListener == null) continue; + this.taskListener.taskFinished(cancelableDaemonSessionTask); + } + } + catch (Throwable throwable) { + Object var3_7 = null; + if (cancelableDaemonSessionTask == null) throw throwable; + if (this.taskListener == null) throw throwable; + this.taskListener.taskFinished(cancelableDaemonSessionTask); + throw throwable; + } + Object var3_6 = null; + if (cancelableDaemonSessionTask == null) return bl; + if (this.taskListener == null) return bl; + this.taskListener.taskFinished(cancelableDaemonSessionTask); + return bl; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + private final boolean nextClean() { + boolean bl; + CancelableDaemonSessionTask cancelableDaemonSessionTask; + block11: { + boolean bl2; + cancelableDaemonSessionTask = null; + try { + if (this.entryDirectoryCursor == null) throw new IllegalStateException("nextClean must be called after nextZipEntry() is completed"); + if (this.entryDirectoryCursor.nextNonDirectory()) { + throw new IllegalStateException("nextClean must be called after nextZipEntry() is completed"); + } + if (this.cleanElementsCursor != null && this.cleanElementsCursor.next()) { + this.current = this.cleanElementsCursor.get(); + boolean bl3 = true; + Object var3_5 = null; + if (cancelableDaemonSessionTask == null) return bl3; + if (this.taskListener == null) return bl3; + this.taskListener.taskFinished(cancelableDaemonSessionTask); + return bl3; + } + this.cleanElementsCursor = null; + if (this.dirPathToCleanIterator == null) { + cancelableDaemonSessionTask = new CancelableDaemonSessionTask(BDistribution.this.getLexicon(), "Distribution.cleanCheck", "Distribution.cleanCheck", this.cancelHint); + if (this.taskListener != null) { + this.taskListener.taskStarted(cancelableDaemonSessionTask); + } + this.dirPathToCleanIterator = BDistribution.this.dirPathToClean.iterator(); + } + while (true) { + BDaemonDirectoryStore bDaemonDirectoryStore; + if (!this.dirPathToCleanIterator.hasNext()) { + if (cancelableDaemonSessionTask != null && this.taskListener != null) { + this.taskListener.taskFinished(cancelableDaemonSessionTask); + } + bl = false; + break block11; + } + BDistribution.this.checkCanceled(this.cancelHint); + FilePath filePath = (FilePath)this.dirPathToCleanIterator.next(); + try { + bDaemonDirectoryStore = BDaemonDirectoryStore.make(this.target.getDaemonSession().getFileSpace(), filePath, true, false, false, this.cache); + } + catch (IOException iOException) { + throw new LocalizableRuntimeException("platform", "Distribution.exception.readContents", new Object[]{BDistribution.this.zipFile.getFilePath().getBody()}, (Throwable)iOException); + } + if (bDaemonDirectoryStore == null) continue; + this.cleanElementsCursor = new CleanElementsCursor(this.pathToKeep, bDaemonDirectoryStore, this.cancelHint); + if (this.cleanElementsCursor.next()) break; + } + this.current = this.cleanElementsCursor.get(); + bl2 = true; + } + catch (Throwable throwable) { + Object var3_8 = null; + if (cancelableDaemonSessionTask == null) throw throwable; + if (this.taskListener == null) throw throwable; + this.taskListener.taskFinished(cancelableDaemonSessionTask); + throw throwable; + } + Object var3_6 = null; + if (cancelableDaemonSessionTask == null) return bl2; + if (this.taskListener == null) return bl2; + this.taskListener.taskFinished(cancelableDaemonSessionTask); + return bl2; + } + Object var3_7 = null; + if (cancelableDaemonSessionTask == null) return bl; + if (this.taskListener == null) return bl; + this.taskListener.taskFinished(cancelableDaemonSessionTask); + return bl; + } + + private final /* synthetic */ void this() { + this.pathToRemoveIterator = null; + this.current = null; + this.entryDirectoryCursor = null; + this.dirPathToCleanIterator = null; + this.cleanElementsCursor = null; + this.platformBogChecked = false; + } + + public FTMECursor(BDaemonPlatform bDaemonPlatform, StoreCache storeCache, ICancelHint iCancelHint, DaemonSessionTaskListener daemonSessionTaskListener) { + this.this(); + if (!BDistribution.this.localInstance) { + throw new IllegalStateException("illegal call on proxy instance of BDistribution"); + } + this.target = bDaemonPlatform; + this.cache = storeCache; + this.cancelHint = iCancelHint; + this.taskListener = daemonSessionTaskListener; + this.pathToKeep = new TreeSet(FilePathComparator.INSTANCE); + this.pathToKeep.add(new FilePath("!lib/platform.bog")); + this.pathToKeep.add(new FilePath("/niagara/lib/platform.bog")); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class Reconcile + implements ElementReplace { + private BFileReconciler reconciler; + + public FileTransferMessageElement getFTME(BIFile bIFile, FilePath filePath, BDaemonPlatform bDaemonPlatform, StoreCache storeCache) { + BDaemonFileStore bDaemonFileStore = BDistribution.this.getCurrentStore(filePath, bDaemonPlatform, storeCache); + if (bDaemonFileStore == null) { + return BDistribution.this.ALWAYS_REPLACE.getFTME(bIFile, filePath, bDaemonPlatform, storeCache); + } + try { + BFileReconciler.ReconciliationResults reconciliationResults = this.reconciler.reconcile(bIFile, DaemonFileUtil.getCrc(bIFile), bDaemonPlatform.getDaemonSession().getFileSpace().makeFile((BIFileStore)bDaemonFileStore), bDaemonFileStore.getCrc()); + if (reconciliationResults == null || !reconciliationResults.shouldReplaceContents()) { + return null; + } + return new ReconciliationResultsFTME(filePath, bDaemonPlatform.getDaemonSession().getFileSpace(), reconciliationResults); + } + catch (Exception exception) { + throw new LocalizableRuntimeException("platform", "Distribution.exception.readContents", new Object[]{BDistribution.this.zipFile.getFilePath().getBody()}, (Throwable)exception); + } + } + + public Reconcile(BFileReconciler bFileReconciler) { + this.reconciler = bFileReconciler; + } + } + + private static interface ElementReplace { + public FileTransferMessageElement getFTME(BIFile var1, FilePath var2, BDaemonPlatform var3, StoreCache var4); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class CleanElementsCursor { + private Set pathToKeep; + private BDaemonDirectoryStore dir; + private ICancelHint cancelHint; + private Array kids; + private CleanElementsCursor innerCursor; + private DeleteFileTransferMessageElement current; + private int ixKid; + private boolean finished; + private boolean emptyWhenDone; + + public DeleteFileTransferMessageElement get() { + return this.current; + } + + public boolean next() { + if (this.finished) { + return false; + } + if (this.innerCursor != null) { + if (this.innerCursor.next()) { + this.current = this.innerCursor.get(); + return true; + } + boolean bl = false; + if (this.emptyWhenDone && this.innerCursor.emptyWhenDone) { + bl = true; + } + this.emptyWhenDone = bl; + this.innerCursor = null; + } + while (this.ixKid < this.kids.size()) { + BDistribution.this.checkCanceled(this.cancelHint); + if (((BIFileStore)this.kids.get(this.ixKid)).isDirectory()) { + this.innerCursor = new CleanElementsCursor(this.pathToKeep, (BDaemonDirectoryStore)((Object)this.kids.get(this.ixKid)), this.cancelHint); + ++this.ixKid; + if (!this.innerCursor.next()) continue; + this.current = this.innerCursor.get(); + return true; + } + if (this.pathToKeep.contains(((BIFileStore)this.kids.get(this.ixKid)).getFilePath())) { + ++this.ixKid; + this.emptyWhenDone = false; + continue; + } + log.trace("clean file " + ((BIFileStore)this.kids.get(this.ixKid)).getFilePath().getBody()); + this.current = new DeleteFileTransferMessageElement(((BIFileStore)this.kids.get(this.ixKid)).getFilePath(), this.dir.getDaemonFileSpace()); + ++this.ixKid; + return true; + } + this.finished = true; + if (this.emptyWhenDone && !this.pathToKeep.contains(this.dir.getFilePath())) { + log.trace("clean dir " + this.dir.getFilePath().getBody()); + this.current = new DeleteFileTransferMessageElement(this.dir.getFilePath(), this.dir.getDaemonFileSpace()); + return true; + } + return false; + } + + private final /* synthetic */ void this() { + this.innerCursor = null; + this.current = null; + this.ixKid = 0; + this.finished = false; + this.emptyWhenDone = true; + } + + public CleanElementsCursor(Set set, BDaemonDirectoryStore bDaemonDirectoryStore, ICancelHint iCancelHint) { + this.this(); + this.pathToKeep = set; + this.dir = bDaemonDirectoryStore; + this.cancelHint = iCancelHint; + try { + this.kids = this.dir.getChildren(BCacheAccessPolicy.lazyFetch, true, false, false); + } + catch (Exception exception) { + throw new LocalizableRuntimeException("platform", "Distribution.exception.dirList", new Object[]{this.dir.getFilePath().getBody()}, (Throwable)exception); + } + } + } + + private static class ReconciliationResultsFTME + extends FileTransferMessageElement { + private BFileReconciler.ReconciliationResults results; + + public InputStream getStream() throws IOException { + try { + return this.results.getInputStream(); + } + catch (IOException iOException) { + throw iOException; + } + catch (RuntimeException runtimeException) { + throw runtimeException; + } + catch (Exception exception) { + throw new BajaRuntimeException((Throwable)exception); + } + } + + public long getSize() { + try { + return this.results.getSize(); + } + catch (RuntimeException runtimeException) { + throw runtimeException; + } + catch (Exception exception) { + throw new BajaRuntimeException((Throwable)exception); + } + } + + public ReconciliationResultsFTME(FilePath filePath, BDaemonFileSpace bDaemonFileSpace, BFileReconciler.ReconciliationResults reconciliationResults) { + super(filePath, bDaemonFileSpace); + this.results = reconciliationResults; + } + } +} + diff --git a/modules/cfr_output/com/tridium/install/installable/BDistributionFile.java b/modules/cfr_output/com/tridium/install/installable/BDistributionFile.java new file mode 100644 index 0000000..ce2aaf1 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/BDistributionFile.java @@ -0,0 +1,79 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BDataFile + * javax.baja.file.BIFile + * javax.baja.file.BIFileStore + * javax.baja.sys.BIcon + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.install.installable; + +import com.tridium.install.installable.BDistribution; +import javax.baja.file.BDataFile; +import javax.baja.file.BIFile; +import javax.baja.file.BIFileStore; +import javax.baja.sys.BIcon; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BDistributionFile +extends BDataFile { + private static final BIcon icon = BIcon.std((String)"modules.png"); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$install$installable$BDistributionFile; + + public BDistribution makeDistribution() { + return this.makeDistribution(true); + } + + public BDistribution makeDistribution(boolean bl) { + return new BDistribution((BIFile)this, bl); + } + + public String getMimeType() { + return "application/x-baja-dist"; + } + + public BIcon getIcon() { + return icon; + } + + public Type getType() { + return TYPE; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BDistributionFile(BIFileStore bIFileStore) { + super(bIFileStore); + } + + public BDistributionFile() { + } + + static { + Class clazz = class$com$tridium$install$installable$BDistributionFile; + if (clazz == null) { + clazz = class$com$tridium$install$installable$BDistributionFile = BDistributionFile.class("[Lcom.tridium.install.installable.BDistributionFile;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/install/installable/BFileInstallable.java b/modules/cfr_output/com/tridium/install/installable/BFileInstallable.java new file mode 100644 index 0000000..ec50b22 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/BFileInstallable.java @@ -0,0 +1,220 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BDirectory + * javax.baja.file.BIFile + * javax.baja.file.FilePath + * javax.baja.file.FileUtil + * javax.baja.naming.UnresolvedException + * javax.baja.registry.TypeInfo + * javax.baja.sys.BIcon + * javax.baja.sys.BObject + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.install.installable; + +import com.tridium.install.BDaemonPlatform; +import com.tridium.install.installable.BInstallable; +import com.tridium.platform.daemon.file.BDaemonFileSpace; +import com.tridium.platform.daemon.file.StoreCache; +import com.tridium.platform.daemon.message.FileFileTransferElement; +import com.tridium.platform.daemon.message.FileTransferMessageElement; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import java.util.ArrayList; +import java.util.List; +import javax.baja.file.BDirectory; +import javax.baja.file.BIFile; +import javax.baja.file.FilePath; +import javax.baja.file.FileUtil; +import javax.baja.naming.UnresolvedException; +import javax.baja.platform.ICancelHint; +import javax.baja.registry.TypeInfo; +import javax.baja.sys.BIcon; +import javax.baja.sys.BObject; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFileInstallable +extends BInstallable { + public static final Property destinationFileName = BFileInstallable.newProperty((int)0, (String)"", null); + public static final Property destinationDirPathBody = BFileInstallable.newProperty((int)0, (String)"!", null); + public static final Type TYPE; + private static final BIcon icon; + private BIFile file; + private boolean localInstance; + static /* synthetic */ Class class$com$tridium$install$installable$BFileInstallable; + + public String getDestinationFileName() { + return this.getString(destinationFileName); + } + + public void setDestinationFileName(String string) { + this.setString(destinationFileName, string, null); + } + + public String getDestinationDirPathBody() { + return this.getString(destinationDirPathBody); + } + + public void setDestinationDirPathBody(String string) { + this.setString(destinationDirPathBody, string, null); + } + + public Type getType() { + return TYPE; + } + + public void close() { + } + + public FileTransferMessageElement[] getTransferElements(BDaemonPlatform bDaemonPlatform, StoreCache storeCache, ICancelHint iCancelHint, DaemonSessionTaskListener daemonSessionTaskListener) { + if (!this.localInstance) { + throw new IllegalStateException("illegal call on proxy instance of BFileInstallable"); + } + ArrayList arrayList = new ArrayList(); + String string = this.getDestinationFileName(); + if (string.length() == 0) { + string = this.file.getFileName(); + } + this.addFiles(arrayList, this.file, string, new FilePath(this.getDestinationDirPathBody()), bDaemonPlatform.getDaemonSession().getFileSpace(), iCancelHint); + FileTransferMessageElement[] fileTransferMessageElementArray = new FileTransferMessageElement[arrayList.size()]; + arrayList.toArray(fileTransferMessageElementArray); + return fileTransferMessageElementArray; + } + + public long getProcessingFlags(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener) { + if (!this.localInstance) { + throw new IllegalStateException("illegal call on proxy instance of BFileInstallable"); + } + return 0L; + } + + public BInstallable makeLocalInstance() { + if (this.localInstance) { + return this; + } + try { + return new BFileInstallable((BIFile)this.getInstallableFileOrd().get(), this.getDestinationFileName(), new FilePath(this.getDestinationDirPathBody())); + } + catch (UnresolvedException unresolvedException) { + return null; + } + catch (RuntimeException runtimeException) { + System.out.println("ord: " + this.getInstallableFileOrd()); + throw runtimeException; + } + } + + public boolean equivalent(Object object) { + if (object instanceof BFileInstallable) { + BFileInstallable bFileInstallable = (BFileInstallable)object; + boolean bl = false; + if (super.equivalent(bFileInstallable) && bFileInstallable.getDestinationDirPathBody().equals(this.getDestinationDirPathBody()) && bFileInstallable.getDestinationFileName().equals(this.getDestinationFileName())) { + bl = true; + } + return bl; + } + return false; + } + + private final void addFiles(List list, BIFile bIFile, String string, FilePath filePath, BDaemonFileSpace bDaemonFileSpace, ICancelHint iCancelHint) { + if (bIFile instanceof BDirectory) { + BIFile[] bIFileArray = ((BDirectory)bIFile).listFiles(); + int n = 0; + while (n < bIFileArray.length) { + if (iCancelHint != null && iCancelHint.isCanceled()) { + throw new ICancelHint.CanceledException(); + } + this.addFiles(list, bIFileArray[n], bIFileArray[n].getFileName(), filePath.merge(string), bDaemonFileSpace, iCancelHint); + ++n; + } + } else { + list.add(new FileFileTransferElement(filePath.merge(string), bIFile, bDaemonFileSpace)); + } + } + + public BIcon getIcon() { + try { + String string = FileUtil.getExtension((String)this.getInstallableFileName()); + if (string != null && string.length() > 0) { + TypeInfo typeInfo = Sys.getRegistry().getFileTypeForExtension(string); + BObject bObject = typeInfo.getInstance(); + return bObject.getIcon(); + } + } + catch (Exception exception) {} + return icon; + } + + public String toString(Context context) { + return this.getInstallableName(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.localInstance = false; + } + + public BFileInstallable() { + this.this(); + } + + public BFileInstallable(BIFile bIFile, FilePath filePath) { + this(bIFile); + this.setDestinationDirPathBody(filePath.getBody()); + this.setInstallableName(filePath.merge(bIFile.getFileName()).getBody()); + } + + public BFileInstallable(BIFile bIFile, String string, FilePath filePath) { + this(bIFile); + this.setDestinationDirPathBody(filePath.getBody()); + this.setDestinationFileName(string); + this.setInstallableName(filePath.merge(string).getBody()); + } + + public BFileInstallable(BIFile bIFile) { + this.this(); + this.setDestinationFileName(bIFile.getFileName()); + this.setInstallableName(bIFile.getFileName()); + this.setDescription(bIFile.getFileName()); + this.setInstallableFileProperties(bIFile); + if (bIFile.isDirectory()) { + this.setDestinationDirPathBody(bIFile.getFilePath().getBody()); + } else { + this.setDestinationDirPathBody(bIFile.getFilePath().getParent().getBody()); + } + this.file = bIFile; + this.localInstance = true; + } + + static { + Class clazz = class$com$tridium$install$installable$BFileInstallable; + if (clazz == null) { + clazz = class$com$tridium$install$installable$BFileInstallable = BFileInstallable.class("[Lcom.tridium.install.installable.BFileInstallable;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BIcon.std((String)"file.png"); + } +} + diff --git a/modules/cfr_output/com/tridium/install/installable/BInstallable.java b/modules/cfr_output/com/tridium/install/installable/BInstallable.java new file mode 100644 index 0000000..e2cf997 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/BInstallable.java @@ -0,0 +1,507 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BIDirectory + * javax.baja.file.BIFile + * javax.baja.file.BLocalFileStore + * javax.baja.naming.BOrd + * javax.baja.naming.SlotPath + * javax.baja.nre.util.Array + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.SlotCursor + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.timezone.BTimeZone + */ +package com.tridium.install.installable; + +import com.tridium.install.BDaemonPlatform; +import com.tridium.install.BDependency; +import com.tridium.install.BVersion; +import com.tridium.install.PartSpec; +import com.tridium.install.installable.BDistribution; +import com.tridium.install.installable.BModuleInstallable; +import com.tridium.install.installable.LocalInstallableRegistry; +import com.tridium.install.part.BArchPart; +import com.tridium.install.part.BGenericPart; +import com.tridium.install.part.BModelPart; +import com.tridium.install.part.BOsPart; +import com.tridium.install.part.BPart; +import com.tridium.platform.daemon.BModuleContent; +import com.tridium.platform.daemon.file.StoreCache; +import com.tridium.platform.daemon.message.FileTransferMessageElement; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import com.tridium.platform.tcpip.BTcpIpHostSettings; +import java.io.File; +import java.util.TreeMap; +import javax.baja.file.BIDirectory; +import javax.baja.file.BIFile; +import javax.baja.file.BLocalFileStore; +import javax.baja.naming.BOrd; +import javax.baja.naming.SlotPath; +import javax.baja.nre.util.Array; +import javax.baja.platform.ICancelHint; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.SlotCursor; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.timezone.BTimeZone; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BInstallable +extends BComponent +implements Comparable { + public static final Property parts = BInstallable.newProperty((int)1, (BValue)new BVector(), null); + public static final Property dependencies = BInstallable.newProperty((int)1, (BValue)new BVector(), null); + public static final Property exclusions = BInstallable.newProperty((int)1, (BValue)new BVector(), null); + public static final Property installableName = BInstallable.newProperty((int)1, (String)"unknown", null); + public static final Property description = BInstallable.newProperty((int)1, (String)"", null); + public static final Property version = BInstallable.newProperty((int)1, (BValue)BVersion.makeZero(), null); + public static final Property installableFileOrd = BInstallable.newProperty((int)1, (BValue)BOrd.NULL, null); + public static final Property installableFileName = BInstallable.newProperty((int)1, (String)"unknown ", null); + public static final Property installableFileSize = BInstallable.newProperty((int)1, (int)-1, null); + public static final Property updateModuleContent = BInstallable.newProperty((int)1, (boolean)false, null); + public static final Property newModuleContent = BInstallable.newProperty((int)1, (BValue)BModuleContent.doc, null); + public static final Property newOsTimeZone = BInstallable.newProperty((int)1, (BValue)BTimeZone.NULL, null); + public static final Property isValid = BInstallable.newProperty((int)1, (boolean)true, null); + public static final Property isStandalone = BInstallable.newProperty((int)1, (boolean)false, null); + public static final Property isInstallable = BInstallable.newProperty((int)1, (boolean)true, null); + public static final Type TYPE; + public static final long FLAG_NO_RUNNING_APP = 1L; + public static final long FLAG_NO_RUNNING_STATION = 2L; + public static final long FLAG_UPDATE_RUNNING_STATION = 4L; + public static final long FLAG_REBOOT = 65536L; + public static final long FLAG_OS_INSTALL = 131072L; + public static final long FLAG_UPDATE_DAEMON = 262144L; + public static final long FLAG_UPDATE_TCPIP = 524288L; + public static final long FLAG_UPDATE_CONTENT = 0x100000L; + public static final long FLAG_UPDATE_OS_TZ = 0x200000L; + private PartSpec partSpec; + static /* synthetic */ Class class$com$tridium$install$installable$BInstallable; + static /* synthetic */ Class class$com$tridium$install$part$BPart; + static /* synthetic */ Class class$com$tridium$install$BDependency; + + public BVector getParts() { + return (BVector)this.get(parts); + } + + public void setParts(BVector bVector) { + this.set(parts, (BValue)bVector, null); + } + + public BVector getDependencies() { + return (BVector)this.get(dependencies); + } + + public void setDependencies(BVector bVector) { + this.set(dependencies, (BValue)bVector, null); + } + + public BVector getExclusions() { + return (BVector)this.get(exclusions); + } + + public void setExclusions(BVector bVector) { + this.set(exclusions, (BValue)bVector, null); + } + + public String getInstallableName() { + return this.getString(installableName); + } + + public void setInstallableName(String string) { + this.setString(installableName, string, null); + } + + public String getDescription() { + return this.getString(description); + } + + public void setDescription(String string) { + this.setString(description, string, null); + } + + public BVersion getVersion() { + return (BVersion)this.get(version); + } + + public void setVersion(BVersion bVersion) { + this.set(version, (BValue)bVersion, null); + } + + public BOrd getInstallableFileOrd() { + return (BOrd)this.get(installableFileOrd); + } + + public void setInstallableFileOrd(BOrd bOrd) { + this.set(installableFileOrd, (BValue)bOrd, null); + } + + public String getInstallableFileName() { + return this.getString(installableFileName); + } + + public void setInstallableFileName(String string) { + this.setString(installableFileName, string, null); + } + + public long getInstallableFileSize() { + return this.getLong(installableFileSize); + } + + public void setInstallableFileSize(long l) { + this.setLong(installableFileSize, l, null); + } + + public boolean getUpdateModuleContent() { + return this.getBoolean(updateModuleContent); + } + + public void setUpdateModuleContent(boolean bl) { + this.setBoolean(updateModuleContent, bl, null); + } + + public BModuleContent getNewModuleContent() { + return (BModuleContent)this.get(newModuleContent); + } + + public void setNewModuleContent(BModuleContent bModuleContent) { + this.set(newModuleContent, (BValue)bModuleContent, null); + } + + public BTimeZone getNewOsTimeZone() { + return (BTimeZone)this.get(newOsTimeZone); + } + + public void setNewOsTimeZone(BTimeZone bTimeZone) { + this.set(newOsTimeZone, (BValue)bTimeZone, null); + } + + public boolean getIsValid() { + return this.getBoolean(isValid); + } + + public void setIsValid(boolean bl) { + this.setBoolean(isValid, bl, null); + } + + public boolean getIsStandalone() { + return this.getBoolean(isStandalone); + } + + public void setIsStandalone(boolean bl) { + this.setBoolean(isStandalone, bl, null); + } + + public boolean getIsInstallable() { + return this.getBoolean(isInstallable); + } + + public void setIsInstallable(boolean bl) { + this.setBoolean(isInstallable, bl, null); + } + + public Type getType() { + return TYPE; + } + + public abstract long getProcessingFlags(BDaemonPlatform var1, DaemonSessionTaskListener var2); + + public abstract FileTransferMessageElement[] getTransferElements(BDaemonPlatform var1, StoreCache var2, ICancelHint var3, DaemonSessionTaskListener var4) throws Exception; + + public BInstallable makeInstallableForPart(String string) { + if (this.getParts().get(SlotPath.escape((String)string)) == null) { + return null; + } + return this; + } + + public BTcpIpHostSettings getTcpIpChanges() { + return null; + } + + public BPart getPart() { + SlotCursor slotCursor = this.getParts().getProperties(); + Class clazz = class$com$tridium$install$part$BPart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BPart = BInstallable.class("[Lcom.tridium.install.part.BPart;", false); + } + return slotCursor.next(clazz) ? (BPart)slotCursor.get() : null; + } + + public PartSpec getPartSpec() { + if (this.partSpec == null) { + BPart bPart = this.getPart(); + this.partSpec = bPart == null ? new PartSpec(this.getInstallableName(), this.getType()) : bPart.getPartSpec(); + } + return this.partSpec; + } + + public abstract void close() throws Exception; + + public abstract BInstallable makeLocalInstance(); + + protected void setInstallableFileProperties(BIFile bIFile) { + this.setInstallableFileOrd(bIFile.getOrdInSession()); + this.setInstallableFileName(bIFile.getFileName()); + this.setInstallableFileSize(bIFile.getSize()); + if (this.getInstallableName().equals("unknown")) { + this.setInstallableName(bIFile.getFileName()); + } + } + + public File getLocalInstallableFile() { + if (!this.getInstallableFileOrd().isNull()) { + try { + BIFile bIFile = (BIFile)this.getInstallableFileOrd().get(); + if (bIFile != null && bIFile.getStore() instanceof BLocalFileStore) { + return ((BLocalFileStore)bIFile.getStore()).getLocalFile(); + } + } + catch (Exception exception) {} + } + return null; + } + + public static boolean isInstallableFile(BIFile bIFile) { + if (bIFile == null || bIFile instanceof BIDirectory || bIFile.getExtension() == null) { + return false; + } + if (bIFile.getExtension().equals("dist")) { + return true; + } + if (bIFile.getExtension().equals("jar") || bIFile.getExtension().equals("sjar")) { + return true; + } + return LocalInstallableRegistry.getInstance().getInstallableTypeForExt(bIFile.getExtension()) != null; + } + + public static BInstallable make(BIFile bIFile) { + if (bIFile == null || bIFile instanceof BIDirectory || bIFile.getExtension() == null) { + return null; + } + if (bIFile.getExtension().equals("dist")) { + return BInstallable.make(BDistribution.TYPE, bIFile); + } + if (bIFile.getExtension().equals("jar") || bIFile.getExtension().equals("sjar")) { + return BInstallable.make(BModuleInstallable.TYPE, bIFile); + } + Type type = LocalInstallableRegistry.getInstance().getInstallableTypeForExt(bIFile.getExtension()); + if (type != null) { + return BInstallable.make(type, bIFile); + } + return null; + } + + public static BInstallable make(Type type, BIFile bIFile) { + BInstallable bInstallable = (BInstallable)type.getInstance(); + bInstallable.setInstallableFileProperties(bIFile); + return bInstallable.makeLocalInstance(); + } + + public static BInstallable makeRemote(BIFile bIFile) { + if (bIFile == null || bIFile instanceof BIDirectory || bIFile.getExtension() == null) { + return null; + } + if (bIFile.getExtension().equals("dist")) { + return BInstallable.makeRemote(BDistribution.TYPE, bIFile); + } + if (bIFile.getExtension().equals("jar") || bIFile.getExtension().equals("sjar")) { + return BInstallable.makeRemote(BModuleInstallable.TYPE, bIFile); + } + Type type = LocalInstallableRegistry.getInstance().getInstallableTypeForExt(bIFile.getExtension()); + if (type != null) { + return BInstallable.makeRemote(type, bIFile); + } + return null; + } + + public static BInstallable makeRemote(Type type, BIFile bIFile) { + BInstallable bInstallable = (BInstallable)type.getInstance(); + bInstallable.setInstallableFileProperties(bIFile); + return bInstallable; + } + + public final BDependency[] getAllDependencies() { + TreeMap treeMap = new TreeMap(); + BDependency[] bDependencyArray = this.getDependencies().getProperties(); + while (bDependencyArray.next()) { + this.updateDependencyMap(treeMap, (BDependency)bDependencyArray.get()); + } + bDependencyArray = this.getParts().getProperties(); + while (bDependencyArray.next()) { + BPart bPart = (BPart)bDependencyArray.get(); + SlotCursor slotCursor = bPart.getDependencies().getProperties(); + while (slotCursor.next()) { + this.updateDependencyMap(treeMap, (BDependency)slotCursor.get()); + } + } + bDependencyArray = new BDependency[treeMap.size()]; + treeMap.values().toArray(bDependencyArray); + return bDependencyArray; + } + + public BDependency[] getAllExclusions() { + Class clazz = class$com$tridium$install$BDependency; + if (clazz == null) { + clazz = class$com$tridium$install$BDependency = BInstallable.class("[Lcom.tridium.install.BDependency;", false); + } + Array array = new Array(clazz); + SlotCursor slotCursor = this.getExclusions().getProperties(); + while (slotCursor.next()) { + array.add((Object)slotCursor.get()); + } + return (BDependency[])array.trim(); + } + + private final void updateDependencyMap(TreeMap treeMap, BDependency bDependency) { + BDependency bDependency2 = (BDependency)((Object)treeMap.get(bDependency.getPartSpec())); + if (bDependency2 == null || bDependency.supersedes(bDependency2)) { + treeMap.put(bDependency.getPartSpec(), bDependency); + } + } + + public Array getUnmetPlatformDependencies(BDaemonPlatform bDaemonPlatform) { + Class clazz = class$com$tridium$install$BDependency; + if (clazz == null) { + clazz = class$com$tridium$install$BDependency = BInstallable.class("[Lcom.tridium.install.BDependency;", false); + } + Array array = new Array(clazz); + SlotCursor slotCursor = this.getDependencies().getProperties(); + while (slotCursor.next()) { + BDependency bDependency = (BDependency)slotCursor.get(); + Type type = bDependency.getPartType(); + if (type.is(BOsPart.TYPE)) { + if (bDaemonPlatform.getOsPart().matchesName(bDependency.getPartName())) { + if (bDaemonPlatform.getOsPart().isInstallable()) continue; + array.add((Object)bDependency.newCopy()); + continue; + } + if (bDaemonPlatform.meets(bDependency)) continue; + array.add((Object)bDependency.newCopy()); + continue; + } + if (!type.is(BArchPart.TYPE) && !type.is(BGenericPart.TYPE) && !type.is(BModelPart.TYPE) || bDaemonPlatform.meets(bDependency)) continue; + array.add((Object)bDependency.newCopy()); + } + return array; + } + + public boolean equivalent(Object object) { + if (object instanceof BInstallable) { + BInstallable bInstallable = (BInstallable)object; + return bInstallable.getInstallableFileOrd().equivalent((Object)this.getInstallableFileOrd()); + } + return false; + } + + public int compareTo(Object object) { + if (this.equivalent(object)) { + return 0; + } + if (object instanceof BInstallable) { + BInstallable bInstallable = (BInstallable)object; + if (this.getType().equals(bInstallable.getType())) { + int n = bInstallable.getInstallableName().compareTo(this.getInstallableName()); + if (n == 0) { + return this.getVersion().compareTo((Object)bInstallable.getVersion()); + } + return n; + } + return this.getType().toString().compareTo(bInstallable.getType().toString()); + } + return this.toString().compareTo(object.toString()); + } + + public final BPart getPart(String string) { + return this.getPart(string, null); + } + + /* + * Unable to fully structure code + */ + public BPart getPart(String var1_1, DaemonSessionTaskListener var2_2) { + block2: { + if (!BPart.isWildcardName(var1_1)) break block2; + var3_3 = this.getParts().getProperties(); + if (true) ** GOTO lbl7 + do { + if ((var4_4 = (BPart)var3_3.get()).matchesName(var1_1)) { + return var4_4; + } +lbl7: + // 3 sources + + if ((v0 = BInstallable.class$com$tridium$install$part$BPart) != null) continue; + v0 = BInstallable.class("[Lcom.tridium.install.part.BPart;", false); + } while (var3_3.next(v0)); + return null; + } + return (BPart)this.getParts().get(SlotPath.escape((String)var1_1)); + } + + public void registerInstallableResources(DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + } + + public final boolean meets(BDependency bDependency) { + return this.meets(bDependency, null); + } + + public boolean meets(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) { + BPart bPart = this.getPart(bDependency.getPartName(), daemonSessionTaskListener); + boolean bl = false; + if (bPart != null) { + bl = bPart.meets(bDependency); + } + return bl; + } + + public String toString(Context context) { + String string = this.getVersion().toString(context); + if (string.trim().length() == 0) { + return this.getInstallableName(); + } + return BVersion.nameVersionText.getText(context, new Object[]{this.getInstallableName(), string}); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.partSpec = null; + } + + public BInstallable() { + this.this(); + } + + static { + Class clazz = class$com$tridium$install$installable$BInstallable; + if (clazz == null) { + clazz = class$com$tridium$install$installable$BInstallable = BInstallable.class("[Lcom.tridium.install.installable.BInstallable;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/install/installable/BInstallableSpec.java b/modules/cfr_output/com/tridium/install/installable/BInstallableSpec.java new file mode 100644 index 0000000..a24ae4e --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/BInstallableSpec.java @@ -0,0 +1,169 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.io.BIEncodable + * javax.baja.nre.util.TextUtil + * javax.baja.sys.BObject + * javax.baja.sys.BStruct + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.BTypeSpec + * javax.baja.util.Version + */ +package com.tridium.install.installable; + +import com.tridium.install.BDependency; +import com.tridium.install.BVersion; +import com.tridium.install.installable.BInstallable; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import javax.baja.io.BIEncodable; +import javax.baja.nre.util.TextUtil; +import javax.baja.platform.install.BVersionRelation; +import javax.baja.sys.BObject; +import javax.baja.sys.BStruct; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.BTypeSpec; +import javax.baja.util.Version; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BInstallableSpec +extends BStruct +implements BIEncodable { + public static final Property installableName = BInstallableSpec.newProperty((int)1, (String)"", null); + public static final Property version = BInstallableSpec.newProperty((int)1, (BValue)new BVersion(), null); + public static final Property installableType = BInstallableSpec.newProperty((int)1, (BValue)BTypeSpec.NULL, null); + public static final Type TYPE; + public static final BInstallableSpec DEFAULT; + static /* synthetic */ Class class$com$tridium$install$installable$BInstallableSpec; + + public String getInstallableName() { + return this.getString(installableName); + } + + public void setInstallableName(String string) { + this.setString(installableName, string, null); + } + + public BVersion getVersion() { + return (BVersion)this.get(version); + } + + public void setVersion(BVersion bVersion) { + this.set(version, (BValue)bVersion, null); + } + + public BTypeSpec getInstallableType() { + return (BTypeSpec)this.get(installableType); + } + + public void setInstallableType(BTypeSpec bTypeSpec) { + this.set(installableType, (BValue)bTypeSpec, null); + } + + public Type getType() { + return TYPE; + } + + public static BInstallableSpec make(BInstallable bInstallable) { + return new BInstallableSpec(bInstallable.getInstallableName(), (BVersion)bInstallable.getVersion().newCopy(), bInstallable.getType()); + } + + public BDependency asDependency() { + return new BDependency(this.getInstallableName(), this.getVersion(), BVersionRelation.exact, this.getInstallableType()); + } + + public String toString(Context context) { + String string = this.getVersion().toString(context); + if (string.trim().length() == 0) { + return this.getInstallableName(); + } + return BVersion.nameVersionText.getText(context, new Object[]{this.getInstallableName(), string}); + } + + public void encode(DataOutput dataOutput) throws IOException { + dataOutput.writeUTF(this.getInstallableName()); + this.getVersion().encode(dataOutput); + this.getInstallableType().encode(dataOutput); + } + + public BObject decode(DataInput dataInput) throws IOException { + BInstallableSpec bInstallableSpec = new BInstallableSpec(); + bInstallableSpec.setInstallableName(dataInput.readUTF()); + bInstallableSpec.setVersion((BVersion)BVersion.ZERO.decode(dataInput)); + bInstallableSpec.setInstallableType((BTypeSpec)BTypeSpec.DEFAULT.decode(dataInput)); + return bInstallableSpec; + } + + public String encodeToString() throws IOException { + StringBuffer stringBuffer = new StringBuffer(128); + stringBuffer.append(this.getInstallableName()); + stringBuffer.append(';'); + stringBuffer.append(this.getVersion().getBajaVersionString()); + stringBuffer.append(';'); + stringBuffer.append(this.getVersion().getVendor()); + stringBuffer.append(';'); + stringBuffer.append(this.getVersion().getVendorVersionString()); + stringBuffer.append(';'); + stringBuffer.append(this.getInstallableType().encodeToString()); + return stringBuffer.toString(); + } + + public BObject decodeFromString(String string) throws IOException { + BInstallableSpec bInstallableSpec = new BInstallableSpec(); + String[] stringArray = TextUtil.split((String)string, (char)';'); + bInstallableSpec.setInstallableName(stringArray[0]); + bInstallableSpec.getVersion().setBajaVersionString(stringArray[1]); + bInstallableSpec.getVersion().setVendor(stringArray[2]); + bInstallableSpec.getVersion().setVendorVersionString(stringArray[3]); + bInstallableSpec.setInstallableType((BTypeSpec)BTypeSpec.DEFAULT.decodeFromString(stringArray[4])); + return bInstallableSpec; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BInstallableSpec() { + } + + public BInstallableSpec(String string, Version version, Type type) { + this(string, new BVersion(version.toString()), type); + } + + public BInstallableSpec(String string, BVersion bVersion, Type type) { + this.setInstallableName(string); + this.setVersion(bVersion); + this.setInstallableType(type.getTypeSpec()); + } + + static { + Class clazz = class$com$tridium$install$installable$BInstallableSpec; + if (clazz == null) { + clazz = class$com$tridium$install$installable$BInstallableSpec = BInstallableSpec.class("[Lcom.tridium.install.installable.BInstallableSpec;", false); + } + TYPE = Sys.loadType((Class)clazz); + DEFAULT = new BInstallableSpec(); + } +} + diff --git a/modules/cfr_output/com/tridium/install/installable/BModuleInstallable.java b/modules/cfr_output/com/tridium/install/installable/BModuleInstallable.java new file mode 100644 index 0000000..ace660b --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/BModuleInstallable.java @@ -0,0 +1,315 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.registry.NModuleInfo + * javax.baja.file.BFileSystem + * javax.baja.file.BIFile + * javax.baja.file.BLocalFileStore + * javax.baja.file.FilePath + * javax.baja.file.zip.BZipFile + * javax.baja.file.zip.BZipSpace + * javax.baja.naming.SlotPath + * javax.baja.naming.UnresolvedException + * javax.baja.sys.Action + * javax.baja.sys.BIcon + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.SlotCursor + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.install.installable; + +import com.tridium.install.BDaemonPlatform; +import com.tridium.install.BDependency; +import com.tridium.install.BVersion; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.part.BModulePart; +import com.tridium.platform.daemon.DaemonFileUtil; +import com.tridium.platform.daemon.file.StoreCache; +import com.tridium.platform.daemon.message.FileTransferMessageElement; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import com.tridium.sys.registry.NModuleInfo; +import java.io.InputStream; +import javax.baja.file.BFileSystem; +import javax.baja.file.BIFile; +import javax.baja.file.BLocalFileStore; +import javax.baja.file.FilePath; +import javax.baja.file.zip.BZipFile; +import javax.baja.file.zip.BZipSpace; +import javax.baja.naming.SlotPath; +import javax.baja.naming.UnresolvedException; +import javax.baja.platform.ICancelHint; +import javax.baja.sys.Action; +import javax.baja.sys.BIcon; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.SlotCursor; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BModuleInstallable +extends BInstallable { + public static final Action trace = BModuleInstallable.newAction((int)0, null); + public static final Type TYPE; + private static final BIcon icon; + private boolean localInstance; + private boolean dependsInitialized; + private RuntimeException throwMe; + static /* synthetic */ Class class$com$tridium$install$installable$BModuleInstallable; + + public void trace() { + this.invoke(trace, null, null); + } + + public Type getType() { + return TYPE; + } + + public BModulePart getModulePart() { + SlotCursor slotCursor = this.getParts().getProperties(); + slotCursor.next(); + return (BModulePart)slotCursor.get(); + } + + public BVector getDependencies() { + if (this.localInstance && !this.dependsInitialized) { + BVector bVector = (BVector)this.get(dependencies); + bVector.removeAll(); + SlotCursor slotCursor = this.getModulePart().getDependencies().getProperties(); + while (slotCursor.next()) { + bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy()); + } + bVector = (BVector)this.get(exclusions); + bVector.removeAll(); + slotCursor = this.getModulePart().getExclusions().getProperties(); + while (slotCursor.next()) { + bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy()); + } + this.dependsInitialized = true; + } + return super.getDependencies(); + } + + public BVector getExclusions() { + if (this.localInstance && !this.dependsInitialized) { + this.getDependencies(); + } + return super.getExclusions(); + } + + public void close() { + } + + public long getProcessingFlags(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener) { + if (bDaemonPlatform == null || !this.localInstance || this.getInstallableName().equals("baja") || this.getModulePart().getManifest().noRunningStation()) { + return 2; + } + bDaemonPlatform.getModuleList().init(daemonSessionTaskListener); + if (bDaemonPlatform.getModuleList().meets(BDependency.forModule(this.getInstallableName()))) { + return 2; + } + return 4; + } + + public FileTransferMessageElement[] getTransferElements(BDaemonPlatform bDaemonPlatform, StoreCache storeCache, ICancelHint iCancelHint, DaemonSessionTaskListener daemonSessionTaskListener) { + if (!this.localInstance) { + throw new IllegalStateException("illegal call on proxy instance of BModuleInstallable"); + } + return new FileTransferMessageElement[]{this.getModulePart().makeTransferElement(bDaemonPlatform)}; + } + + public BInstallable makeLocalInstance() { + if (this.localInstance) { + return this; + } + try { + return BModuleInstallable.make((BIFile)this.getInstallableFileOrd().get()); + } + catch (UnresolvedException unresolvedException) { + return null; + } + } + + public boolean equivalent(Object object) { + if (object instanceof BModuleInstallable) { + BModuleInstallable bModuleInstallable = (BModuleInstallable)object; + boolean bl = false; + if (bModuleInstallable.getInstallableName().equals(this.getInstallableName()) && bModuleInstallable.getVersion().equivalent((Object)this.getVersion())) { + bl = true; + } + return bl; + } + return false; + } + + public static BInstallable make(BIFile bIFile) { + return BModuleInstallable.make(bIFile, true); + } + + public static BModuleInstallable make(NModuleInfo nModuleInfo) { + FilePath filePath = BModulePart.MODULES_PATH.merge(nModuleInfo.getModuleName() + ".jar"); + BIFile bIFile = BFileSystem.INSTANCE.findFile(filePath); + if (bIFile == null && (bIFile = BFileSystem.INSTANCE.findFile(filePath = BModulePart.MODULES_PATH.merge(nModuleInfo.getModuleName() + ".sjar"))) == null) { + return null; + } + return new BModuleInstallable(bIFile, nModuleInfo); + } + + public static BModuleInstallable make(BIFile bIFile, boolean bl) { + return BModuleInstallable.make(bIFile, bl, true); + } + + public static BModuleInstallable make(BIFile bIFile, boolean bl, boolean bl2) { + InputStream inputStream = null; + try { + if (bIFile.getStore() instanceof BLocalFileStore) { + BZipFile bZipFile = bIFile instanceof BZipFile ? (BZipFile)bIFile : new BZipFile(bIFile.getStore()); + BZipSpace bZipSpace = (BZipSpace)bZipFile.open(); + BIFile bIFile2 = bZipSpace.findFile(new FilePath("META-INF/module.xml")); + if (bIFile2 == null && (bIFile2 = bZipSpace.findFile(new FilePath("meta-inf/module.xml"))) == null) { + try { + bZipFile.close(); + } + catch (Exception exception) {} + inputStream = null; + } + inputStream = new DaemonFileUtil.ZipEntryInputStream(bZipFile, bIFile2); + } else { + inputStream = DaemonFileUtil.getZipStream(bIFile, new FilePath("META-INF/module.xml")); + if (inputStream == null) { + inputStream = DaemonFileUtil.getZipStream(bIFile, new FilePath("meta-inf/module.xml")); + } + } + if (inputStream == null) { + if (bl) { + return new BModuleInstallable(bIFile, null); + } + return null; + } + return new BModuleInstallable(bIFile, inputStream, bl2); + } + catch (Exception exception) { + return new BModuleInstallable(bIFile, null); + } + } + + public void doTrace() { + throw this.throwMe; + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.localInstance = false; + this.dependsInitialized = false; + } + + public BModuleInstallable() { + this.this(); + this.throwMe = new RuntimeException("check"); + } + + private BModuleInstallable(BIFile bIFile, NModuleInfo nModuleInfo) { + this.this(); + this.throwMe = new RuntimeException("check"); + this.setInstallableFileProperties(bIFile); + BModulePart bModulePart = new BModulePart(bIFile, nModuleInfo, (BInstallable)this); + bModulePart.setInstallable(this); + this.setInstallableName(bModulePart.getPartName()); + this.getParts().add(SlotPath.escape((String)bModulePart.getPartName()), (BValue)bModulePart); + this.setDescription(bModulePart.getDescription()); + this.setVersion((BVersion)bModulePart.getVersion().newCopy()); + this.localInstance = true; + } + + private BModuleInstallable(BIFile bIFile, InputStream inputStream) { + this(bIFile, inputStream, true); + } + + private BModuleInstallable(BIFile bIFile, InputStream inputStream, boolean bl) { + this.this(); + this.throwMe = new RuntimeException("check"); + this.setInstallableFileProperties(bIFile); + BModulePart bModulePart = new BModulePart(bIFile, inputStream, this, bl); + bModulePart.setInstallable(this); + this.setInstallableName(bModulePart.getPartName()); + this.getParts().add(SlotPath.escape((String)bModulePart.getPartName()), (BValue)bModulePart); + this.setDescription(bModulePart.getDescription()); + this.setVersion((BVersion)bModulePart.getVersion().newCopy()); + BVector bVector = (BVector)this.get(dependencies); + bVector.removeAll(); + SlotCursor slotCursor = bModulePart.getDependencies().getProperties(); + while (slotCursor.next()) { + bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy()); + } + bVector = (BVector)this.get(exclusions); + bVector.removeAll(); + slotCursor = bModulePart.getExclusions().getProperties(); + while (slotCursor.next()) { + bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy()); + } + this.setIsInstallable(bModulePart.getIsInstallable()); + this.dependsInitialized = true; + this.localInstance = true; + } + + public BModuleInstallable(long l, String string, XElem xElem) { + this.this(); + this.throwMe = new RuntimeException("check"); + this.setInstallableFileName(string); + this.setInstallableFileSize(l); + BModulePart bModulePart = BModulePart.make(string.substring(0, string.length() - 4), xElem); + this.setInstallableName(bModulePart.getPartName()); + bModulePart.setFileSize(l); + bModulePart.setInstallable(this); + this.getParts().add(SlotPath.escape((String)bModulePart.getPartName()), (BValue)bModulePart); + this.setDescription(bModulePart.getDescription()); + this.setVersion((BVersion)bModulePart.getVersion().newCopy()); + BVector bVector = (BVector)this.get(dependencies); + bVector.removeAll(); + SlotCursor slotCursor = bModulePart.getDependencies().getProperties(); + while (slotCursor.next()) { + bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy()); + } + bVector = (BVector)this.get(exclusions); + bVector.removeAll(); + slotCursor = bModulePart.getExclusions().getProperties(); + while (slotCursor.next()) { + bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy()); + } + this.setIsInstallable(bModulePart.getIsInstallable()); + this.dependsInitialized = true; + } + + static { + Class clazz = class$com$tridium$install$installable$BModuleInstallable; + if (clazz == null) { + clazz = class$com$tridium$install$installable$BModuleInstallable = BModuleInstallable.class("[Lcom.tridium.install.installable.BModuleInstallable;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BIcon.std((String)"module.png"); + } +} + diff --git a/modules/cfr_output/com/tridium/install/installable/BundleManifest.java b/modules/cfr_output/com/tridium/install/installable/BundleManifest.java new file mode 100644 index 0000000..a015a27 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/BundleManifest.java @@ -0,0 +1,532 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.FilePath + * javax.baja.nre.util.Array + * javax.baja.nre.util.TextUtil + * javax.baja.sys.BAbsTime + * javax.baja.util.BTypeSpec + * javax.baja.xml.XContent + * javax.baja.xml.XElem + * javax.baja.xml.XWriter + */ +package com.tridium.install.installable; + +import com.tridium.install.BDependency; +import com.tridium.install.BVersion; +import com.tridium.install.installable.BDistribution; +import com.tridium.install.part.BBrandPart; +import com.tridium.install.part.BGenericPart; +import com.tridium.install.part.BPart; +import java.io.IOException; +import java.io.OutputStream; +import javax.baja.file.FilePath; +import javax.baja.nre.util.Array; +import javax.baja.nre.util.TextUtil; +import javax.baja.platform.install.BFileReconciler; +import javax.baja.platform.install.BVersionRelation; +import javax.baja.sys.BAbsTime; +import javax.baja.util.BTypeSpec; +import javax.baja.xml.XContent; +import javax.baja.xml.XElem; +import javax.baja.xml.XWriter; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BundleManifest { + public static final int REPLACE_DEFAULT = -1; + public static final int REPLACE_NEVER = 0; + public static final int REPLACE_ALWAYS = 1; + public static final int REPLACE_CRC = 2; + public static final int DO_NOT_COPY = 3; + public static final int REPLACE_HOSTID = 4; + private static String[] replaceString = new String[]{"never", "always", "crc", "nocopy", "hostid"}; + protected XElem rootElem; + protected XElem fileHandlingElem; + protected XElem depsElem; + protected XElem exclElem; + protected XElem providesElem; + protected XElem resourcesElem; + static /* synthetic */ Class class$com$tridium$install$installable$BundleManifest$FileHandlingRule; + static /* synthetic */ Class class$com$tridium$install$BDependency; + static /* synthetic */ Class class$com$tridium$install$part$BPart; + + public void write(OutputStream outputStream) throws IOException { + XWriter xWriter = new XWriter(outputStream); + this.rootElem.write(xWriter); + xWriter.flush(); + } + + public String getBuildDate() { + return this.rootElem.get("buildDate", ""); + } + + public void setBuildDate(BAbsTime bAbsTime) { + if (bAbsTime != null) { + this.rootElem.setAttr("buildDate", bAbsTime.toString()); + } + } + + public String getBuildHost() { + return this.rootElem.get("buildHost", ""); + } + + public void setBuildHost(String string) { + this.rootElem.setAttr("buildHost", string); + } + + public String getDescription() { + return this.rootElem.get("description", ""); + } + + public void setDescription(String string) { + this.rootElem.setAttr("description", string); + } + + public String getInstallableName() { + return this.rootElem.get("name", ""); + } + + public void setInstallableName(String string) { + this.rootElem.setAttr("name", string); + } + + public BVersion getInstallableVersion() { + return new BVersion(this.rootElem.get("vendor", ""), this.rootElem.get("version", "")); + } + + public void setInstallableVersion(BVersion bVersion) { + this.rootElem.setAttr("vendor", bVersion.getVendor()); + this.rootElem.setAttr("version", bVersion.getVendorVersionString()); + } + + public boolean useAbsoluteElementPaths() { + return this.rootElem.getb("absoluteElementPaths", false); + } + + public void setUseAbsoluteElementPaths(boolean bl) { + this.rootElem.setAttr("absoluteElementPaths", String.valueOf(bl)); + } + + public int getDefaultReplaceRule() { + String string = this.fileHandlingElem.get("replace", "crc"); + int n = 0; + while (n < replaceString.length) { + if (replaceString[n].equals(string)) { + return n; + } + ++n; + } + return 2; + } + + public void setDefaultReplaceRule(int n) { + this.fileHandlingElem.setAttr("replace", replaceString[n]); + } + + public FileHandlingRule[] getFileHandlingRules() { + XElem[] xElemArray = this.fileHandlingElem.elems(); + Class clazz = class$com$tridium$install$installable$BundleManifest$FileHandlingRule; + if (clazz == null) { + clazz = class$com$tridium$install$installable$BundleManifest$FileHandlingRule = BundleManifest.class("[Lcom.tridium.install.installable.BundleManifest$FileHandlingRule;", false); + } + Array array = new Array(clazz); + int n = 0; + while (n < xElemArray.length) { + if (xElemArray[n].name().equals("dir")) { + array.add((Object)new DirHandlingRule(xElemArray[n].get("name"), xElemArray[n].get("replace", null), xElemArray[n].getb("clean", false))); + } else if (xElemArray[n].name().equals("file")) { + array.add((Object)new FileHandlingRule(xElemArray[n].get("name"), xElemArray[n].get("replace", null))); + } else if (xElemArray[n].name().equals("remove")) { + array.add((Object)new RemoveRule(xElemArray[n].get("name"))); + } else { + throw new IllegalStateException("unrecognized file handling rule type '" + xElemArray[n].name() + '\''); + } + ++n; + } + xElemArray = this.resourcesElem.elems(); + n = 0; + while (n < xElemArray.length) { + if (xElemArray[n].get("content", null) != null) { + array.add((Object)new FileHandlingRule(xElemArray[n].get("content"), "nocopy")); + } + ++n; + } + return (FileHandlingRule[])array.trim(); + } + + public void addFileToRemove(String string) { + XElem xElem = new XElem("remove"); + xElem.setAttr("name", string); + this.fileHandlingElem.addContent((XContent)xElem); + } + + public void addDir(String string, boolean bl) { + this.addDir(string, -1, bl); + } + + public void addDir(String string, int n) { + this.addDir(string, n, false); + } + + public void addDir(String string, int n, boolean bl) { + XElem xElem = new XElem("dir"); + xElem.setAttr("name", string); + if (n >= 0) { + xElem.setAttr("replace", replaceString[n]); + } + if (bl) { + xElem.setAttr("clean", "true"); + } + this.fileHandlingElem.addContent((XContent)xElem); + } + + public void addFile(String string) { + this.addFile(string, -1); + } + + public void addFile(String string, int n) { + XElem xElem = new XElem("file"); + xElem.setAttr("name", string); + if (n >= 0) { + xElem.setAttr("replace", replaceString[n]); + } + this.fileHandlingElem.addContent((XContent)xElem); + } + + public void addFile(String string, BTypeSpec bTypeSpec, int n) { + XElem xElem = new XElem("file"); + xElem.setAttr("name", string); + if (n == -1) { + xElem.setAttr("replace", "reconcile:" + bTypeSpec.toString()); + } else { + xElem.setAttr("replace", "reconcile:" + bTypeSpec.toString() + ':' + replaceString[n]); + } + this.fileHandlingElem.addContent((XContent)xElem); + } + + public BDependency[] getDependencies() { + XElem[] xElemArray = this.depsElem.elems(); + Class clazz = class$com$tridium$install$BDependency; + if (clazz == null) { + clazz = class$com$tridium$install$BDependency = BundleManifest.class("[Lcom.tridium.install.BDependency;", false); + } + Array array = new Array(clazz); + int n = 0; + while (n < xElemArray.length) { + BDependency bDependency = BDependency.make(xElemArray[n]); + if (!(bDependency == null || bDependency.getPartTypeSpec().equals((Object)BBrandPart.TYPE.getTypeSpec()) && (bDependency.getPartName().equals("noBrand") || bDependency.getPartName().equals("nullos") || bDependency.getPartName().equals("disabled")))) { + if (bDependency.getVersionRelation() == BVersionRelation.exact && bDependency.getPartTypeSpec().equals((Object)BGenericPart.TYPE.getTypeSpec()) && this.providesElem.elems().length == 0) { + bDependency.setVersion(BVersion.makeZero()); + bDependency.setVersionRelation(BVersionRelation.minimum); + } + array.add((Object)bDependency); + } + ++n; + } + return (BDependency[])array.trim(); + } + + public BDependency[] getExclusions() { + XElem[] xElemArray = this.exclElem.elems(); + Class clazz = class$com$tridium$install$BDependency; + if (clazz == null) { + clazz = class$com$tridium$install$BDependency = BundleManifest.class("[Lcom.tridium.install.BDependency;", false); + } + Array array = new Array(clazz); + int n = 0; + while (n < xElemArray.length) { + BDependency bDependency = BDependency.make(xElemArray[n]); + if (bDependency != null) { + array.add((Object)bDependency); + } + ++n; + } + return (BDependency[])array.trim(); + } + + public void addDependency(BDependency bDependency) { + this.depsElem.addContent((XContent)bDependency.getXml()); + } + + public void addExclusion(BDependency bDependency) { + this.exclElem.addContent((XContent)bDependency.getXml()); + } + + public InstallableResourceMetadata[] getInstallableResources() { + XElem[] xElemArray = this.resourcesElem.elems("installable"); + InstallableResourceMetadata[] installableResourceMetadataArray = new InstallableResourceMetadata[xElemArray.length]; + int n = 0; + while (n < xElemArray.length) { + installableResourceMetadataArray[n] = new InstallableResourceMetadata(xElemArray[n]); + ++n; + } + return installableResourceMetadataArray; + } + + public BPart[] getProvidedParts(BDistribution bDistribution) { + XElem[] xElemArray = this.providesElem.elems(); + Class clazz = class$com$tridium$install$part$BPart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BPart = BundleManifest.class("[Lcom.tridium.install.part.BPart;", false); + } + Array array = new Array(clazz); + int n = 0; + while (n < xElemArray.length) { + BPart bPart = BPart.makePart(xElemArray[n], bDistribution); + if (bPart != null) { + array.add((Object)bPart); + } + ++n; + } + return (BPart[])array.trim(); + } + + public void addProvidedPart(BPart bPart) { + this.providesElem.addContent((XContent)bPart.getXml()); + } + + public String getEntryPath(FilePath filePath, String string) { + FilePath filePath2 = this.getNormalFilePath(filePath, string); + return filePath2 == null ? null : this.getEntryPath(filePath2); + } + + /* + * Enabled force condition propagation + * Lifted jumps to return sites + */ + public String getEntryPath(FilePath filePath) { + StringBuffer stringBuffer = new StringBuffer(); + if (filePath.isSysHomeAbsolute()) { + if (this.useAbsoluteElementPaths()) { + stringBuffer.append("niagara"); + } + int n = 0; + while (n < filePath.depth()) { + if (stringBuffer.length() > 0) { + stringBuffer.append('/'); + } + stringBuffer.append(filePath.nameAt(n)); + if (n == 0 && filePath.nameAt(n).equals("bin")) { + stringBuffer.append("/stage"); + } + ++n; + } + return stringBuffer.toString(); + } else { + if (!filePath.isLocalAbsolute()) throw new IllegalArgumentException("error with path " + filePath.getBody() + ": only local and system home absolute paths supported"); + if (!this.useAbsoluteElementPaths()) throw new IllegalArgumentException("error with path " + filePath.getBody() + ": local absolute paths unsupported"); + int n = 0; + while (n < filePath.depth()) { + if (stringBuffer.length() > 0) { + stringBuffer.append('/'); + } + stringBuffer.append(filePath.nameAt(n)); + ++n; + } + } + return stringBuffer.toString(); + } + + public FilePath getNormalFilePath(FilePath filePath) { + return this.getNormalFilePath(filePath, null); + } + + public FilePath getNormalFilePath(FilePath filePath, String string) { + if (filePath.isStationHomeAbsolute()) { + if (string == null) { + return null; + } + FilePath filePath2 = new FilePath("!stations"); + filePath2 = filePath2.merge(string); + int n = 0; + while (n < filePath.depth()) { + filePath2 = filePath2.merge(filePath.nameAt(n)); + ++n; + } + return filePath2; + } + if (filePath.isSysHomeAbsolute()) { + return filePath; + } + if (filePath.isLocalAbsolute()) { + if (this.useAbsoluteElementPaths()) { + return filePath; + } + return null; + } + return null; + } + + static /* synthetic */ String[] access$0() { + return replaceString; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + protected BundleManifest(XElem xElem) throws Exception { + this.rootElem = xElem.copy(); + this.fileHandlingElem = this.rootElem.elem("fileHandling"); + if (this.fileHandlingElem == null) { + this.fileHandlingElem = new XElem("fileHandling"); + this.rootElem.addContent((XContent)this.fileHandlingElem); + } + this.depsElem = this.rootElem.elem("dependencies"); + if (this.depsElem == null) { + this.depsElem = new XElem("dependencies"); + xElem.addContent((XContent)this.depsElem); + } + this.providesElem = this.rootElem.elem("provides"); + if (this.providesElem == null) { + this.providesElem = new XElem("provides"); + this.rootElem.addContent((XContent)this.providesElem); + } + this.exclElem = this.rootElem.elem("exclusions"); + if (this.exclElem == null) { + this.exclElem = new XElem("exclusions"); + xElem.addContent((XContent)this.exclElem); + } + this.resourcesElem = this.rootElem.elem("resources"); + if (this.resourcesElem == null) { + this.resourcesElem = new XElem("resources"); + xElem.addContent((XContent)this.resourcesElem); + } + } + + protected BundleManifest() { + this.rootElem = new XElem("dist"); + this.fileHandlingElem = new XElem("fileHandling"); + this.rootElem.addContent((XContent)this.fileHandlingElem); + this.depsElem = new XElem("dependencies"); + this.rootElem.addContent((XContent)this.depsElem); + this.exclElem = new XElem("exclusions"); + this.rootElem.addContent((XContent)this.exclElem); + this.providesElem = new XElem("provides"); + this.rootElem.addContent((XContent)this.providesElem); + this.resourcesElem = new XElem("resources"); + this.rootElem.addContent((XContent)this.resourcesElem); + } + + public static class DirHandlingRule + extends FileHandlingRule { + public boolean clean; + + public DirHandlingRule(String string, String string2, boolean bl) { + super(string, string2); + this.clean = bl; + } + + public DirHandlingRule(String string, int n, boolean bl) { + super(string, n); + this.clean = bl; + } + } + + public static class FileHandlingRule { + public String entryPath; + public int replaceRule; + public BFileReconciler reconciler; + + /* + * Unable to fully structure code + * Enabled force condition propagation + * Lifted jumps to return sites + */ + public FileHandlingRule(String var1_1, String var2_2) { + super(); + this.entryPath = var1_1; + this.replaceRule = -1; + if (var2_2 == null || var2_2.trim().length() <= 0) return; + var3_3 = TextUtil.split((String)var2_2, (char)':'); + if (var3_3[0].equals("reconcile")) { + try { + this.reconciler = (BFileReconciler)BTypeSpec.make((String)var3_3[1], (String)var3_3[2]).getInstance(); + return; + } + catch (Exception var4_4) { + if (var3_3.length <= 3) return; + var5_6 = 0; + ** while (var5_6 < BundleManifest.access$0().length) + } +lbl-1000: + // 1 sources + + { + if (BundleManifest.access$0()[var5_6].equals(var3_3[3])) { + this.replaceRule = var5_6; + return; + } else { + ++var5_6; + continue; + } +lbl19: + // 1 sources + + return; + } + } + var4_5 = 0; + while (var4_5 < BundleManifest.access$0().length) { + if (BundleManifest.access$0()[var4_5].equals(var2_2)) { + this.replaceRule = var4_5; + return; + } + ++var4_5; + } + } + + public FileHandlingRule(String string, int n) { + this.entryPath = string; + this.replaceRule = n; + } + } + + public static class RemoveRule + extends FileHandlingRule { + public RemoveRule(String string) { + super(string, -1); + } + } + + public static class InstallableResourceMetadata { + public XElem elem; + + public String getContentEntryPath() { + return this.elem.get("content"); + } + + public String getInstallableName() { + return this.elem.get("name"); + } + + public String getProvidedPartType() { + return this.elem.get("type"); + } + + public BVersion getVersion() { + return new BVersion(this.elem.get("vendor", ""), this.elem.get("vendorVersion")); + } + + public XElem makeDependencyElem() { + return new XElem(this.elem.get("type")).addAttr("name", this.elem.get("name")).addAttr("vendor", this.elem.get("vendor", "")).addAttr("version", this.elem.get("vendorVersion")).addAttr("rel", "exact"); + } + + public InstallableResourceMetadata(XElem xElem) { + this.elem = xElem; + } + } +} + diff --git a/modules/cfr_output/com/tridium/install/installable/ClosableCursor.java b/modules/cfr_output/com/tridium/install/installable/ClosableCursor.java new file mode 100644 index 0000000..ddd0e32 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/ClosableCursor.java @@ -0,0 +1,15 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.Cursor + */ +package com.tridium.install.installable; + +import javax.baja.sys.Cursor; + +public interface ClosableCursor +extends Cursor { + public void close(); +} + diff --git a/modules/cfr_output/com/tridium/install/installable/CursorUtil.java b/modules/cfr_output/com/tridium/install/installable/CursorUtil.java new file mode 100644 index 0000000..cbc475b --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/CursorUtil.java @@ -0,0 +1,224 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nre.util.Array + * javax.baja.sys.BObject + * javax.baja.sys.Context + * javax.baja.sys.Cursor + */ +package com.tridium.install.installable; + +import com.tridium.install.installable.ClosableCursor; +import java.util.Collection; +import java.util.Iterator; +import javax.baja.nre.util.Array; +import javax.baja.sys.BObject; +import javax.baja.sys.Context; +import javax.baja.sys.Cursor; + +public class CursorUtil { + public static ClosableCursor closable(Cursor cursor) { + return cursor instanceof ClosableCursor ? (ClosableCursor)cursor : new Closable(cursor); + } + + public static Cursor cursor(Collection collection) { + return CursorUtil.cursor(collection, null); + } + + public static Cursor cursor(Collection collection, Context context) { + return CursorUtil.cursor(collection.iterator(), context); + } + + public static Cursor cursor(Iterator iterator) { + return CursorUtil.cursor(iterator, null); + } + + public static Cursor cursor(Iterator iterator, Context context) { + return new IteratorCursor(iterator, context); + } + + public static Cursor cursor(Object[] objectArray) { + return CursorUtil.cursor(objectArray, null); + } + + public static Cursor cursor(Object[] objectArray, Context context) { + return CursorUtil.cursor(new Array(objectArray), context); + } + + public static Cursor cursor(Array array) { + return CursorUtil.cursor(array, null); + } + + public static Cursor cursor(Array array, Context context) { + return new ArrayCursor(array, context); + } + + public static class Closable + implements ClosableCursor { + private Cursor innerCursor; + + public Context getContext() { + return this.innerCursor.getContext(); + } + + public boolean next() { + return this.innerCursor.next(); + } + + public boolean nextComponent() { + return this.innerCursor.nextComponent(); + } + + public boolean next(Class clazz) { + return this.innerCursor.next(clazz); + } + + public BObject get() { + return this.innerCursor.get(); + } + + public void close() { + } + + public Closable(Cursor cursor) { + this.innerCursor = cursor; + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public static class IteratorCursor + implements Cursor { + private Iterator i; + private BObject current; + private Context cx; + static /* synthetic */ Class class$javax$baja$sys$BComponent; + + public Context getContext() { + return this.cx; + } + + public boolean next() { + if (this.i.hasNext()) { + this.current = (BObject)this.i.next(); + return true; + } + return false; + } + + public boolean nextComponent() { + Class clazz = class$javax$baja$sys$BComponent; + if (clazz == null) { + clazz = class$javax$baja$sys$BComponent = IteratorCursor.class("[Ljavax.baja.sys.BComponent;", false); + } + return this.next(clazz); + } + + public boolean next(Class clazz) { + while (this.next()) { + if (!clazz.isAssignableFrom(this.current.getClass())) continue; + return true; + } + return false; + } + + public BObject get() { + return this.current; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.current = null; + } + + public IteratorCursor(Iterator iterator, Context context) { + this.this(); + this.i = iterator; + this.cx = context; + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public static class ArrayCursor + implements Cursor { + private int index; + private Array a; + private Context cx; + static /* synthetic */ Class class$javax$baja$sys$BComponent; + + public Context getContext() { + return this.cx; + } + + public boolean next() { + if (this.index >= this.a.size() - 1) { + return false; + } + ++this.index; + return true; + } + + public boolean nextComponent() { + Class clazz = class$javax$baja$sys$BComponent; + if (clazz == null) { + clazz = class$javax$baja$sys$BComponent = ArrayCursor.class("[Ljavax.baja.sys.BComponent;", false); + } + return this.next(clazz); + } + + public boolean next(Class clazz) { + while (this.next()) { + if (!clazz.isAssignableFrom(this.get().getClass())) continue; + return true; + } + return false; + } + + public BObject get() { + if (this.index < 0 || this.index >= this.a.size()) { + return null; + } + return (BObject)this.a.get(this.index); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.index = -1; + } + + public ArrayCursor(Array array, Context context) { + this.this(); + this.a = array; + this.cx = context; + } + } +} + diff --git a/modules/cfr_output/com/tridium/install/installable/DistributionManifest.java b/modules/cfr_output/com/tridium/install/installable/DistributionManifest.java new file mode 100644 index 0000000..d064d07 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/DistributionManifest.java @@ -0,0 +1,326 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BIFile + * javax.baja.nre.util.Array + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.timezone.BTimeZone + * javax.baja.util.Version + * javax.baja.xml.XContent + * javax.baja.xml.XElem + * javax.baja.xml.XParser + */ +package com.tridium.install.installable; + +import com.tridium.install.BDependency; +import com.tridium.install.BVersion; +import com.tridium.install.installable.BundleManifest; +import com.tridium.install.part.BNrePart; +import com.tridium.install.part.BOsPart; +import com.tridium.install.part.BPart; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.daemon.BModuleContent; +import com.tridium.platform.tcpip.BTcpIpHostSettings; +import com.tridium.platform.tcpip.BTcpIpPlatformService; +import com.tridium.platform.tcpip.TcpUtil; +import java.io.InputStream; +import javax.baja.file.BIFile; +import javax.baja.nre.util.Array; +import javax.baja.platform.install.BVersionRelation; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.timezone.BTimeZone; +import javax.baja.util.Version; +import javax.baja.xml.XContent; +import javax.baja.xml.XElem; +import javax.baja.xml.XParser; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class DistributionManifest +extends BundleManifest { + private XElem platformElem; + private XElem tcpIpElem; + static /* synthetic */ Class class$com$tridium$install$BDependency; + + public static DistributionManifest make() { + return new DistributionManifest(); + } + + public static DistributionManifest make(InputStream inputStream) throws Exception { + return DistributionManifest.make(inputStream, true); + } + + public static DistributionManifest make(InputStream inputStream, boolean bl) throws Exception { + return DistributionManifest.make(XParser.make((InputStream)inputStream).parse(bl)); + } + + public static DistributionManifest make(XElem xElem) throws Exception { + return new DistributionManifest(xElem); + } + + public boolean isDaemonBinaryUpdateRequired() { + return this.rootElem.getb("updateDaemonBinaries", false); + } + + public void setDaemonBinaryUpdateRequired(boolean bl) { + this.rootElem.setAttr("updateDaemonBinaries", String.valueOf(bl)); + } + + public boolean noRunningStation() { + boolean bl = true; + if (!this.noRunningApp()) { + bl = this.rootElem.getb("noRunningStation", false); + } + return bl; + } + + public void setNoRunningStation(boolean bl) { + this.rootElem.setAttr("noRunningStation", String.valueOf(bl)); + } + + public boolean noRunningApp() { + return this.rootElem.getb("noRunningApp", this.rootElem.getb("noStation", false)); + } + + public void setNoRunningApp(boolean bl) { + this.rootElem.setAttr("noRunningApp", String.valueOf(bl)); + this.rootElem.setAttr("noStation", String.valueOf(bl)); + } + + public String getHostId() { + return this.rootElem.get("hostId", null); + } + + public void setHostId(String string) { + if (string != null) { + this.rootElem.setAttr("hostId", string); + } + } + + public boolean isOsUpdateRequired() { + return this.rootElem.getb("osInstall", false); + } + + public void setOsUpdateRequired(boolean bl) { + this.rootElem.setAttr("osInstall", String.valueOf(bl)); + } + + public boolean isStandalone() { + return this.rootElem.getb("standalone", false); + } + + public void setIsStandalone(boolean bl) { + this.rootElem.setAttr("standalone", String.valueOf(bl)); + } + + public boolean isRebootRequired() { + return this.rootElem.getb("reboot", false); + } + + public void setRebootRequired(boolean bl) { + this.rootElem.setAttr("reboot", String.valueOf(bl)); + } + + public boolean ignoreDefaultExclusions() { + return this.rootElem.getb("ignoreDefaultExclusions", false); + } + + public void setIgnoreDefaultExclusions(boolean bl) { + this.rootElem.setAttr("ignoreDefaultExclusions", String.valueOf(bl)); + } + + public void setTargetOs(BOsPart bOsPart) { + this.setUseAbsoluteElementPaths(bOsPart.allowGlobalFileAccess()); + } + + public BModuleContent getUpdateModuleContent() { + String string = this.rootElem.get("setInstallFlag", null); + if (string == null) { + return null; + } + return BModuleContent.make(string); + } + + public void setUpdateModuleContent(BModuleContent bModuleContent) { + this.rootElem.setAttr("setInstallFlag", bModuleContent.getTag()); + } + + public void setNewOsTimeZone(BTimeZone bTimeZone) throws Exception { + if (bTimeZone == null) { + bTimeZone = BTimeZone.NULL; + } + this.rootElem.setAttr("osTimeZone", bTimeZone.encodeToString()); + } + + public BTimeZone getNewOsTimeZone() { + String string = this.rootElem.get("osTimeZone", null); + if (string == null) { + return BTimeZone.NULL; + } + try { + return (BTimeZone)BTimeZone.DEFAULT.decodeFromString(string); + } + catch (Exception exception) { + exception.printStackTrace(); + return BTimeZone.NULL; + } + } + + public BDependency[] getExclusions() { + Class clazz = class$com$tridium$install$BDependency; + if (clazz == null) { + clazz = class$com$tridium$install$BDependency = DistributionManifest.class("[Lcom.tridium.install.BDependency;", false); + } + Array array = new Array(clazz); + array.addAll((Object[])super.getExclusions()); + if (!this.ignoreDefaultExclusions()) { + BPart[] bPartArray = this.getProvidedParts(null); + if (bPartArray.length > 0) { + this.addDefaultOsExclusions(bPartArray[0], array); + this.addDefaultNreCoreExclusions(bPartArray[0], array); + } + this.addDefaultNreConfigExclusions(array); + } + return (BDependency[])array.trim(); + } + + protected void addDefaultOsExclusions(BPart bPart, Array array) { + if (bPart.getType().equals(BOsPart.TYPE) && bPart.getPartName().startsWith("qnx")) { + Version version = bPart.getVersion().getVendorVersion(); + if (version.major() == 1) { + array.add((Object)new BDependency(bPart.getPartName(), new BVersion(bPart.getVersion().getVendor(), "2.0"), bPart.getType().getTypeSpec())); + } else if (version.size() >= 2) { + array.add((Object)new BDependency(bPart.getPartName(), new BVersion(bPart.getVersion().getVendor(), "" + version.major() + '.' + (version.minor() + 1)), bPart.getType().getTypeSpec())); + } + } + } + + protected void addDefaultNreCoreExclusions(BPart bPart, Array array) { + Version version; + if (bPart.getType().equals(BNrePart.TYPE) && bPart.getPartName().startsWith("nre-core-qnx") && (version = bPart.getVersion().getVendorVersion()).size() >= 2) { + array.add((Object)new BDependency(bPart.getPartName(), new BVersion(bPart.getVersion().getVendor(), "" + version.major() + '.' + (version.minor() + 1)), bPart.getType().getTypeSpec())); + } + } + + protected void addDefaultNreConfigExclusions(Array array) { + if (this.getInstallableName().startsWith("nre-config")) { + BDependency[] bDependencyArray = this.getDependencies(); + int n = 0; + while (n < bDependencyArray.length) { + if (bDependencyArray[n].getPartTypeSpec().equals((Object)BOsPart.TYPE.getTypeSpec()) && bDependencyArray[n].getPartName().startsWith("qnx") && bDependencyArray[n].getVersionRelation() != BVersionRelation.exact) { + Version version = bDependencyArray[n].getVersion().getVendorVersion(); + if (version.major() == 1) { + array.add((Object)new BDependency(bDependencyArray[n].getPartName(), new BVersion(bDependencyArray[n].getVersion().getVendor(), "2.0"), bDependencyArray[n].getPartTypeSpec())); + } else if (version.size() >= 2) { + array.add((Object)new BDependency(bDependencyArray[n].getPartName(), new BVersion(bDependencyArray[n].getVersion().getVendor(), "" + version.major() + '.' + (version.minor() + 1)), bDependencyArray[n].getPartTypeSpec())); + } + return; + } + ++n; + } + } + } + + public XElem getPlatformXml() { + return this.platformElem; + } + + public void setPlatformXml(XElem xElem) { + if (this.platformElem != null) { + this.rootElem.removeContent((XContent)this.platformElem); + } + this.platformElem = xElem; + this.rootElem.addContent((XContent)this.platformElem); + } + + public void setPlatformBog(BIFile bIFile) throws Exception { + this.setPlatformBog(bIFile, true); + } + + public void setPlatformBog(BIFile bIFile, boolean bl) throws Exception { + XElem xElem = new XElem("platform"); + if (!bl) { + xElem.setAttr("merge", "false"); + } + InputStream inputStream = bIFile.getInputStream(); + XElem xElem2 = XParser.make((InputStream)inputStream).parse().elem(0); + XElem[] xElemArray = xElem2.elems("p"); + int n = 0; + while (n < xElemArray.length) { + xElem.addContent((XContent)xElemArray[n].copy()); + ++n; + } + try { + inputStream.close(); + } + catch (Exception exception) {} + this.setPlatformXml(xElem); + } + + public BTcpIpHostSettings getTcpIpSettings() { + if (this.tcpIpElem == null) { + return null; + } + BTcpIpHostSettings bTcpIpHostSettings = new BTcpIpHostSettings(); + TcpUtil.updateFields(bTcpIpHostSettings, this.tcpIpElem); + return bTcpIpHostSettings; + } + + public void setTcpIpSettings(BTcpIpHostSettings bTcpIpHostSettings) throws Exception { + if (this.tcpIpElem != null) { + this.rootElem.removeContent((XContent)this.tcpIpElem); + } + if (bTcpIpHostSettings == null) { + this.tcpIpElem = null; + } else if (!bTcpIpHostSettings.getIsReadonly()) { + this.tcpIpElem = TcpUtil.getHostSettingsXml(bTcpIpHostSettings); + this.rootElem.addContent((XContent)this.tcpIpElem); + } + } + + public void setStationTcpIpSettings() throws Exception { + BTcpIpPlatformService bTcpIpPlatformService = (BTcpIpPlatformService)Sys.getService((Type)BTcpIpPlatformService.TYPE); + bTcpIpPlatformService.poll(); + this.setTcpIpSettings(bTcpIpPlatformService.getSettings()); + } + + public void setDaemonTcpIpSettings(BDaemonSession bDaemonSession) throws Exception { + BTcpIpHostSettings bTcpIpHostSettings = new BTcpIpHostSettings(); + TcpUtil.loadFromSession(bTcpIpHostSettings, bDaemonSession); + this.setTcpIpSettings(bTcpIpHostSettings); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.platformElem = null; + this.tcpIpElem = null; + } + + private DistributionManifest(XElem xElem) throws Exception { + super(xElem); + this.this(); + this.platformElem = this.rootElem.elem("platform"); + this.tcpIpElem = this.rootElem.elem("tcpIpSettings"); + } + + private DistributionManifest() { + this.this(); + } +} + diff --git a/modules/cfr_output/com/tridium/install/installable/InstallableRegistry.java b/modules/cfr_output/com/tridium/install/installable/InstallableRegistry.java new file mode 100644 index 0000000..43a94e7 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/InstallableRegistry.java @@ -0,0 +1,20 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.install.installable; + +import com.tridium.install.BDependency; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.installable.ClosableCursor; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; + +public interface InstallableRegistry { + public BInstallable findInstallable(BDependency var1, DaemonSessionTaskListener var2) throws Exception; + + public BInstallable[] findInstallables(BDependency var1, DaemonSessionTaskListener var2) throws Exception; + + public ClosableCursor getInstallables(BDependency var1, DaemonSessionTaskListener var2) throws Exception; + + public ClosableCursor getInstallables(boolean var1, DaemonSessionTaskListener var2) throws Exception; +} + diff --git a/modules/cfr_output/com/tridium/install/installable/LocalInstallableRegistry.java b/modules/cfr_output/com/tridium/install/installable/LocalInstallableRegistry.java new file mode 100644 index 0000000..4062fb0 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/LocalInstallableRegistry.java @@ -0,0 +1,938 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BDirectory + * javax.baja.file.BFileSystem + * javax.baja.file.BIFile + * javax.baja.file.FilePath + * javax.baja.file.FileUtil + * javax.baja.naming.BOrd + * javax.baja.naming.OrdQuery + * javax.baja.nre.util.Array + * javax.baja.nre.util.IFilter + * javax.baja.sys.BObject + * javax.baja.sys.Context + * javax.baja.sys.SlotCursor + * javax.baja.sys.Type + * javax.baja.util.BTypeSpec + * javax.baja.util.Lexicon + * javax.baja.util.PatternFilter + * javax.baja.util.Version + */ +package com.tridium.install.installable; + +import com.tridium.install.BDependency; +import com.tridium.install.BRegisteredModuleList; +import com.tridium.install.BVersion; +import com.tridium.install.FilenameFilterUtil; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.installable.BModuleInstallable; +import com.tridium.install.installable.ClosableCursor; +import com.tridium.install.installable.InstallableRegistry; +import com.tridium.install.part.BModulePart; +import com.tridium.install.part.BPart; +import com.tridium.platform.daemon.BModuleContent; +import com.tridium.platform.daemon.file.FilePathComparator; +import com.tridium.platform.daemon.task.DaemonSessionTask; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.TreeMap; +import java.util.TreeSet; +import javax.baja.file.BDirectory; +import javax.baja.file.BFileSystem; +import javax.baja.file.BIFile; +import javax.baja.file.FilePath; +import javax.baja.file.FileUtil; +import javax.baja.naming.BOrd; +import javax.baja.naming.OrdQuery; +import javax.baja.nre.util.Array; +import javax.baja.nre.util.IFilter; +import javax.baja.platform.install.BVersionRelation; +import javax.baja.sys.BObject; +import javax.baja.sys.Context; +import javax.baja.sys.SlotCursor; +import javax.baja.sys.Type; +import javax.baja.util.BTypeSpec; +import javax.baja.util.Lexicon; +import javax.baja.util.PatternFilter; +import javax.baja.util.Version; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class LocalInstallableRegistry +implements InstallableRegistry { + private static LocalInstallableRegistry INSTANCE = null; + public static final BTypeSpec MODULE_PART = BModulePart.TYPE.getTypeSpec(); + public static final BTypeSpec MODULE_INST = BModuleInstallable.TYPE.getTypeSpec(); + public static final FilePath SW_PATH = new FilePath("!sw"); + public static final String INBOX_DIR = "inbox"; + public static final String FAILED_DIR = "failed_imports"; + public static final FilePath INBOX_PATH = SW_PATH.merge("inbox"); + public static final FilePath MODULES_PATH = new FilePath("!modules"); + private static final Lexicon lex = Lexicon.make((String)"platform"); + private boolean initialized; + private InstallableCache installableCache; + private boolean initializing; + private Array listeners; + private HashMap installableTypesByFileExt; + static /* synthetic */ Class class$com$tridium$install$installable$LocalInstallableRegistry$RegistryListener; + static /* synthetic */ Class class$com$tridium$install$installable$BModuleInstallable; + static /* synthetic */ Class class$com$tridium$install$part$BPart; + static /* synthetic */ Class class$com$tridium$install$installable$BInstallable; + static /* synthetic */ Class class$javax$baja$file$BIFile; + static /* synthetic */ Class class$javax$baja$file$FilePath; + static /* synthetic */ Class class$javax$baja$sys$BComponent; + static /* synthetic */ Class class$com$tridium$install$installable$BDistribution; + + public static LocalInstallableRegistry getInstance() { + if (INSTANCE == null) { + INSTANCE = new LocalInstallableRegistry(); + } + return INSTANCE; + } + + public void reload(DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + this.reset(); + this.init(daemonSessionTaskListener); + } + + public void reset() { + this.initialized = false; + } + + public void init() throws Exception { + this.init(null); + } + + /* + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void init(DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + if (!this.initialized) { + if (daemonSessionTaskListener == null) { + daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER; + } + DaemonSessionTask daemonSessionTask = new DaemonSessionTask(lex, "LocalInstallableRegistry.init.import.title", "LocalInstallableRegistry.init.import.message"); + BFileSystem.INSTANCE.makeDir(SW_PATH); + this.initializing = true; + try { + daemonSessionTaskListener.taskStarted(daemonSessionTask); + this.installableCache = new InstallableCache(); + this.importDirectory(BFileSystem.INSTANCE.makeDir(INBOX_PATH), daemonSessionTaskListener, daemonSessionTask, true); + BRegisteredModuleList.getInstance().doInit(daemonSessionTaskListener); + SlotCursor slotCursor = BRegisteredModuleList.getInstance().getModules().getProperties(); + while (true) { + Class clazz; + if ((clazz = class$com$tridium$install$installable$BModuleInstallable) == null) { + clazz = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.BModuleInstallable;", false); + } + if (slotCursor.next(clazz)) { + BModuleInstallable bModuleInstallable = (BModuleInstallable)slotCursor.get(); + if (bModuleInstallable.getModulePart().getArchiveContent() != BModuleContent.doc) continue; + if (this.isRegistered(bModuleInstallable)) { + this.installableCache.register(SW_PATH.merge(bModuleInstallable.getVersion().getVendorVersion().toString()).merge(bModuleInstallable.getInstallableFileName()), (BInstallable)bModuleInstallable); + continue; + } + this.register(daemonSessionTask, bModuleInstallable, daemonSessionTaskListener, false); + continue; + } + break; + } + } + catch (Throwable throwable) { + Object var4_6 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + throw throwable; + } + { + Object var4_7 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + this.initialized = true; + this.initializing = false; + } + } + } + + public boolean isRegistered(BInstallable bInstallable) throws Exception { + String string = bInstallable.getVersion().getVendorVersion() == null ? "0" : bInstallable.getVersion().getVendorVersion().toString(); + BDirectory bDirectory = BFileSystem.INSTANCE.makeDir(SW_PATH.merge(string)); + BIFile bIFile = (BIFile)bDirectory.getNavChild(bInstallable.getInstallableFileName()); + if (bIFile == null) { + return false; + } + BIFile bIFile2 = (BIFile)bInstallable.getInstallableFileOrd().get(); + if (bIFile2 == null) { + return false; + } + return bIFile2.getLastModified().isAfter(bIFile.getLastModified()); + } + + public void register(BInstallable bInstallable, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + this.register(null, bInstallable, daemonSessionTaskListener, true); + } + + /* + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void register(String string, String string2, BVersion bVersion, InputStream inputStream, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + if (!this.initializing) { + this.init(daemonSessionTaskListener); + } + if (daemonSessionTaskListener == null) { + daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER; + } + if (bVersion.getVendorVersion().equals((Object)Version.ZERO)) { + return; + } + DaemonSessionTask daemonSessionTask = new DaemonSessionTask(lex, "LocalInstallableRegistry.init.import.title", "LocalInstallableRegistry.init.import.message"); + daemonSessionTaskListener.taskStarted(daemonSessionTask); + try { + BDirectory bDirectory = BFileSystem.INSTANCE.makeDir(SW_PATH.merge(bVersion.getVendorVersion().toString())); + daemonSessionTask.setMessage(lex.getText("LocalInstallableRegistry.init.import.copyModule", new Object[]{string})); + daemonSessionTaskListener.taskUpdated(daemonSessionTask); + BIFile bIFile = BFileSystem.INSTANCE.makeFile(bDirectory.getFilePath().merge(string2)); + FileUtil.pipe((InputStream)inputStream, (OutputStream)bIFile.getOutputStream()); + BInstallable bInstallable = BInstallable.make(bIFile); + this.installableCache.register(bIFile, bInstallable); + this.notifyRegistration(bInstallable); + } + catch (Throwable throwable) { + Object var8_11 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + throw throwable; + } + { + Object var8_12 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + return; + } + } + + /* + * Exception decompiling + */ + private final void register(DaemonSessionTask var1_1, BInstallable var2_2, DaemonSessionTaskListener var3_3, boolean var4_4) throws Exception { + /* + * This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. + * + * org.benf.cfr.reader.util.ConfusedCFRException: Back jump on a try block [egrp 1[TRYBLOCK] [1 : 274->278)] java.lang.Throwable + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.insertExceptionBlocks(Op02WithProcessedDataAndRefs.java:2283) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:415) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201) + * at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94) + * at org.benf.cfr.reader.entities.Method.analyse(Method.java:531) + * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055) + * at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942) + * at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257) + * at org.benf.cfr.reader.Driver.doJar(Driver.java:139) + * at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76) + * at org.benf.cfr.reader.Main.main(Main.java:54) + */ + throw new IllegalStateException("Decompilation failed"); + } + + /* + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void importDirectory(BDirectory bDirectory, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + if (!this.initializing) { + this.init(daemonSessionTaskListener); + } + if (daemonSessionTaskListener == null) { + daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER; + } + DaemonSessionTask daemonSessionTask = new DaemonSessionTask(lex, "LocalInstallableRegistry.init.import.title", "LocalInstallableRegistry.init.import.message"); + daemonSessionTaskListener.taskStarted(daemonSessionTask); + try { + this.importDirectory(bDirectory, daemonSessionTaskListener, daemonSessionTask, false); + } + catch (Throwable throwable) { + Object var5_5 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + throw throwable; + } + { + Object var5_6 = null; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + return; + } + } + + private final void importDirectory(BDirectory bDirectory, DaemonSessionTaskListener daemonSessionTaskListener, DaemonSessionTask daemonSessionTask, boolean bl) throws Exception { + BIFile[] bIFileArray = bDirectory.listFiles(); + int n = 0; + while (n < bIFileArray.length) { + if (bIFileArray[n] instanceof BDirectory) { + this.importDirectory((BDirectory)bIFileArray[n], daemonSessionTaskListener, daemonSessionTask, bl); + } else { + FilePath filePath; + FilePath filePath2; + daemonSessionTask.setMessage(lex.getText("LocalInstallableRegistry.parse", new Object[]{bIFileArray[n].getFilePath().getBody()})); + daemonSessionTaskListener.taskUpdated(daemonSessionTask); + BInstallable bInstallable = BInstallable.make(bIFileArray[n]); + if (bInstallable == null || !bInstallable.getIsValid() || !bInstallable.getIsInstallable() || bInstallable instanceof BModuleInstallable && ((BModuleInstallable)bInstallable).getModulePart().getArchiveContent() != BModuleContent.doc) { + filePath2 = bIFileArray[n].getFilePath(); + filePath = new FilePath(filePath2.getAbsoluteBase()); + int n2 = 0; + while (n2 < filePath2.depth()) { + filePath = filePath2.nameAt(n2).equals(INBOX_DIR) ? filePath.merge(FAILED_DIR) : filePath.merge(filePath2.nameAt(n2)); + ++n2; + } + } else { + filePath = SW_PATH.merge(bInstallable.getVersion().getVendorVersion().toString()).merge(this.getNormalFileName(bInstallable, bIFileArray[n])); + bInstallable.setInstallableFileOrd(BOrd.make((OrdQuery)filePath)); + } + if (!filePath.getBody().equals(bIFileArray[n].getFilePath().getBody())) { + filePath2 = BFileSystem.INSTANCE.findFile(filePath); + if (filePath2 != null) { + filePath2.delete(); + } + daemonSessionTask.setMessage(lex.getText("LocalInstallableRegistry.init.import.copyFile", new Object[]{bIFileArray[n].getFilePath().getBody()})); + daemonSessionTaskListener.taskUpdated(daemonSessionTask); + if (filePath.depth() > 0) { + BFileSystem.INSTANCE.makeDir(filePath.getParent(), null); + } + if (bl) { + BFileSystem.INSTANCE.move(bIFileArray[n].getFilePath(), filePath); + } else { + BIFile bIFile = BFileSystem.INSTANCE.makeFile(filePath); + FileUtil.pipe((BIFile)bIFileArray[n], (BIFile)bIFile); + } + this.notifyRegistration(bInstallable); + } + } + ++n; + } + if (bl && !bDirectory.getFilePath().getBody().equals(INBOX_PATH.getBody())) { + bDirectory.delete(); + } + } + + private final String getNormalFileName(BInstallable bInstallable, BIFile bIFile) { + SlotCursor slotCursor = bInstallable.getParts().getProperties(); + Class clazz = class$com$tridium$install$part$BPart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BPart = LocalInstallableRegistry.class("[Lcom.tridium.install.part.BPart;", false); + } + if (slotCursor.next(clazz)) { + BPart bPart = (BPart)slotCursor.get(); + return bPart.getPartName() + '.' + bIFile.getExtension(); + } + return bIFile.getFileName(); + } + + private final Array getVersionSubdirs() { + BDirectory bDirectory = (BDirectory)BFileSystem.INSTANCE.findFile(SW_PATH); + Array array = new Array((Object[])bDirectory.listFiles()); + array = array.filter(new IFilter(){ + + public final boolean accept(Object object) { + if (object == null || !(object instanceof BDirectory)) { + return false; + } + try { + new Version(((BDirectory)object).getFileName()); + return true; + } + catch (Exception exception) { + return false; + } + } + }); + return array.sort(new Comparator(){ + + public final int compare(Object object, Object object2) { + Version version; + String string = ((BDirectory)object).getFileName(); + String string2 = ((BDirectory)object2).getFileName(); + Version version2 = new Version(string2); + int n = version2.compareTo((Object)(version = new Version(string))); + return n == 0 ? string2.compareTo(string) : n; + } + }); + } + + public BInstallable findInstallable(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + this.init(daemonSessionTaskListener); + return this.installableCache.getInstallable(this.findInstallableFile(bDependency, daemonSessionTaskListener), daemonSessionTaskListener); + } + + public ClosableCursor getInstallables(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + this.init(daemonSessionTaskListener); + return new InstallableFileCursor(this.findInstallableFiles(bDependency, daemonSessionTaskListener), this.installableCache, daemonSessionTaskListener); + } + + public BInstallable[] findInstallables(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + this.init(daemonSessionTaskListener); + BIFile[] bIFileArray = this.findInstallableFiles(bDependency, daemonSessionTaskListener); + Class clazz = class$com$tridium$install$installable$BInstallable; + if (clazz == null) { + clazz = class$com$tridium$install$installable$BInstallable = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.BInstallable;", false); + } + Array array = new Array(clazz); + int n = 0; + while (n < bIFileArray.length) { + BInstallable bInstallable = this.installableCache.getInstallable(bIFileArray[n], daemonSessionTaskListener); + if (bInstallable != null) { + array.add((Object)bInstallable); + } + ++n; + } + return (BInstallable[])array.trim(); + } + + private static final boolean matchesDepend(BIFile bIFile, BDependency bDependency, PatternFilter[] patternFilterArray) { + if (bIFile == null) { + return false; + } + String string = bIFile.getExtension(); + if (bDependency.getPartTypeSpec().equals((Object)MODULE_PART) || bDependency.getPartTypeSpec().equals((Object)MODULE_INST) ? !"jar".equals(string) && !"sjar".equals(string) : !"dist".equals(string) && LocalInstallableRegistry.getInstance().getInstallableTypeForExt(string) == null) { + return false; + } + String string2 = bIFile.getFileName().substring(0, bIFile.getFileName().length() - string.length() - 1); + int n = 0; + while (n < patternFilterArray.length) { + if (patternFilterArray[n].accept(string2)) { + return true; + } + ++n; + } + return false; + } + + private static final String[] getFixedFileNames(BDependency bDependency) { + if (BPart.isWildcardName(bDependency.getPartName())) { + return new String[0]; + } + if (bDependency.getPartTypeSpec().equals((Object)MODULE_PART) || bDependency.getPartTypeSpec().equals((Object)MODULE_INST)) { + return new String[]{bDependency.getPartName() + ".jar", bDependency.getPartName() + ".sjar"}; + } + return new String[]{bDependency.getPartName() + ".dist"}; + } + + public BIFile findInstallableFile(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + block14: { + String[] stringArray; + PatternFilter[] patternFilterArray; + block12: { + FilePath filePath; + block13: { + this.init(daemonSessionTaskListener); + patternFilterArray = PatternFilter.parseList((String)bDependency.getPartName()); + stringArray = LocalInstallableRegistry.getFixedFileNames(bDependency); + if (bDependency.getVersionRelation() != BVersionRelation.exact) break block12; + filePath = SW_PATH.merge(bDependency.getVersion().getVendorVersion().toString()); + if (stringArray.length != 0) break block13; + BDirectory bDirectory = (BDirectory)BFileSystem.INSTANCE.findFile(filePath); + if (bDirectory == null) break block14; + BIFile[] bIFileArray = bDirectory.listFiles(); + int n = 0; + while (n < bIFileArray.length) { + if (LocalInstallableRegistry.matchesDepend(bIFileArray[n], bDependency, patternFilterArray)) { + return bIFileArray[n]; + } + ++n; + } + break block14; + } + int n = 0; + while (n < stringArray.length) { + BIFile bIFile = BFileSystem.INSTANCE.findFile(filePath.merge(stringArray[n])); + if (bIFile != null) { + return bIFile; + } + ++n; + } + break block14; + } + Array array = this.getVersionSubdirs(); + int n = 0; + while (n < array.size()) { + BDirectory bDirectory = (BDirectory)array.get(n); + Version version = new Version(bDirectory.getFileName()); + if (BVersion.meets(version, bDependency)) { + if (stringArray.length == 0) { + BIFile[] bIFileArray = bDirectory.listFiles(); + int n2 = 0; + while (n2 < bIFileArray.length) { + if (LocalInstallableRegistry.matchesDepend(bIFileArray[n2], bDependency, patternFilterArray)) { + return bIFileArray[n2]; + } + ++n2; + } + } else { + int n3 = 0; + while (n3 < stringArray.length) { + BIFile bIFile = (BIFile)bDirectory.getNavChild(stringArray[n3]); + if (bIFile != null) { + return bIFile; + } + ++n3; + } + } + } + ++n; + } + } + return null; + } + + public BIFile[] findInstallableFiles(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + Array array; + block13: { + String[] stringArray; + PatternFilter[] patternFilterArray; + block15: { + FilePath filePath; + block16: { + this.init(daemonSessionTaskListener); + patternFilterArray = PatternFilter.parseList((String)bDependency.getPartName()); + stringArray = LocalInstallableRegistry.getFixedFileNames(bDependency); + Class clazz = class$javax$baja$file$BIFile; + if (clazz == null) { + clazz = class$javax$baja$file$BIFile = LocalInstallableRegistry.class("[Ljavax.baja.file.BIFile;", false); + } + array = new Array(clazz); + if (bDependency.getVersionRelation() != BVersionRelation.exact) break block15; + filePath = SW_PATH.merge(bDependency.getVersion().getVendorVersion().toString()); + if (stringArray.length != 0) break block16; + BDirectory bDirectory = (BDirectory)BFileSystem.INSTANCE.findFile(filePath); + if (bDirectory == null) break block13; + BIFile[] bIFileArray = bDirectory.listFiles(); + int n = 0; + while (n < bIFileArray.length) { + if (LocalInstallableRegistry.matchesDepend(bIFileArray[n], bDependency, patternFilterArray)) { + array.add((Object)bIFileArray[n]); + } + ++n; + } + break block13; + } + int n = 0; + while (n < stringArray.length) { + BIFile bIFile = BFileSystem.INSTANCE.findFile(filePath.merge(stringArray[n])); + if (bIFile != null) { + array.add((Object)bIFile); + break block13; + } + ++n; + } + break block13; + } + Array array2 = this.getVersionSubdirs(); + int n = 0; + while (n < array2.size()) { + BDirectory bDirectory = (BDirectory)array2.get(n); + Version version = new Version(bDirectory.getFileName()); + if (BVersion.meets(version, bDependency)) { + if (stringArray.length == 0) { + BIFile[] bIFileArray = bDirectory.listFiles(); + int n2 = 0; + while (n2 < bIFileArray.length) { + if (LocalInstallableRegistry.matchesDepend(bIFileArray[n2], bDependency, patternFilterArray)) { + array.add((Object)bIFileArray[n2]); + } + ++n2; + } + } else { + int n3 = 0; + while (n3 < stringArray.length) { + BIFile bIFile = (BIFile)bDirectory.getNavChild(stringArray[n3]); + if (bIFile != null) { + array.add((Object)bIFile); + break; + } + ++n3; + } + } + } + ++n; + } + } + return (BIFile[])array.trim(); + } + + public BInstallable findInstallable(String string, Version version, Type type, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + if (string.indexOf(46) > 0) { + string = string.substring(0, string.indexOf(46)); + } + if (version.isNull()) { + return this.findInstallable(new BDependency(string, BVersion.ZERO, BVersionRelation.minimum, type.getTypeSpec()), daemonSessionTaskListener); + } + return this.findInstallable(new BDependency(string, new BVersion(version.toString()), BVersionRelation.exact, type.getTypeSpec()), daemonSessionTaskListener); + } + + public ClosableCursor getInstallables(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception { + return this.getInstallables(bl, daemonSessionTaskListener, null, null); + } + + public ClosableCursor getInstallables(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener, String string) throws Exception { + return this.getInstallables(bl, daemonSessionTaskListener, string, null); + } + + public ClosableCursor getInstallables(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener, String string, String string2) throws Exception { + this.init(daemonSessionTaskListener); + return new InstallableCursor(bl, daemonSessionTaskListener, FilenameFilterUtil.make(string, string2)); + } + + public void addListener(RegistryListener registryListener) { + this.listeners.add((Object)registryListener); + } + + public void removeListener(RegistryListener registryListener) { + this.listeners.remove((Object)registryListener); + } + + private final void notifyRegistration(BInstallable bInstallable) { + if (bInstallable == null) { + return; + } + int n = 0; + while (n < this.listeners.size()) { + try { + ((RegistryListener)this.listeners.get(n)).installableRegistered(bInstallable); + } + catch (Exception exception) { + exception.printStackTrace(); + } + ++n; + } + } + + public void registerInstallableFileType(String string, Type type) { + this.installableTypesByFileExt.put(string, type); + } + + public Type getInstallableTypeForExt(String string) { + return (Type)this.installableTypesByFileExt.get(string); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.initialized = false; + this.installableCache = null; + this.initializing = false; + Class clazz = class$com$tridium$install$installable$LocalInstallableRegistry$RegistryListener; + if (clazz == null) { + clazz = class$com$tridium$install$installable$LocalInstallableRegistry$RegistryListener = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.LocalInstallableRegistry$RegistryListener;", false); + } + this.listeners = new Array(clazz); + this.installableTypesByFileExt = new HashMap(); + } + + private LocalInstallableRegistry() { + this.this(); + } + + private static class InstallableCache { + private TreeSet pathsNotFound = new TreeSet(FilePathComparator.INSTANCE); + private TreeMap instByPath = new TreeMap(FilePathComparator.INSTANCE); + + public void register(BIFile bIFile, BInstallable bInstallable) { + this.register(bIFile.getFilePath(), bInstallable); + } + + public void register(FilePath filePath, BInstallable bInstallable) { + this.pathsNotFound.remove(filePath); + this.instByPath.put(filePath, bInstallable); + } + + public BInstallable getInstallable(BIFile bIFile, DaemonSessionTaskListener daemonSessionTaskListener) { + return this.getInstallable(bIFile, daemonSessionTaskListener, null); + } + + /* + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public BInstallable getInstallable(BIFile bIFile, DaemonSessionTaskListener daemonSessionTaskListener, DaemonSessionTask daemonSessionTask) { + BInstallable bInstallable; + block9: { + if (bIFile == null) { + return null; + } + if (this.pathsNotFound.contains(bIFile.getFilePath())) { + return null; + } + bInstallable = (BInstallable)this.instByPath.get(bIFile.getFilePath()); + if (bInstallable != null) return bInstallable; + if (daemonSessionTaskListener == null) { + daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER; + } + boolean bl = false; + if (daemonSessionTask == null) { + daemonSessionTask = new DaemonSessionTask(lex, "LocalInstallableRegistry.parse.genericTitle", "LocalInstallableRegistry.parse", new Object[]{bIFile.getFilePath().getBody()}); + daemonSessionTaskListener.taskStarted(daemonSessionTask); + bl = true; + } else { + daemonSessionTask.setMessage(lex.getText("LocalInstallableRegistry.parse", new Object[]{bIFile.getFilePath().getBody()})); + daemonSessionTaskListener.taskUpdated(daemonSessionTask); + } + try { + bInstallable = BInstallable.make(bIFile); + } + catch (Throwable throwable) { + Object var7_7 = null; + if (!bl) throw throwable; + daemonSessionTaskListener.taskFinished(daemonSessionTask); + throw throwable; + } + { + Object var7_8 = null; + if (bl) { + daemonSessionTaskListener.taskFinished(daemonSessionTask); + } + if (bInstallable != null) break block9; + this.pathsNotFound.add(bIFile.getFilePath()); + } + return bInstallable; + } + this.instByPath.put(bIFile.getFilePath(), bInstallable); + return bInstallable; + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected static class InstallableFileCursor + implements ClosableCursor { + private BIFile[] files; + private int index; + private InstallableCache cache; + private DaemonSessionTaskListener listener; + static /* synthetic */ Class class$javax$baja$sys$BComponent; + + public void close() { + } + + public BObject get() { + if (this.index < 0 || this.index >= this.files.length) { + return null; + } + return this.cache.getInstallable(this.files[this.index], this.listener); + } + + public Context getContext() { + return null; + } + + public boolean next() { + if (this.index < this.files.length - 1) { + ++this.index; + return true; + } + return false; + } + + public boolean next(Class clazz) { + boolean bl = this.next(); + while (bl && !clazz.isAssignableFrom(this.get().getClass())) { + bl = this.next(); + } + return bl; + } + + public boolean nextComponent() { + Class clazz = class$javax$baja$sys$BComponent; + if (clazz == null) { + clazz = class$javax$baja$sys$BComponent = InstallableFileCursor.class("[Ljavax.baja.sys.BComponent;", false); + } + return this.next(clazz); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public InstallableFileCursor(BIFile[] bIFileArray, InstallableCache installableCache, DaemonSessionTaskListener daemonSessionTaskListener) { + this.files = bIFileArray; + this.index = -1; + this.cache = installableCache; + this.listener = daemonSessionTaskListener; + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class InstallableCursor + implements ClosableCursor { + BInstallable current; + Iterator iterator; + DaemonSessionTaskListener listener; + IFilter fileNameFilter; + + public Context getContext() { + return null; + } + + public void close() { + } + + public boolean next() { + while (this.iterator.hasNext()) { + FilePath filePath = (FilePath)this.iterator.next(); + if (!this.fileNameFilter.accept((Object)filePath)) continue; + this.current = LocalInstallableRegistry.this.installableCache.getInstallable(BFileSystem.INSTANCE.findFile(filePath), this.listener); + if (this.current == null) continue; + return true; + } + return false; + } + + public boolean nextComponent() { + Class clazz = class$javax$baja$sys$BComponent; + if (clazz == null) { + clazz = class$javax$baja$sys$BComponent = LocalInstallableRegistry.class("[Ljavax.baja.sys.BComponent;", false); + } + return this.next(clazz); + } + + public boolean nextDist() { + while (this.iterator.hasNext()) { + FilePath filePath = (FilePath)this.iterator.next(); + if (!this.fileNameFilter.accept((Object)filePath) || !"dist".equals(FileUtil.getExtension((String)filePath.getName()))) continue; + this.current = LocalInstallableRegistry.this.installableCache.getInstallable(BFileSystem.INSTANCE.findFile(filePath), this.listener); + if (this.current == null) continue; + return true; + } + return false; + } + + public boolean nextModule() { + while (this.iterator.hasNext()) { + FilePath filePath = (FilePath)this.iterator.next(); + if (!this.fileNameFilter.accept((Object)filePath) || !"jar".equals(FileUtil.getExtension((String)filePath.getName())) && !"sjar".equals(FileUtil.getExtension((String)filePath.getName())) && LocalInstallableRegistry.this.getInstallableTypeForExt(FileUtil.getExtension((String)filePath.getName())) == null) continue; + this.current = LocalInstallableRegistry.this.installableCache.getInstallable(BFileSystem.INSTANCE.findFile(filePath), this.listener); + if (this.current == null) continue; + return true; + } + return false; + } + + /* + * Unable to fully structure code + */ + public boolean next(Class var1_1) { + block6: { + block5: { + v0 = LocalInstallableRegistry.class$com$tridium$install$installable$BModuleInstallable; + if (v0 == null) { + v0 = LocalInstallableRegistry.class$com$tridium$install$installable$BModuleInstallable = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.BModuleInstallable;", false); + } + if (!v0.isAssignableFrom(var1_1)) break block5; + while (this.nextModule()) { + if (!var1_1.isInstance(this.current)) continue; + return true; + } + break block6; + } + v1 = LocalInstallableRegistry.class$com$tridium$install$installable$BDistribution; + if (v1 == null) { + v1 = LocalInstallableRegistry.class$com$tridium$install$installable$BDistribution = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.BDistribution;", false); + } + if (!v1.isAssignableFrom(var1_1)) ** GOTO lbl20 + while (this.nextDist()) { + if (!var1_1.isInstance(this.current)) continue; + return true; + } + break block6; +lbl-1000: + // 1 sources + + { + if (!var1_1.isInstance(this.current)) continue; + return true; +lbl20: + // 2 sources + + ** while (this.next()) + } + } + return false; + } + + public BObject get() { + return this.current; + } + + private final /* synthetic */ void this() { + this.current = null; + } + + public InstallableCursor(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener, IFilter iFilter) { + this.this(); + Class clazz = class$javax$baja$file$FilePath; + if (clazz == null) { + clazz = class$javax$baja$file$FilePath = LocalInstallableRegistry.class("[Ljavax.baja.file.FilePath;", false); + } + Array array = new Array(clazz); + HashSet hashSet = new HashSet(); + Array array2 = LocalInstallableRegistry.this.getVersionSubdirs(); + this.fileNameFilter = iFilter; + this.listener = daemonSessionTaskListener == null ? DaemonSessionTaskListener.NULL_TASK_LISTENER : daemonSessionTaskListener; + int n = 0; + while (n < array2.size()) { + BIFile[] bIFileArray = ((BDirectory)array2.get(n)).listFiles(); + int n2 = 0; + while (n2 < bIFileArray.length) { + FilePath filePath = bIFileArray[n2].getFilePath(); + String string = FileUtil.getExtension((String)filePath.getName()); + if (!(!"dist".equals(string) && !"jar".equals(string) && !"sjar".equals(string) && LocalInstallableRegistry.this.getInstallableTypeForExt(string) == null || bl && hashSet.contains(filePath.getName()))) { + array.add((Object)filePath); + hashSet.add(filePath.getName()); + } + ++n2; + } + ++n; + } + this.iterator = array.iterator(); + } + } + + public static interface RegistryListener { + public void installableRegistered(BInstallable var1); + } +} + diff --git a/modules/cfr_output/com/tridium/install/installable/ModuleManifest.java b/modules/cfr_output/com/tridium/install/installable/ModuleManifest.java new file mode 100644 index 0000000..85ea694 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/installable/ModuleManifest.java @@ -0,0 +1,528 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nre.util.Array + * javax.baja.sys.BAbsTime + * javax.baja.sys.LocalizableRuntimeException + * javax.baja.sys.Sys + * javax.baja.xml.XContent + * javax.baja.xml.XElem + * javax.baja.xml.XParser + * javax.baja.xml.XWriter + */ +package com.tridium.install.installable; + +import com.tridium.install.BDependency; +import com.tridium.install.BVersion; +import com.tridium.install.part.BModulePart; +import com.tridium.install.part.BModuleStatus; +import com.tridium.platform.daemon.BModuleContent; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.ListIterator; +import javax.baja.nre.util.Array; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.LocalizableRuntimeException; +import javax.baja.sys.Sys; +import javax.baja.xml.XContent; +import javax.baja.xml.XElem; +import javax.baja.xml.XParser; +import javax.baja.xml.XWriter; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class ModuleManifest { + private XElem moduleElement; + private HashMap typeByName; + private Array types; + private Array unknownElements; + private HashMap dependencyByName; + private HashMap moduleContentByPath; + private XElem exclElement; + private BModuleStatus status; + private boolean noRunningStation; + static /* synthetic */ Class class$javax$baja$xml$XElem; + static /* synthetic */ Class class$com$tridium$install$BDependency; + + public static ModuleManifest make(XElem xElem) { + return xElem == null ? null : new ModuleManifest(xElem); + } + + public static ModuleManifest make(InputStream inputStream) { + return ModuleManifest.make(inputStream, true); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public static ModuleManifest make(InputStream inputStream, boolean bl) { + ModuleManifest moduleManifest; + block15: { + ModuleManifest moduleManifest2; + block14: { + ModuleManifest moduleManifest3; + block13: { + try { + try { + XParser xParser = XParser.make((InputStream)inputStream); + if (xParser.next() == -1) { + moduleManifest3 = new ModuleManifest(BModuleStatus.corrupt); + Object var3_8 = null; + if (!bl) return moduleManifest3; + break block13; + } + if (xParser.type() == 1 && xParser.elem().name().equals("module")) { + moduleManifest2 = new ModuleManifest(xParser.elem(), xParser); + break block14; + } + moduleManifest = new ModuleManifest(BModuleStatus.corrupt); + break block15; + } + catch (Exception exception) { + ModuleManifest moduleManifest4 = new ModuleManifest(BModuleStatus.corrupt); + Object var3_11 = null; + if (!bl) return moduleManifest4; + try { + inputStream.close(); + return moduleManifest4; + } + catch (IOException iOException) {} + return moduleManifest4; + } + } + catch (Throwable throwable) { + Object var3_12 = null; + if (!bl) throw throwable; + try {} + catch (IOException iOException) { + throw throwable; + } + inputStream.close(); + throw throwable; + } + } + try {} + catch (IOException iOException) {} + inputStream.close(); + return moduleManifest3; + } + Object var3_9 = null; + if (!bl) return moduleManifest2; + try {} + catch (IOException iOException) {} + inputStream.close(); + return moduleManifest2; + } + Object var3_10 = null; + if (!bl) return moduleManifest; + try {} + catch (IOException iOException) {} + inputStream.close(); + return moduleManifest; + } + + public void write(OutputStream outputStream) throws Exception { + this.write(this.getModuleContent(), outputStream); + } + + public void write(BModuleContent bModuleContent, OutputStream outputStream) { + try { + Object object; + BModuleContent bModuleContent2; + Object object2; + XWriter xWriter = new XWriter(outputStream); + xWriter.prolog(); + XElem xElem = this.moduleElement.copy(); + xElem.addAttr("archiveDate", String.valueOf(new Date())); + xElem.addAttr("archiveInstall", bModuleContent.getTag()); + try { + xElem.addAttr("archiveHost", Sys.getLocalHost().getHostName()); + } + catch (Exception exception) {} + XElem xElem2 = new XElem("dependencies"); + XElem xElem3 = null; + XElem xElem4 = null; + XElem xElem5 = this.dependencyByName.values().iterator(); + while (xElem5.hasNext()) { + try { + object2 = (BDependency)((Object)xElem5.next()); + if (((BDependency)((Object)object2)).getPartTypeSpec().equals((Object)BModulePart.TYPE.getTypeSpec())) { + xElem2.addContent((XContent)((BDependency)((Object)object2)).getXml()); + continue; + } + if (xElem3 == null) { + xElem3 = new XElem("installation"); + } + if (xElem4 == null) { + xElem4 = new XElem("dependencies"); + xElem3.addContent((XContent)xElem4); + } + xElem4.addContent((XContent)((BDependency)((Object)object2)).getXml()); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + xElem.addContent((XContent)xElem2); + if (this.noRunningStation) { + if (xElem3 == null) { + xElem3 = new XElem("installation"); + } + xElem3.addAttr("noRunningStation", "true"); + } + if (this.exclElement != null) { + if (xElem3 == null) { + xElem3 = new XElem("installation"); + } + xElem3.addContent((XContent)this.exclElement.copy()); + } + if (xElem3 != null) { + xElem.addContent((XContent)xElem3); + } + xElem5 = null; + object2 = this.moduleContentByPath.keySet().iterator(); + while (object2.hasNext()) { + try { + String string = (String)object2.next(); + bModuleContent2 = (BModuleContent)((Object)this.moduleContentByPath.get(string)); + object = new XElem("dir"); + object.addAttr("name", string); + object.addAttr("install", bModuleContent2.getTag()); + if (bModuleContent.getOrdinal() < bModuleContent2.getOrdinal()) { + object.addAttr("stripped", "true"); + } + if (xElem5 == null) { + xElem5 = new XElem("dirs"); + } + xElem5.addContent((XContent)object); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + if (xElem5 != null) { + xElem.addContent(xElem5); + } + object2 = null; + int n = 0; + while (n < this.types.size()) { + bModuleContent2 = (XElem)this.types.get(n); + object = bModuleContent2.get("class").replace('.', '/'); + if (this.includePath((String)(object = ((String)object).substring(0, ((String)object).lastIndexOf(47))), bModuleContent)) { + if (object2 == null) { + object2 = new XElem("types"); + } + object2.addContent((XContent)bModuleContent2.copy()); + } + ++n; + } + if (object2 != null) { + xElem.addContent((XContent)object2); + } + ListIterator listIterator = this.unknownElements.iterator(); + while (listIterator.hasNext()) { + xElem.addContent((XContent)((XElem)listIterator.next()).copy()); + } + xElem.write(xWriter); + xWriter.flush(); + } + catch (Exception exception) { + throw new LocalizableRuntimeException("platform", "ModulePart.exception.writeXml", (Throwable)exception); + } + } + + public String getArchiveDate() { + return this.moduleElement.get("archiveDate", ""); + } + + public String getArchiveHost() { + return this.moduleElement.get("archiveHost", ""); + } + + public BAbsTime getBuildAbsTime() { + String string = this.moduleElement.get("buildMillis", null); + if (string == null) { + return BAbsTime.NULL; + } + long l = Long.parseLong(string); + return BAbsTime.make((long)l); + } + + public String getBuildDate() { + return this.moduleElement.get("buildDate", ""); + } + + public String getBuildHost() { + return this.moduleElement.get("buildHost", ""); + } + + public BDependency[] getDependencies() { + Class clazz = class$com$tridium$install$BDependency; + if (clazz == null) { + clazz = class$com$tridium$install$BDependency = ModuleManifest.class("[Lcom.tridium.install.BDependency;", false); + } + Array array = new Array(clazz); + Iterator iterator = this.dependencyByName.values().iterator(); + while (iterator.hasNext()) { + array.add(iterator.next()); + } + return (BDependency[])array.trim(); + } + + public BDependency getDependency(String string) { + return (BDependency)((Object)this.dependencyByName.get(string)); + } + + public String getDescription() { + return this.moduleElement.get("description", ""); + } + + public BDependency[] getExclusions() { + if (this.exclElement == null) { + return new BDependency[0]; + } + XElem[] xElemArray = this.exclElement.elems(); + Class clazz = class$com$tridium$install$BDependency; + if (clazz == null) { + clazz = class$com$tridium$install$BDependency = ModuleManifest.class("[Lcom.tridium.install.BDependency;", false); + } + Array array = new Array(clazz); + int n = 0; + while (n < xElemArray.length) { + BDependency bDependency = BDependency.make(xElemArray[n]); + if (bDependency != null) { + array.add((Object)bDependency); + } + ++n; + } + return (BDependency[])array.trim(); + } + + public BModuleContent getModuleContent() { + return BModuleContent.make(this.moduleElement.get("archiveInstall", "doc")); + } + + public BModuleContent getModuleContentForPath(String string) { + return this.getModuleContentForPath(string, this.getModuleContent()); + } + + public BModuleContent getModuleContentForPath(String string, BModuleContent bModuleContent) { + BModuleContent bModuleContent2 = (BModuleContent)((Object)this.moduleContentByPath.get(string)); + return bModuleContent2 == null ? bModuleContent : bModuleContent2; + } + + public String getName() { + return this.moduleElement.get("name"); + } + + public String getPreferredSymbol() { + return this.moduleElement.get("preferredSymbol", ""); + } + + public BModuleStatus getStatus() { + return this.status; + } + + public BVersion getVersion() { + return new BVersion(this.moduleElement.get("vendor", ""), this.moduleElement.get("vendorVersion", this.moduleElement.get("version", "0"))); + } + + public boolean includePath(String string, BModuleContent bModuleContent) { + boolean bl; + BModuleContent bModuleContent2 = string.startsWith("doc/") ? BModuleContent.doc : this.getModuleContentForPath(string, null); + if (bModuleContent2 == null) { + bl = true; + } else { + boolean bl2 = false; + if (bModuleContent.getOrdinal() >= bModuleContent2.getOrdinal()) { + bl2 = true; + } + bl = bl2; + } + return bl; + } + + public boolean noRunningStation() { + return this.noRunningStation; + } + + public void setNoRunningStation(boolean bl) { + this.noRunningStation = bl; + } + + public boolean isInstallable() { + return this.moduleElement.getb("installable", true); + } + + public boolean isNreModule() { + boolean bl = false; + if (this.moduleElement.getb("nre", true) && this.isInstallable()) { + bl = true; + } + return bl; + } + + private final boolean loadManifestHeader(XElem xElem) { + if (!xElem.name().equals("module")) { + this.status = BModuleStatus.misnamed; + return false; + } + this.moduleElement = xElem.copy(); + this.moduleElement.clearContent(); + return true; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.moduleElement = null; + this.typeByName = new HashMap(); + Class clazz = class$javax$baja$xml$XElem; + if (clazz == null) { + clazz = class$javax$baja$xml$XElem = ModuleManifest.class("[Ljavax.baja.xml.XElem;", false); + } + this.types = new Array(clazz); + Class clazz2 = class$javax$baja$xml$XElem; + if (clazz2 == null) { + clazz2 = class$javax$baja$xml$XElem = ModuleManifest.class("[Ljavax.baja.xml.XElem;", false); + } + this.unknownElements = new Array(clazz2); + this.dependencyByName = new HashMap(); + this.moduleContentByPath = new HashMap(); + this.exclElement = null; + this.status = null; + this.noRunningStation = false; + } + + private ModuleManifest(XElem xElem) { + this.this(); + if (!this.loadManifestHeader(xElem)) { + return; + } + try { + XElem[] xElemArray = xElem.elems(); + int n = 0; + while (n < xElemArray.length) { + XElem xElem2; + if (xElemArray[n].name().equals("dirs")) { + xElem2 = xElemArray[n].elems("dir"); + int n2 = 0; + while (n2 < ((XElem[])xElem2).length) { + this.moduleContentByPath.put(xElem2[n2].get("name"), BModuleContent.make(xElem2[n2].get("install", "doc"))); + ++n2; + } + } else if (xElemArray[n].name().equals("dependencies")) { + xElem2 = xElemArray[n].elems("dependency"); + int n3 = 0; + while (n3 < ((XElem[])xElem2).length) { + this.dependencyByName.put(xElem2[n3].get("name"), BDependency.make(xElem2[n3])); + ++n3; + } + } else if (xElemArray[n].name().equals("types")) { + xElem2 = xElemArray[n].elems("type"); + int n4 = 0; + while (n4 < ((XElem[])xElem2).length) { + this.typeByName.put(xElem2[n4].get("name"), xElem2[n4]); + this.types.add((Object)xElem2[n4]); + ++n4; + } + } else if (xElemArray[n].name().equals("installation")) { + this.noRunningStation = xElemArray[n].getb("noRunningStation", this.getName().equals("baja")); + xElem2 = xElemArray[n].elem("dependencies"); + this.exclElement = xElemArray[n].elem("exclusions"); + if (xElem2 != null) { + XElem[] xElemArray2 = xElem2.elems(); + int n5 = 0; + while (n5 < xElemArray2.length) { + BDependency bDependency = BDependency.make(xElemArray2[n5]); + if (bDependency != null) { + if (bDependency.getPartName().startsWith("nre-core") && xElemArray2[n5].get("solvers", null) == null) { + bDependency.setSolverFiltersString("commissioning"); + } + this.dependencyByName.put(bDependency.getPartName(), bDependency); + } + ++n5; + } + } + } else { + this.unknownElements.add((Object)xElemArray[n]); + } + ++n; + } + this.status = BModuleStatus.ok; + } + catch (Exception exception) { + this.status = BModuleStatus.corrupt; + } + } + + private ModuleManifest(XElem xElem, XParser xParser) throws Exception { + this.this(); + if (this.loadManifestHeader(xElem)) { + while (xParser.next() != -1) { + Object object; + if (xParser.type() != 1) continue; + if (xParser.elem().name().equals("dir")) { + this.moduleContentByPath.put(xParser.elem().get("name"), BModuleContent.make(xParser.elem().get("install", "doc"))); + continue; + } + if (xParser.elem().name().equals("dependency")) { + this.dependencyByName.put(xParser.elem().get("name"), BDependency.make(xParser.elem())); + continue; + } + if (xParser.elem().name().equals("exclusions")) { + this.exclElement = xParser.parseCurrent(false); + continue; + } + if (xParser.depth() > 1 && xParser.elem(xParser.depth() - 2).name().equals("dependencies")) { + object = BDependency.make(xParser.elem()); + if (object == null) continue; + if (object.getPartName().startsWith("nre-core") && xParser.elem().get("solvers", null) == null) { + object.setSolverFiltersString("commissioning"); + } + this.dependencyByName.put(object.getPartName(), object); + continue; + } + if (xParser.elem().name().equals("type")) { + object = xParser.parseCurrent(false); + this.typeByName.put(xParser.elem().get("name"), object); + this.types.add(object); + continue; + } + if (xParser.elem().name().equals("installation")) { + this.noRunningStation = xParser.elem().getb("noRunningStation", this.getName().equals("baja")); + continue; + } + if (xParser.elem().name().equals("types") || xParser.elem().name().equals("dependencies") || xParser.elem().name().equals("dirs") || xParser.depth() != 2) continue; + this.unknownElements.add((Object)xParser.parseCurrent(false)); + } + this.status = BModuleStatus.ok; + } + } + + private ModuleManifest(BModuleStatus bModuleStatus) { + this.this(); + this.status = bModuleStatus; + } +} + diff --git a/modules/cfr_output/com/tridium/install/part/BApplicationPart.java b/modules/cfr_output/com/tridium/install/part/BApplicationPart.java new file mode 100644 index 0000000..f64a4c1 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/part/BApplicationPart.java @@ -0,0 +1,114 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.install.part; + +import com.tridium.install.BDependency; +import com.tridium.install.BVersion; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.part.BPart; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BApplicationPart +extends BPart { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$install$part$BApplicationPart; + + public Type getType() { + return TYPE; + } + + public boolean meets(BDependency bDependency) { + boolean bl = false; + if (bDependency.getPartType().is(TYPE) && this.getVersion().meets(bDependency) && this.matchesName(bDependency.getPartName())) { + bl = true; + } + return bl; + } + + public static BPart make(XElem xElem) { + return BApplicationPart.make(xElem, null); + } + + public static BPart make(XElem xElem, BInstallable bInstallable) { + if (xElem == null) { + return null; + } + if (xElem.name().equals("app")) { + System.out.println("make BApplicationPart: " + xElem.get("name") + ' ' + BApplicationPart.getVendorVersion(xElem)); + return new BApplicationPart(xElem.get("name"), new BVersion("", BApplicationPart.getVendorVersion(xElem)), bInstallable); + } + return null; + } + + public XElem getXml() { + XElem xElem = new XElem("app"); + xElem.setAttr("name", this.getPartName()); + if (this.getVersion().getVendor().trim().length() > 0) { + xElem.setAttr("vendor", this.getVersion().getVendor()); + } + if (this.getVersion().getVendorVersionString().trim().length() > 0) { + xElem.setAttr("version", this.getVersion().getVendorVersionString()); + } + if (this.getDescription().trim().length() > 0) { + xElem.setAttr("description", this.getDescription()); + } + return xElem; + } + + public String toString(Context context) { + return "App Part: " + this.getPartName() + ' ' + (Object)((Object)this.getVersion()); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BApplicationPart() { + } + + public BApplicationPart(String string, String string2) { + this.setPartName(string); + this.setVersion(new BVersion(string2)); + } + + public BApplicationPart(String string, BVersion bVersion) { + this.setPartName(string); + this.setVersion(bVersion); + } + + public BApplicationPart(String string, BVersion bVersion, BInstallable bInstallable) { + this(string, bVersion); + this.setInstallable(bInstallable); + } + + static { + Class clazz = class$com$tridium$install$part$BApplicationPart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BApplicationPart = BApplicationPart.class("[Lcom.tridium.install.part.BApplicationPart;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/install/part/BArchPart.java b/modules/cfr_output/com/tridium/install/part/BArchPart.java new file mode 100644 index 0000000..e6d5890 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/part/BArchPart.java @@ -0,0 +1,106 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BIcon + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.install.part; + +import com.tridium.install.BDependency; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.part.BPart; +import javax.baja.sys.BIcon; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BArchPart +extends BPart { + public static final Type TYPE; + private static final BIcon icon; + static /* synthetic */ Class class$com$tridium$install$part$BArchPart; + + public Type getType() { + return TYPE; + } + + public boolean meets(BDependency bDependency) { + boolean bl = false; + if (bDependency.getPartType().is(TYPE) && this.matchesName(bDependency.getPartName())) { + bl = true; + } + return bl; + } + + public static BPart make(XElem xElem) { + return BArchPart.make(xElem, null); + } + + public static BPart make(XElem xElem, BInstallable bInstallable) { + if (xElem == null) { + return null; + } + return new BArchPart(xElem.get("name"), bInstallable); + } + + public XElem getXml() { + XElem xElem = new XElem("arch"); + xElem.setAttr("name", this.getPartName()); + return xElem; + } + + public boolean isNull() { + return this.getPartName().equals("nullarch"); + } + + public static BArchPart makeNull() { + return new BArchPart("nullarch", null); + } + + public String toString(Context context) { + return "Arch Part: " + this.getPartName(); + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BArchPart() { + } + + public BArchPart(String string, BInstallable bInstallable) { + this.setPartName(string); + this.setInstallable(bInstallable); + } + + static { + Class clazz = class$com$tridium$install$part$BArchPart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BArchPart = BArchPart.class("[Lcom.tridium.install.part.BArchPart;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BPart.getPartTypeIcon(TYPE); + } +} + diff --git a/modules/cfr_output/com/tridium/install/part/BBrandPart.java b/modules/cfr_output/com/tridium/install/part/BBrandPart.java new file mode 100644 index 0000000..75efbd8 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/part/BBrandPart.java @@ -0,0 +1,118 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BIcon + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.install.part; + +import com.tridium.install.BDependency; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.part.BPart; +import javax.baja.sys.BIcon; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BBrandPart +extends BPart { + public static final Type TYPE; + private static final BIcon icon; + public static final String NO_BRAND = "noBrand"; + static /* synthetic */ Class class$com$tridium$install$part$BBrandPart; + + public Type getType() { + return TYPE; + } + + public boolean meets(BDependency bDependency) { + boolean bl = false; + if (bDependency.getPartType().is(TYPE) && (this.isNull() || this.matchesName(bDependency.getPartName()))) { + bl = true; + } + return bl; + } + + public static BPart make(XElem xElem) { + return BBrandPart.make(xElem, null); + } + + public static BPart make(XElem xElem, BInstallable bInstallable) { + if (xElem == null) { + return null; + } + if (xElem.name().equals("brand")) { + String string = xElem.get("name", NO_BRAND); + if (string.trim().length() == 0) { + string = NO_BRAND; + } + return new BBrandPart(string, bInstallable); + } + return null; + } + + public XElem getXml() { + XElem xElem = new XElem("brand"); + xElem.setAttr("name", this.getPartName()); + return xElem; + } + + public String toString(Context context) { + return "Brand Part: " + this.getPartName(); + } + + public boolean isNull() { + boolean bl = false; + if (this.getPartName().equals(NO_BRAND) || this.getPartName().equals("disabled") || this.getPartName().equals("nullos")) { + bl = true; + } + return bl; + } + + public static BBrandPart makeNull() { + return new BBrandPart(NO_BRAND, null); + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BBrandPart() { + } + + public BBrandPart(String string, BInstallable bInstallable) { + this.setPartName(string); + this.setInstallable(bInstallable); + } + + static { + Class clazz = class$com$tridium$install$part$BBrandPart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BBrandPart = BBrandPart.class("[Lcom.tridium.install.part.BBrandPart;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BPart.getPartTypeIcon(TYPE); + } +} + diff --git a/modules/cfr_output/com/tridium/install/part/BGenericPart.java b/modules/cfr_output/com/tridium/install/part/BGenericPart.java new file mode 100644 index 0000000..172fe67 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/part/BGenericPart.java @@ -0,0 +1,106 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BIcon + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.install.part; + +import com.tridium.install.BDependency; +import com.tridium.install.BVersion; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.part.BPart; +import javax.baja.sys.BIcon; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BGenericPart +extends BPart { + public static final Type TYPE; + private static final BIcon icon; + static /* synthetic */ Class class$com$tridium$install$part$BGenericPart; + + public Type getType() { + return TYPE; + } + + public static BPart make(XElem xElem) { + return BGenericPart.make(xElem, null); + } + + public static BPart make(XElem xElem, BInstallable bInstallable) { + if (xElem == null) { + return null; + } + if (xElem.name().equals("part")) { + return new BGenericPart(xElem.get("name"), xElem.get("description", ""), bInstallable, new BVersion(BGenericPart.getVendorVersion(xElem))); + } + return null; + } + + public boolean meets(BDependency bDependency) { + boolean bl = false; + if (bDependency.getPartType().is(TYPE) && this.getVersion().meets(bDependency) && this.matchesName(bDependency.getPartName())) { + bl = true; + } + return bl; + } + + public String toString(Context context) { + return "Part: " + this.getPartName(); + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BGenericPart() { + } + + public BGenericPart(String string, String string2) { + this(string, string2, null, BVersion.makeZero()); + } + + public BGenericPart(String string, String string2, BInstallable bInstallable) { + this(string, string2, bInstallable, BVersion.makeZero()); + } + + public BGenericPart(String string, String string2, BInstallable bInstallable, BVersion bVersion) { + this.setPartName(string); + this.setDescription(string2); + this.setInstallable(bInstallable); + this.setVersion(bVersion); + } + + static { + Class clazz = class$com$tridium$install$part$BGenericPart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BGenericPart = BGenericPart.class("[Lcom.tridium.install.part.BGenericPart;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BPart.getPartTypeIcon(TYPE); + } +} + diff --git a/modules/cfr_output/com/tridium/install/part/BModelPart.java b/modules/cfr_output/com/tridium/install/part/BModelPart.java new file mode 100644 index 0000000..d511e93 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/part/BModelPart.java @@ -0,0 +1,104 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BIcon + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.install.part; + +import com.tridium.install.BDependency; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.part.BGenericPart; +import com.tridium.install.part.BPart; +import javax.baja.sys.BIcon; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BModelPart +extends BPart { + public static final Type TYPE; + private static final BIcon icon; + static /* synthetic */ Class class$com$tridium$install$part$BModelPart; + + public Type getType() { + return TYPE; + } + + public boolean meets(BDependency bDependency) { + boolean bl = false; + if (!this.isNull() && (bDependency.getPartType().is(TYPE) || bDependency.getPartType().is(BGenericPart.TYPE)) && this.matchesName(bDependency.getPartName())) { + bl = true; + } + return bl; + } + + public static BPart make(XElem xElem) { + return BModelPart.make(xElem, null); + } + + public static BPart make(XElem xElem, BInstallable bInstallable) { + if (xElem == null) { + return null; + } + if (xElem.name().equals("model")) { + return new BModelPart(xElem.get("name"), bInstallable); + } + return null; + } + + public String toString(Context context) { + return "Model Part: " + this.getPartName(); + } + + public boolean isNull() { + return this.getPartName().equals(""); + } + + public static BModelPart makeNull() { + return new BModelPart("", null); + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BModelPart() { + } + + public BModelPart(String string, BInstallable bInstallable) { + this.setPartName(string); + this.setInstallable(bInstallable); + } + + static { + Class clazz = class$com$tridium$install$part$BModelPart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BModelPart = BModelPart.class("[Lcom.tridium.install.part.BModelPart;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BPart.getPartTypeIcon(TYPE); + } +} + diff --git a/modules/cfr_output/com/tridium/install/part/BModulePart.java b/modules/cfr_output/com/tridium/install/part/BModulePart.java new file mode 100644 index 0000000..baceb44 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/part/BModulePart.java @@ -0,0 +1,747 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.registry.NModuleInfo + * javax.baja.file.BFileSystem + * javax.baja.file.BIFile + * javax.baja.file.FilePath + * javax.baja.file.FileUtil + * javax.baja.naming.SlotPath + * javax.baja.sys.BAbsTime + * javax.baja.sys.BIcon + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.Context + * javax.baja.sys.LocalizableRuntimeException + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.install.part; + +import com.tridium.install.BDaemonPlatform; +import com.tridium.install.BDependency; +import com.tridium.install.BRemoteDaemonPlatform; +import com.tridium.install.BVersion; +import com.tridium.install.ClassCondenser; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.installable.BModuleInstallable; +import com.tridium.install.installable.ModuleManifest; +import com.tridium.install.part.BModuleStatus; +import com.tridium.install.part.BPart; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.daemon.BModuleContent; +import com.tridium.platform.daemon.DaemonFileUtil; +import com.tridium.platform.daemon.message.FileTransferMessageElement; +import com.tridium.sys.registry.NModuleInfo; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.HashSet; +import java.util.Set; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; +import javax.baja.file.BFileSystem; +import javax.baja.file.BIFile; +import javax.baja.file.FilePath; +import javax.baja.file.FileUtil; +import javax.baja.naming.SlotPath; +import javax.baja.platform.install.BVersionRelation; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BIcon; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.Context; +import javax.baja.sys.LocalizableRuntimeException; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BModulePart +extends BPart { + public static final Property status = BModulePart.newProperty((int)1, (BValue)BModuleStatus.ok, null); + public static final Property buildDate = BModulePart.newProperty((int)1, (String)"", null); + public static final Property buildAbsTime = BModulePart.newProperty((int)1, (BValue)BAbsTime.NULL, null); + public static final Property buildHost = BModulePart.newProperty((int)1, (String)"", null); + public static final Property archiveDate = BModulePart.newProperty((int)1, (String)"", null); + public static final Property archiveHost = BModulePart.newProperty((int)1, (String)"", null); + public static final Property archiveContent = BModulePart.newProperty((int)1, (BValue)BModuleContent.doc, null); + public static final Property preferredSymbol = BModulePart.newProperty((int)1, (String)"", null); + public static final Property fileSize = BModulePart.newProperty((int)1, (int)-1, null); + public static final Property synthetic = BModulePart.newProperty((int)1, (boolean)false, null); + public static final Property exclusions = BModulePart.newProperty((int)1, (BValue)new BVector(), null); + public static final Property isNre = BModulePart.newProperty((int)1, (boolean)true, null); + public static final Property isInstallable = BModulePart.newProperty((int)1, (boolean)true, null); + public static final Type TYPE; + public static final FilePath MODULES_PATH; + public static final FilePath LIB_PATH; + private static final BIcon icon; + private BIFile file; + private boolean localInstance; + private boolean summaryInitialized; + private boolean dependsInitialized; + private ModuleManifest manifest; + static /* synthetic */ Class class$com$tridium$install$part$BModulePart; + + public BModuleStatus getStatus() { + return (BModuleStatus)this.get(status); + } + + public void setStatus(BModuleStatus bModuleStatus) { + this.set(status, (BValue)bModuleStatus, null); + } + + public String getBuildDate() { + return this.getString(buildDate); + } + + public void setBuildDate(String string) { + this.setString(buildDate, string, null); + } + + public BAbsTime getBuildAbsTime() { + return (BAbsTime)this.get(buildAbsTime); + } + + public void setBuildAbsTime(BAbsTime bAbsTime) { + this.set(buildAbsTime, (BValue)bAbsTime, null); + } + + public String getBuildHost() { + return this.getString(buildHost); + } + + public void setBuildHost(String string) { + this.setString(buildHost, string, null); + } + + public String getArchiveDate() { + return this.getString(archiveDate); + } + + public void setArchiveDate(String string) { + this.setString(archiveDate, string, null); + } + + public String getArchiveHost() { + return this.getString(archiveHost); + } + + public void setArchiveHost(String string) { + this.setString(archiveHost, string, null); + } + + public BModuleContent getArchiveContent() { + return (BModuleContent)this.get(archiveContent); + } + + public void setArchiveContent(BModuleContent bModuleContent) { + this.set(archiveContent, (BValue)bModuleContent, null); + } + + public String getPreferredSymbol() { + return this.getString(preferredSymbol); + } + + public void setPreferredSymbol(String string) { + this.setString(preferredSymbol, string, null); + } + + public long getFileSize() { + return this.getLong(fileSize); + } + + public void setFileSize(long l) { + this.setLong(fileSize, l, null); + } + + public boolean getSynthetic() { + return this.getBoolean(synthetic); + } + + public void setSynthetic(boolean bl) { + this.setBoolean(synthetic, bl, null); + } + + public BVector getExclusions() { + return (BVector)this.get(exclusions); + } + + public void setExclusions(BVector bVector) { + this.set(exclusions, (BValue)bVector, null); + } + + public boolean getIsNre() { + return this.getBoolean(isNre); + } + + public void setIsNre(boolean bl) { + this.setBoolean(isNre, bl, null); + } + + public boolean getIsInstallable() { + return this.getBoolean(isInstallable); + } + + public void setIsInstallable(boolean bl) { + this.setBoolean(isInstallable, bl, null); + } + + public Type getType() { + return TYPE; + } + + public static BModulePart make(BIFile bIFile) { + BModuleInstallable bModuleInstallable = BModuleInstallable.make(bIFile, true); + return bModuleInstallable == null ? null : bModuleInstallable.getModulePart(); + } + + public static BModulePart make(BIFile bIFile, boolean bl) { + BModuleInstallable bModuleInstallable = BModuleInstallable.make(bIFile, bl); + return bModuleInstallable == null ? null : bModuleInstallable.getModulePart(); + } + + public static BModulePart make(String string, XElem xElem) { + if (string == null) { + return null; + } + BModulePart bModulePart = new BModulePart(); + bModulePart.setPartName(string); + if (xElem == null) { + bModulePart.setStatus(BModuleStatus.nomanifest); + } else { + bModulePart.loadManifest(xElem); + } + return bModulePart; + } + + public static BModulePart make(BIFile bIFile, BInstallable bInstallable) { + try { + InputStream inputStream = DaemonFileUtil.getZipStream(bIFile, new FilePath("META-INF/module.xml")); + if (inputStream == null) { + inputStream = DaemonFileUtil.getZipStream(bIFile, new FilePath("meta-inf/module.xml")); + } + if (inputStream == null) { + inputStream = DaemonFileUtil.getZipStream(bIFile, new FilePath("META-INF/module.xml")); + } + if (inputStream == null) { + return null; + } + return new BModulePart(bIFile, inputStream, bInstallable); + } + catch (IOException iOException) { + throw new LocalizableRuntimeException("platform", "ModulePart.exception.manifestRead", new Object[]{bIFile.getFilePath()}, (Throwable)iOException); + } + } + + public boolean meets(BDependency bDependency) { + this.initSummary(); + boolean bl = false; + if (bDependency.getPartType().is(TYPE) && this.getVersion().meets(bDependency) && this.matchesName(bDependency.getPartName())) { + bl = true; + } + return bl; + } + + public boolean isInstallable() { + return true; + } + + public BVector getDependencies() { + if (!this.dependsInitialized) { + this.init(); + } + return super.getDependencies(); + } + + public void initSummary() { + if (!this.summaryInitialized) { + this.init(); + } + } + + public void init() { + if (this.manifest != null || !this.localInstance || !this.getInstallable().getIsValid()) { + return; + } + if (this.file != null) { + try { + InputStream inputStream = DaemonFileUtil.getZipStream(this.file, new FilePath("META-INF/module.xml")); + if (inputStream == null) { + inputStream = DaemonFileUtil.getZipStream(this.file, new FilePath("meta-inf/module.xml")); + } + if (inputStream == null) { + inputStream = DaemonFileUtil.getZipStream(this.file, new FilePath("META-INF/module.xml")); + } + this.loadManifest(inputStream); + } + catch (RuntimeException runtimeException) { + throw runtimeException; + } + catch (Exception exception) { + throw new BajaRuntimeException((Throwable)exception); + } + } + } + + public BDependency getDependency(String string) { + return (BDependency)this.getDependencies().get(SlotPath.escape((String)string)); + } + + public FilePath getDestinationPath() { + if (!this.getSynthetic()) { + return MODULES_PATH.merge(this.getPartName() + ".jar"); + } + return MODULES_PATH.merge(this.getPartName() + ".sjar"); + } + + public BIcon getIcon() { + return icon; + } + + public InputStream getInputStream() { + if (!this.localInstance) { + throw new IllegalStateException("illegal call on proxy instance of BModulePart"); + } + try { + return this.file.getInputStream(); + } + catch (IOException iOException) { + throw new LocalizableRuntimeException("platform", "LocalModulePart.exception.notFound", new Object[]{this.file.getFilePath()}, (Throwable)iOException); + } + } + + public ModuleManifest getManifest() { + if (!this.localInstance) { + throw new IllegalStateException("illegal call on proxy instance of BModulePart"); + } + this.init(); + return this.manifest; + } + + public BVersion getVersionRequired(String string) { + BDependency bDependency = this.getDependency(string); + return bDependency == null ? BVersion.ZERO : bDependency.getVersion(); + } + + public Set getRequiredModuleNames() { + Property[] propertyArray = this.getDependencies().getPropertiesArray(); + HashSet hashSet = new HashSet(); + int n = 0; + while (n < propertyArray.length) { + hashSet.add(propertyArray[n].getName()); + ++n; + } + return hashSet; + } + + public boolean isUpgradeFor(BModulePart bModulePart) { + this.initSummary(); + if (bModulePart.getVersion().meetsVersionRequirement(this.getVersion(), BVersionRelation.minimum)) { + return bModulePart.getBuildAbsTime() != null && this.getBuildAbsTime() != null && this.getBuildAbsTime().compareTo((Object)bModulePart.getBuildAbsTime()) > 0; + } + return true; + } + + public boolean isUpdateFor(BModulePart bModulePart) { + return this.isUpdateFor(bModulePart, null); + } + + public boolean isUpdateFor(BModulePart bModulePart, BDaemonPlatform bDaemonPlatform) { + this.initSummary(); + if (bDaemonPlatform != null && bDaemonPlatform.getModuleContent() != bModulePart.getArchiveContent()) { + return true; + } + if (bModulePart.getVersion().equivalent((Object)this.getVersion())) { + return bModulePart.getBuildAbsTime() == null || this.getBuildAbsTime() == null || !this.getBuildAbsTime().equals((Object)bModulePart.getBuildAbsTime()); + } + return true; + } + + public String toString(Context context) { + return "Module: " + this.getPartName() + ' ' + (Object)((Object)this.getVersion()); + } + + public void writePackageArchive(BDaemonPlatform bDaemonPlatform, ZipOutputStream zipOutputStream) throws Exception { + this.writePackageArchive(bDaemonPlatform.getModuleContent(), bDaemonPlatform.getStripLineNumbers(), zipOutputStream); + } + + public void writePackageArchive(BModuleContent bModuleContent, boolean bl, ZipOutputStream zipOutputStream) throws Exception { + if (!this.localInstance) { + throw new IllegalStateException("illegal call on proxy instance of BModulePart"); + } + this.init(); + try { + ZipEntry zipEntry; + ZipInputStream zipInputStream = new ZipInputStream(this.getInputStream()); + ClassCondenser classCondenser = new ClassCondenser(); + while ((zipEntry = zipInputStream.getNextEntry()) != null) { + Object object; + if (zipEntry.getName().equalsIgnoreCase("meta-inf/module.xml")) { + object = new ByteArrayOutputStream(); + this.getManifest().write(bModuleContent, (OutputStream)object); + ZipEntry zipEntry2 = new ZipEntry(zipEntry.getName()); + zipEntry2.setSize(((ByteArrayOutputStream)object).size()); + zipEntry2.setTime(System.currentTimeMillis()); + zipOutputStream.putNextEntry(zipEntry2); + zipOutputStream.write(((ByteArrayOutputStream)object).toByteArray(), 0, ((ByteArrayOutputStream)object).size()); + zipOutputStream.closeEntry(); + continue; + } + if (!this.getManifest().includePath(this.getDirectoryName(zipEntry), bModuleContent)) continue; + if (bl && zipEntry.getName().endsWith(".class")) { + zipOutputStream.putNextEntry(new ZipEntry(zipEntry.getName())); + classCondenser.condense(zipInputStream, zipOutputStream, false); + } else { + zipOutputStream.putNextEntry(new ZipEntry(zipEntry)); + object = new byte[65000]; + int n = zipInputStream.read((byte[])object); + while (n >= 0) { + zipOutputStream.write((byte[])object, 0, n); + n = zipInputStream.read((byte[])object); + } + } + zipOutputStream.closeEntry(); + } + zipInputStream.close(); + } + catch (IOException iOException) { + throw new LocalizableRuntimeException("platform", "ModulePart.exception.writePackageArchive", new Object[]{this.getPartName()}, (Throwable)iOException); + } + } + + private final void loadManifest(XElem xElem) { + this.loadManifest(ModuleManifest.make(xElem)); + } + + private final void loadManifest(InputStream inputStream) { + this.loadManifest(inputStream, true); + } + + private final void loadManifest(InputStream inputStream, boolean bl) { + this.loadManifest(ModuleManifest.make(inputStream, bl)); + } + + private final void loadManifest(ModuleManifest moduleManifest) { + this.manifest = moduleManifest; + this.setStatus(moduleManifest.getStatus()); + if (!this.summaryInitialized) { + this.setPartName(moduleManifest.getName()); + this.setBuildAbsTime(moduleManifest.getBuildAbsTime()); + this.setVersion((BVersion)moduleManifest.getVersion().newCopy()); + this.setDescription(moduleManifest.getDescription()); + this.setArchiveContent(moduleManifest.getModuleContent()); + this.summaryInitialized = true; + } + if (!this.dependsInitialized) { + BVector bVector = (BVector)this.get(dependencies); + bVector.removeAll(); + BDependency[] bDependencyArray = moduleManifest.getDependencies(); + int n = 0; + while (n < bDependencyArray.length) { + bVector.add(SlotPath.escape((String)bDependencyArray[n].getPartName()), bDependencyArray[n].newCopy()); + ++n; + } + BDependency[] bDependencyArray2 = moduleManifest.getExclusions(); + bVector = (BVector)this.get(exclusions); + bVector.removeAll(); + int n2 = 0; + while (n2 < bDependencyArray2.length) { + bVector.add("excl?", (BValue)bDependencyArray2[n2]); + ++n2; + } + this.dependsInitialized = true; + } + this.setBuildDate(moduleManifest.getBuildDate()); + this.setBuildHost(moduleManifest.getBuildHost()); + this.setArchiveDate(moduleManifest.getArchiveDate()); + this.setArchiveHost(moduleManifest.getArchiveHost()); + this.setPreferredSymbol(moduleManifest.getPreferredSymbol()); + this.setIsNre(moduleManifest.isNreModule()); + this.setIsInstallable(moduleManifest.isInstallable()); + } + + private final String getDirectoryName(ZipEntry zipEntry) { + if (!this.localInstance) { + throw new IllegalStateException("illegal call on proxy instance of BModulePart"); + } + if (zipEntry.isDirectory()) { + return zipEntry.getName(); + } + int n = zipEntry.getName().lastIndexOf(47); + if (n < 0) { + return ""; + } + return zipEntry.getName().substring(0, n); + } + + public long getFilteredFileSize(BDaemonPlatform bDaemonPlatform) { + return this.getFilteredFileSize(bDaemonPlatform.getModuleContent(), bDaemonPlatform.getStripLineNumbers()); + } + + public long getFilteredFileSize(BModuleContent bModuleContent, boolean bl) { + if (this.localInstance && bModuleContent != BModuleContent.doc) { + try { + ByteCounter byteCounter = new ByteCounter(); + ZipOutputStream zipOutputStream = new ZipOutputStream(byteCounter); + this.writePackageArchive(bModuleContent, bl, zipOutputStream); + zipOutputStream.closeEntry(); + zipOutputStream.flush(); + zipOutputStream.close(); + byteCounter.flush(); + byteCounter.close(); + return byteCounter.size(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + return this.getInstallable().getInstallableFileSize(); + } + + public boolean canMakeTransferElements() { + return this.localInstance; + } + + public FileTransferMessageElement makeTransferElement(BDaemonPlatform bDaemonPlatform) { + if (!this.localInstance) { + throw new IllegalStateException("illegal call on proxy instance of BModuleInstallable"); + } + return new ModuleFileTransferElement(this, bDaemonPlatform.getDaemonSession()); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.file = null; + this.localInstance = false; + this.summaryInitialized = false; + this.dependsInitialized = false; + this.manifest = null; + } + + public BModulePart() { + this.this(); + } + + public BModulePart(BIFile bIFile, NModuleInfo nModuleInfo, BInstallable bInstallable) { + this.this(); + this.file = bIFile; + this.localInstance = true; + this.setInstallable(bInstallable); + this.setStatus(BModuleStatus.ok); + this.setFileSize(bIFile.getSize()); + this.setPartName(nModuleInfo.getModuleName()); + this.setBuildAbsTime(BAbsTime.make((long)nModuleInfo.getBuildTime())); + this.getVersion().setVendor(nModuleInfo.getVendor()); + this.getVersion().setVendorVersion(nModuleInfo.getVendorVersion()); + this.setDescription(nModuleInfo.getDescription()); + this.setArchiveContent(BModuleContent.make(nModuleInfo.getModuleContent())); + this.setSynthetic(bIFile.getExtension().equals("sjar")); + this.summaryInitialized = true; + } + + public BModulePart(BIFile bIFile, InputStream inputStream, BInstallable bInstallable) { + this(bIFile, inputStream, bInstallable, true); + } + + public BModulePart(BIFile bIFile, InputStream inputStream, BInstallable bInstallable, boolean bl) { + this.this(); + this.file = bIFile; + this.localInstance = true; + this.setInstallable(bInstallable); + if (inputStream == null) { + this.setStatus(BModuleStatus.nomanifest); + if (bInstallable != null) { + bInstallable.setIsValid(false); + } + } else { + this.setStatus(BModuleStatus.ok); + } + this.setFileSize(bIFile.getSize()); + if (bIFile.getExtension().equals("jar")) { + this.setPartName(bIFile.getFileName().substring(0, bIFile.getFileName().length() - 4)); + } else if (bIFile.getExtension().equals("sjar")) { + this.setPartName(bIFile.getFileName().substring(0, bIFile.getFileName().length() - 5)); + this.setSynthetic(true); + } + if (inputStream != null) { + this.loadManifest(inputStream, bl); + } + } + + static { + Class clazz = class$com$tridium$install$part$BModulePart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BModulePart = BModulePart.class("[Lcom.tridium.install.part.BModulePart;", false); + } + TYPE = Sys.loadType((Class)clazz); + MODULES_PATH = new FilePath("!modules"); + LIB_PATH = new FilePath("!lib"); + icon = BPart.getPartTypeIcon(TYPE); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class ByteCounter + extends OutputStream { + private long size; + + public void write(byte[] byArray) throws IOException { + this.size += (long)byArray.length; + } + + public void write(byte[] byArray, int n, int n2) { + this.size += (long)n2; + } + + public void write(int n) { + ++this.size; + } + + public long size() { + return this.size; + } + + private final /* synthetic */ void this() { + this.size = 0L; + } + + private ByteCounter() { + this.this(); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private static class ModuleFileTransferElement + extends FileTransferMessageElement { + private static final BIcon icon = BIcon.std((String)"module.png"); + private BModulePart sourceModule; + private BDaemonSession session; + private byte[] buf; + + public InputStream getStream() throws IOException { + try { + if (this.modifyContents()) { + byte[] byArray = this.getModifiedBuf(); + if ("true".equals(System.getProperty("niagara.install.copyProcessedModule", "false"))) { + BIFile bIFile = BFileSystem.INSTANCE.makeFile(new FilePath("!moduleCopies/" + this.sourceModule.getDestinationPath().getName())); + FileUtil.pipe((InputStream)new ByteArrayInputStream(byArray), (OutputStream)bIFile.getOutputStream()); + } + return new ByteArrayInputStream(byArray); + } + return this.sourceModule.getInputStream(); + } + catch (Exception exception) { + throw new LocalizableRuntimeException("platform", "ModuleFileTransferElement.exception.read", (Throwable)exception); + } + } + + public long getSize() { + if (this.modifyContents()) { + return this.getModifiedBuf().length; + } + return this.sourceModule.getFileSize(); + } + + private final BDaemonPlatform getDaemonPlatform() { + try { + return BRemoteDaemonPlatform.make(this.session, null); + } + catch (RuntimeException runtimeException) { + throw runtimeException; + } + catch (Exception exception) { + throw new BajaRuntimeException((Throwable)exception); + } + } + + private final boolean modifyContents() { + boolean bl = false; + if (this.getDaemonPlatform().getModuleContent() != BModuleContent.doc) { + bl = true; + } + return bl; + } + + /* + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + private final byte[] getModifiedBuf() { + if (this.buf != null) return this.buf; + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + ZipOutputStream zipOutputStream = new ZipOutputStream(byteArrayOutputStream); + try { + try { + this.sourceModule.writePackageArchive(this.getDaemonPlatform(), zipOutputStream); + } + catch (Exception exception) {} + } + catch (Throwable throwable) { + Object var4_4 = null; + try { + zipOutputStream.closeEntry(); + zipOutputStream.flush(); + zipOutputStream.close(); + throw throwable; + } + catch (Exception exception) {} + throw throwable; + } + { + Object var4_5 = null; + } + try {} + catch (Exception exception) {} + zipOutputStream.closeEntry(); + zipOutputStream.flush(); + zipOutputStream.close(); + this.buf = byteArrayOutputStream.toByteArray(); + return this.buf; + } + + public BIcon getIcon() { + return icon; + } + + private final /* synthetic */ void this() { + this.buf = null; + } + + public ModuleFileTransferElement(BModulePart bModulePart, BDaemonSession bDaemonSession) { + super(bModulePart.getDestinationPath(), bDaemonSession.getFileSpace()); + this.this(); + this.sourceModule = bModulePart; + this.session = bDaemonSession; + } + } +} + diff --git a/modules/cfr_output/com/tridium/install/part/BModuleStatus.java b/modules/cfr_output/com/tridium/install/part/BModuleStatus.java new file mode 100644 index 0000000..05bb702 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/part/BModuleStatus.java @@ -0,0 +1,70 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BFrozenEnum + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.install.part; + +import javax.baja.sys.BFrozenEnum; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public final class BModuleStatus +extends BFrozenEnum { + public static final int OK = 0; + public static final int CORRUPT = 1; + public static final int NOMANIFEST = 2; + public static final int MISNAMED = 3; + public static final BModuleStatus ok = new BModuleStatus(0); + public static final BModuleStatus corrupt = new BModuleStatus(1); + public static final BModuleStatus nomanifest = new BModuleStatus(2); + public static final BModuleStatus misnamed = new BModuleStatus(3); + public static final Type TYPE; + public static final BModuleStatus DEFAULT; + static /* synthetic */ Class class$com$tridium$install$part$BModuleStatus; + + public final Type getType() { + return TYPE; + } + + public static final BModuleStatus make(int n) { + return (BModuleStatus)ok.getRange().get(n, false); + } + + public static final BModuleStatus make(String string) { + return (BModuleStatus)ok.getRange().get(string); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private BModuleStatus(int n) { + super(n); + } + + static { + Class clazz = class$com$tridium$install$part$BModuleStatus; + if (clazz == null) { + clazz = class$com$tridium$install$part$BModuleStatus = BModuleStatus.class("[Lcom.tridium.install.part.BModuleStatus;", false); + } + TYPE = Sys.loadType((Class)clazz); + DEFAULT = ok; + } +} + diff --git a/modules/cfr_output/com/tridium/install/part/BNrePart.java b/modules/cfr_output/com/tridium/install/part/BNrePart.java new file mode 100644 index 0000000..dba2848 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/part/BNrePart.java @@ -0,0 +1,128 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BIcon + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.install.part; + +import com.tridium.install.BDependency; +import com.tridium.install.BVersion; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.part.BPart; +import javax.baja.sys.BIcon; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BNrePart +extends BPart { + public static final Type TYPE; + private static final BIcon icon; + static /* synthetic */ Class class$com$tridium$install$part$BNrePart; + + public Type getType() { + return TYPE; + } + + public boolean meets(BDependency bDependency) { + boolean bl = false; + if (bDependency.getPartType().is(TYPE) && this.getVersion().meets(bDependency) && this.matchesName(bDependency.getPartName())) { + bl = true; + } + return bl; + } + + public static BPart make(XElem xElem) { + return BNrePart.make(xElem, null); + } + + public static BPart make(XElem xElem, BInstallable bInstallable) { + if (xElem == null) { + return null; + } + if (xElem.name().equals("nre")) { + return new BNrePart(xElem.get("name", ""), xElem.get("description", ""), new BVersion(xElem.get("bajaVersion", ""), BNrePart.getVendorVersion(xElem)), bInstallable); + } + return null; + } + + public XElem getXml() { + XElem xElem = new XElem("nre"); + xElem.setAttr("name", this.getPartName()); + if (this.getVersion().getVendor().trim().length() > 0) { + xElem.setAttr("vendor", this.getVersion().getVendor()); + } + if (this.getVersion().getBajaVersionString().trim().length() > 0) { + xElem.setAttr("bajaVersion", this.getVersion().getBajaVersionString()); + } + if (this.getVersion().getVendorVersionString().trim().length() > 0) { + xElem.setAttr("version", this.getVersion().getVendorVersionString()); + } + if (this.getDescription().trim().length() > 0) { + xElem.setAttr("description", this.getDescription()); + } + return xElem; + } + + public String toString(Context context) { + return "Nre Part: " + this.getPartName() + ' ' + (Object)((Object)this.getVersion()); + } + + public boolean isInstallable() { + return true; + } + + public boolean isNull() { + return this.getPartName().equals("nullnre"); + } + + public static BNrePart makeNull() { + return new BNrePart("nullnre", "", BVersion.makeZero(), null); + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BNrePart() { + } + + public BNrePart(String string, String string2, BVersion bVersion, BInstallable bInstallable) { + this.setPartName(string); + this.setDescription(string2); + this.setVersion(bVersion); + this.setInstallable(bInstallable); + } + + static { + Class clazz = class$com$tridium$install$part$BNrePart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BNrePart = BNrePart.class("[Lcom.tridium.install.part.BNrePart;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BPart.getPartTypeIcon(TYPE); + } +} + diff --git a/modules/cfr_output/com/tridium/install/part/BOsPart.java b/modules/cfr_output/com/tridium/install/part/BOsPart.java new file mode 100644 index 0000000..44063a3 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/part/BOsPart.java @@ -0,0 +1,142 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BIcon + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.install.part; + +import com.tridium.install.BDependency; +import com.tridium.install.BVersion; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.part.BPart; +import javax.baja.sys.BIcon; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BOsPart +extends BPart { + public static final Type TYPE; + private static final BIcon icon; + boolean isInstallable; + static /* synthetic */ Class class$com$tridium$install$part$BOsPart; + + public Type getType() { + return TYPE; + } + + public boolean meets(BDependency bDependency) { + boolean bl = false; + if (bDependency.getPartType().is(TYPE) && this.getVersion().meets(bDependency) && this.matchesName(bDependency.getPartName())) { + bl = true; + } + return bl; + } + + public static BPart make(XElem xElem) { + return BOsPart.make(xElem, null); + } + + public static BPart make(XElem xElem, BInstallable bInstallable) { + if (xElem == null) { + return null; + } + if (xElem.name().equals("os")) { + String string = xElem.get("name"); + boolean bl = string.startsWith("qnx"); + return new BOsPart(string, xElem.get("description", ""), new BVersion("", BOsPart.getVendorVersion(xElem)), bInstallable, xElem.getb("installable", bl)); + } + return null; + } + + public XElem getXml() { + XElem xElem = new XElem("os"); + xElem.setAttr("name", this.getPartName()); + if (this.getVersion().getVendor().trim().length() > 0) { + xElem.setAttr("vendor", this.getVersion().getVendor()); + } + if (this.getVersion().getBajaVersionString().trim().length() > 0) { + xElem.setAttr("bajaVersion", this.getVersion().getBajaVersionString()); + } + if (this.getVersion().getVendorVersionString().trim().length() > 0) { + xElem.setAttr("version", this.getVersion().getVendorVersionString()); + } + if (this.getDescription().trim().length() > 0) { + xElem.setAttr("description", this.getDescription()); + } + return xElem; + } + + public String toString(Context context) { + return "OS Part: " + this.getPartName() + ' ' + (Object)((Object)this.getVersion()); + } + + public boolean isNull() { + return this.getPartName().equals("nullos"); + } + + public boolean isInstallable() { + return this.isInstallable; + } + + public boolean allowGlobalFileAccess() { + return this.getPartName().startsWith("qnx"); + } + + public static BOsPart makeNull() { + return new BOsPart("nullos", "", BVersion.makeZero(), null, false); + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.isInstallable = false; + } + + public BOsPart() { + this.this(); + } + + public BOsPart(String string, String string2, BVersion bVersion, BInstallable bInstallable, boolean bl) { + this.this(); + this.setPartName(string); + this.setDescription(string2); + this.setVersion(bVersion); + this.setInstallable(bInstallable); + this.isInstallable = bl; + } + + static { + Class clazz = class$com$tridium$install$part$BOsPart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BOsPart = BOsPart.class("[Lcom.tridium.install.part.BOsPart;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BPart.getPartTypeIcon(TYPE); + } +} + diff --git a/modules/cfr_output/com/tridium/install/part/BPart.java b/modules/cfr_output/com/tridium/install/part/BPart.java new file mode 100644 index 0000000..e16a7c9 --- /dev/null +++ b/modules/cfr_output/com/tridium/install/part/BPart.java @@ -0,0 +1,341 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BComplex + * javax.baja.sys.BComponent + * javax.baja.sys.BIcon + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.BTypeSpec + * javax.baja.util.Lexicon + * javax.baja.util.PatternFilter + * javax.baja.util.Version + * javax.baja.xml.XElem + */ +package com.tridium.install.part; + +import com.tridium.install.BDependency; +import com.tridium.install.BVersion; +import com.tridium.install.PartSpec; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.part.BApplicationPart; +import com.tridium.install.part.BArchPart; +import com.tridium.install.part.BBrandPart; +import com.tridium.install.part.BGenericPart; +import com.tridium.install.part.BModelPart; +import com.tridium.install.part.BModulePart; +import com.tridium.install.part.BNrePart; +import com.tridium.install.part.BOsPart; +import com.tridium.install.part.BVmPart; +import javax.baja.platform.install.BPlatformPartType; +import javax.baja.platform.install.PlatformPart; +import javax.baja.sys.BComplex; +import javax.baja.sys.BComponent; +import javax.baja.sys.BIcon; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.BTypeSpec; +import javax.baja.util.Lexicon; +import javax.baja.util.PatternFilter; +import javax.baja.util.Version; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BPart +extends BComponent { + public static final Property dependencies = BPart.newProperty((int)1, (BValue)new BVector(), null); + public static final Property partName = BPart.newProperty((int)1, (String)"unknown", null); + public static final Property version = BPart.newProperty((int)1, (BValue)BVersion.makeZero(), null); + public static final Property description = BPart.newProperty((int)1, (String)"", null); + public static final Type TYPE; + private BInstallable installable; + private PartSpec spec; + static /* synthetic */ Class class$com$tridium$install$part$BPart; + + public BVector getDependencies() { + return (BVector)this.get(dependencies); + } + + public void setDependencies(BVector bVector) { + this.set(dependencies, (BValue)bVector, null); + } + + public String getPartName() { + return this.getString(partName); + } + + public void setPartName(String string) { + this.setString(partName, string, null); + } + + public BVersion getVersion() { + return (BVersion)this.get(version); + } + + public void setVersion(BVersion bVersion) { + this.set(version, (BValue)bVersion, null); + } + + public String getDescription() { + return this.getString(description); + } + + public void setDescription(String string) { + this.setString(description, string, null); + } + + public Type getType() { + return TYPE; + } + + public boolean equivalent(Object object) { + if (object instanceof BPart) { + BPart bPart = (BPart)((Object)object); + boolean bl = false; + if (this.getPartName().equals(bPart.getPartName()) && this.getType().equals(bPart.getType()) && this.getVersion().equivalent((Object)bPart.getVersion())) { + bl = true; + } + return bl; + } + return false; + } + + public abstract boolean meets(BDependency var1); + + public BInstallable getInstallable() { + if (this.installable == null) { + BComplex bComplex = this.getParent(); + while (bComplex != null) { + if (bComplex instanceof BInstallable) { + this.installable = (BInstallable)bComplex; + break; + } + bComplex = bComplex.getParent(); + } + } + return this.installable; + } + + public void setInstallable(BInstallable bInstallable) { + this.installable = bInstallable; + } + + public boolean isInstallable() { + return false; + } + + public XElem getXml() { + throw new UnsupportedOperationException(); + } + + public static String getVendorVersion(XElem xElem) { + return xElem.get("vendorVersion", xElem.get("version", "0")); + } + + public static final BPart makePart(XElem xElem, BInstallable bInstallable) { + BPart bPart = null; + if (xElem.name().equals("os")) { + bPart = BOsPart.make(xElem, bInstallable); + } else if (xElem.name().equals("vm")) { + bPart = BVmPart.make(xElem, bInstallable); + } else if (xElem.name().equals("arch")) { + bPart = BArchPart.make(xElem, bInstallable); + } else if (xElem.name().equals("brand")) { + bPart = BBrandPart.make(xElem, bInstallable); + } else if (xElem.name().equals("nre")) { + bPart = BNrePart.make(xElem, bInstallable); + } else if (xElem.name().equals("part")) { + bPart = BGenericPart.make(xElem, bInstallable); + } else if (xElem.name().equals("model")) { + bPart = BModelPart.make(xElem, bInstallable); + } else if (xElem.name().equals("app")) { + bPart = BApplicationPart.make(xElem, bInstallable); + } + return bPart; + } + + public PartSpec getPartSpec() { + if (this.spec == null) { + this.spec = new PartSpec(this.getPartName(), this.getType()); + } + return this.spec; + } + + public PlatformPart asPlatformPart() { + if (this.isNull()) { + return null; + } + return new PlatformPart(){ + + public final String getPartName() { + return BPart.this.getPartName(); + } + + public final BPlatformPartType getPartType() { + return BPart.getPlatformPartType(BPart.this.getType().getTypeSpec()); + } + + public final Version getPartVersion() { + return BPart.this.getVersion().getVendorVersion(); + } + }; + } + + public static BPlatformPartType getPlatformPartType(BTypeSpec bTypeSpec) { + if (bTypeSpec.equals((Object)BArchPart.TYPE.getTypeSpec())) { + return BPlatformPartType.arch; + } + if (bTypeSpec.equals((Object)BBrandPart.TYPE.getTypeSpec())) { + return BPlatformPartType.brand; + } + if (bTypeSpec.equals((Object)BModelPart.TYPE.getTypeSpec())) { + return BPlatformPartType.model; + } + if (bTypeSpec.equals((Object)BModulePart.TYPE.getTypeSpec())) { + return BPlatformPartType.module; + } + if (bTypeSpec.equals((Object)BNrePart.TYPE.getTypeSpec())) { + return BPlatformPartType.nre; + } + if (bTypeSpec.equals((Object)BOsPart.TYPE.getTypeSpec())) { + return BPlatformPartType.os; + } + if (bTypeSpec.equals((Object)BVmPart.TYPE.getTypeSpec())) { + return BPlatformPartType.vm; + } + return BPlatformPartType.other; + } + + public static String getPartTypeName(Type type) { + Lexicon lexicon = type.getModule().getLexicon(); + String string = BPart.getLexiconText(lexicon, type.getTypeName() + ".typeName"); + if (string == null) { + if (type.getSuperType() == null) { + return TYPE.getModule().getLexicon().getText("Unknown.typeName"); + } + return BPart.getPartTypeName(type.getSuperType()); + } + return string; + } + + public static BIcon getPartTypeIcon(Type type) { + Lexicon lexicon = type.getModule().getLexicon(); + String string = BPart.getLexiconText(lexicon, type.getTypeName() + ".typeIcon"); + if (string == null) { + if (type.getSuperType() == null) { + string = TYPE.getModule().getLexicon().getText("Unknown.typeIcon"); + } else { + return BPart.getPartTypeIcon(type.getSuperType()); + } + } + return BIcon.make((String)string); + } + + public static String getPartTypeShortName(Type type) { + Lexicon lexicon = type.getModule().getLexicon(); + String string = BPart.getLexiconText(lexicon, type.getTypeName() + ".typeNameShort"); + if (string == null && (string = BPart.getLexiconText(lexicon, type.getTypeName() + ".typeName")) == null) { + if (type.getSuperType() == null) { + return TYPE.getModule().getLexicon().getText("Unknown.typeName"); + } + return BPart.getPartTypeShortName(type.getSuperType()); + } + return string; + } + + public BDependency[] getDependencyArray() { + Property[] propertyArray = this.getDependencies().getPropertiesArray(); + BDependency[] bDependencyArray = new BDependency[propertyArray.length]; + int n = 0; + while (n < propertyArray.length) { + bDependencyArray[n] = (BDependency)this.getDependencies().get(propertyArray[n]); + ++n; + } + return bDependencyArray; + } + + public boolean matchesName(String string) { + return BPart.matchesName(this.getPartName(), string); + } + + public static boolean isWildcardName(String string) { + int n = 0; + while (n < string.length()) { + switch (string.charAt(n)) { + case '\t': + case ' ': + case '*': + case ',': + case ';': + case '?': { + return true; + } + } + ++n; + } + return false; + } + + public static boolean matchesName(String string, String string2) { + if (string2 == null) { + return false; + } + PatternFilter[] patternFilterArray = PatternFilter.parseList((String)string2); + int n = 0; + while (n < patternFilterArray.length) { + if (patternFilterArray[n].accept(string)) { + return true; + } + ++n; + } + return false; + } + + private static final String getLexiconText(Lexicon lexicon, String string) { + String string2 = lexicon.getText(string); + if (string2.equals(string)) { + return null; + } + return string2; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.installable = null; + this.spec = null; + } + + public BPart() { + this.this(); + } + + static { + Class clazz = class$com$tridium$install$part$BPart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BPart = BPart.class("[Lcom.tridium.install.part.BPart;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/install/part/BVmPart.java b/modules/cfr_output/com/tridium/install/part/BVmPart.java new file mode 100644 index 0000000..8de773e --- /dev/null +++ b/modules/cfr_output/com/tridium/install/part/BVmPart.java @@ -0,0 +1,146 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BIcon + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.install.part; + +import com.tridium.install.BDependency; +import com.tridium.install.BVersion; +import com.tridium.install.installable.BInstallable; +import com.tridium.install.part.BPart; +import javax.baja.sys.BIcon; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BVmPart +extends BPart { + public static final Property unspecified = BVmPart.newProperty((int)1, (boolean)false, null); + public static final Type TYPE; + private static final BIcon icon; + static /* synthetic */ Class class$com$tridium$install$part$BVmPart; + + public boolean getUnspecified() { + return this.getBoolean(unspecified); + } + + public void setUnspecified(boolean bl) { + this.setBoolean(unspecified, bl, null); + } + + public Type getType() { + return TYPE; + } + + public boolean meets(BDependency bDependency) { + boolean bl = false; + if (bDependency.getPartType().is(TYPE) && this.getVersion().meets(bDependency) && this.matchesName(bDependency.getPartName())) { + bl = true; + } + return bl; + } + + public static BPart make(XElem xElem) { + return BVmPart.make(xElem, null); + } + + public static BPart make(XElem xElem, BInstallable bInstallable) { + if (xElem == null) { + return null; + } + if (xElem.name().equals("vm")) { + return new BVmPart(xElem.get("name", null), new BVersion(xElem.get("vendor", ""), BVmPart.getVendorVersion(xElem)), bInstallable); + } + return null; + } + + public XElem getXml() { + XElem xElem = new XElem("vm"); + xElem.setAttr("name", this.getPartName()); + if (this.getVersion().getVendor().trim().length() > 0) { + xElem.setAttr("vendor", this.getVersion().getVendor()); + } + if (this.getVersion().getBajaVersionString().trim().length() > 0) { + xElem.setAttr("bajaVersion", this.getVersion().getBajaVersionString()); + } + if (this.getVersion().getVendorVersionString().trim().length() > 0) { + xElem.setAttr("version", this.getVersion().getVendorVersionString()); + } + if (this.getDescription().trim().length() > 0) { + xElem.setAttr("description", this.getDescription()); + } + return xElem; + } + + public String toString(Context context) { + return "VM Part: " + this.getPartName() + ' ' + (Object)((Object)this.getVersion()); + } + + public BIcon getIcon() { + return icon; + } + + public boolean isInstallable() { + return true; + } + + public boolean isNull() { + return this.getPartName().equals("nullvm"); + } + + public static BVmPart makeNull() { + return new BVmPart("nullvm", BVersion.makeZero(), null); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BVmPart() { + this.setPartName(this.getLexicon().getText("unspecifiedVm.vmName")); + this.setUnspecified(true); + } + + public BVmPart(String string, BVersion bVersion, BInstallable bInstallable) { + this.setVersion(bVersion); + if (string == null || string.indexOf("Undetermined") != -1) { + this.setPartName(this.getLexicon().getText("unspecifiedVm.vmName")); + this.setUnspecified(true); + } else { + this.setPartName(string); + this.setUnspecified(false); + } + this.setInstallable(bInstallable); + } + + static { + Class clazz = class$com$tridium$install$part$BVmPart; + if (clazz == null) { + clazz = class$com$tridium$install$part$BVmPart = BVmPart.class("[Lcom.tridium.install.part.BVmPart;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BPart.getPartTypeIcon(TYPE); + } +} + diff --git a/modules/cfr_output/com/tridium/io/net/BasicClientSocketFactory.java b/modules/cfr_output/com/tridium/io/net/BasicClientSocketFactory.java new file mode 100644 index 0000000..e725dfe --- /dev/null +++ b/modules/cfr_output/com/tridium/io/net/BasicClientSocketFactory.java @@ -0,0 +1,55 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.io.net; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.UnknownHostException; +import javax.baja.io.net.IClientSocketFactory; + +public class BasicClientSocketFactory +implements IClientSocketFactory { + protected static IClientSocketFactory instance = null; + + public static IClientSocketFactory getInstance() { + if (instance == null) { + instance = new BasicClientSocketFactory(); + } + return instance; + } + + public Socket createSocket(InetAddress inetAddress, int n) throws IOException { + return new Socket(inetAddress, n); + } + + public Socket createSocket(InetAddress inetAddress, int n, int n2) throws IOException { + Socket socket = new Socket(); + socket.connect(new InetSocketAddress(inetAddress, n), n2); + return socket; + } + + public Socket createSocket(InetAddress inetAddress, int n, InetAddress inetAddress2, int n2) throws IOException { + return new Socket(inetAddress, n, inetAddress2, n2); + } + + public Socket createSocket(String string, int n) throws IOException, UnknownHostException { + return new Socket(string, n); + } + + public Socket createSocket(String string, int n, int n2) throws IOException, UnknownHostException { + Socket socket = new Socket(); + socket.connect(new InetSocketAddress(string, n), n2); + return socket; + } + + public Socket createSocket(String string, int n, InetAddress inetAddress, int n2) throws IOException, UnknownHostException { + return new Socket(string, n, inetAddress, n2); + } + + private BasicClientSocketFactory() { + } +} + diff --git a/modules/cfr_output/com/tridium/io/net/BasicServerSocketFactory.java b/modules/cfr_output/com/tridium/io/net/BasicServerSocketFactory.java new file mode 100644 index 0000000..0ac4507 --- /dev/null +++ b/modules/cfr_output/com/tridium/io/net/BasicServerSocketFactory.java @@ -0,0 +1,25 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.io.net; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.ServerSocket; +import javax.baja.io.net.IServerSocketFactory; + +public class BasicServerSocketFactory +implements IServerSocketFactory { + public ServerSocket createServerSocket(int n) throws IOException { + return new ServerSocket(n); + } + + public ServerSocket createServerSocket(int n, int n2) throws IOException { + return new ServerSocket(n, n2); + } + + public ServerSocket createServerSocket(int n, int n2, InetAddress inetAddress) throws IOException { + return new ServerSocket(n, n2, inetAddress); + } +} + diff --git a/modules/cfr_output/com/tridium/nav/BIAliasNavNode.java b/modules/cfr_output/com/tridium/nav/BIAliasNavNode.java new file mode 100644 index 0000000..a486680 --- /dev/null +++ b/modules/cfr_output/com/tridium/nav/BIAliasNavNode.java @@ -0,0 +1,27 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.nav; + +import javax.baja.naming.BIAlias; +import javax.baja.nav.BINavNode; +import javax.baja.sys.BObject; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public interface BIAliasNavNode +extends BINavNode, +BIAlias { + public static final Type TYPE; + + public BObject get(); + + static { + Class clazz = 1.class$com$tridium$nav$BIAliasNavNode; + if (clazz == null) { + clazz = 1.class$com$tridium$nav$BIAliasNavNode = 1.class("[Lcom.tridium.nav.BIAliasNavNode;", false); + } + TYPE = Sys.loadType(clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/core/BCertManagerService.java b/modules/cfr_output/com/tridium/platcrypto/core/BCertManagerService.java new file mode 100644 index 0000000..7f2d243 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/core/BCertManagerService.java @@ -0,0 +1,286 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.CoreCryptoManager + * com.tridium.crypto.core.io.ICoreCryptoManager + * com.tridium.crypto.core.io.ICoreExemptionStore + * com.tridium.crypto.core.util.ILogger + * com.tridium.fox.sys.BFoxChannelRegistry + * com.tridium.fox.sys.BFoxSession + * com.tridium.nre.security.ISecurityInfoProvider + * com.tridium.platform.BPlatformService + * com.tridium.sys.Nre + * javax.baja.file.BFileSystem + * javax.baja.file.FilePath + * javax.baja.io.net.IClientSocketFactory + * javax.baja.io.net.IServerSocketFactory + * javax.baja.log.Log + * javax.baja.naming.BISession + * javax.baja.naming.BLocalHost + * javax.baja.naming.BOrd + * javax.baja.naming.OrdQuery + * javax.baja.security.crypto.BSslTlsEnum + * javax.baja.security.crypto.BTlsEnum + * javax.baja.security.crypto.ICryptoManagerEx + * javax.baja.security.crypto.IKeyStore + * javax.baja.sys.BComponent + * javax.baja.sys.BIcon + * javax.baja.sys.BValue + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platcrypto.core; + +import com.tridium.crypto.core.io.CoreCryptoManager; +import com.tridium.crypto.core.io.ICoreCryptoManager; +import com.tridium.crypto.core.io.ICoreExemptionStore; +import com.tridium.crypto.core.util.ILogger; +import com.tridium.fox.sys.BFoxChannelRegistry; +import com.tridium.fox.sys.BFoxSession; +import com.tridium.nre.security.ISecurityInfoProvider; +import com.tridium.platcrypto.core.ICryptoManagerProvider; +import com.tridium.platcrypto.core.IExtCryptoManager; +import com.tridium.platcrypto.core.IProviderInfo; +import com.tridium.platcrypto.core.NExemptionStore; +import com.tridium.platcrypto.core.NKeyStore; +import com.tridium.platcrypto.core.NProviderInfo; +import com.tridium.platcrypto.fox.BCryptoChannel; +import com.tridium.platcrypto.fox.ChannelCryptoManager; +import com.tridium.platcrypto.socket.CryptoClientNoArgSocketFactory; +import com.tridium.platcrypto.socket.CryptoClientSocketFactory; +import com.tridium.platcrypto.socket.CryptoServerSocketFactory; +import com.tridium.platcrypto.util.Logger; +import com.tridium.platform.BPlatformService; +import com.tridium.sys.Nre; +import java.io.File; +import java.io.IOException; +import javax.baja.file.BFileSystem; +import javax.baja.file.FilePath; +import javax.baja.io.net.IClientSocketFactory; +import javax.baja.io.net.IServerSocketFactory; +import javax.baja.log.Log; +import javax.baja.naming.BISession; +import javax.baja.naming.BLocalHost; +import javax.baja.naming.BOrd; +import javax.baja.naming.OrdQuery; +import javax.baja.security.crypto.BSslTlsEnum; +import javax.baja.security.crypto.BTlsEnum; +import javax.baja.security.crypto.ICryptoManagerEx; +import javax.baja.security.crypto.IKeyStore; +import javax.baja.sys.BComponent; +import javax.baja.sys.BIcon; +import javax.baja.sys.BValue; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSocketFactory; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public final class BCertManagerService +extends BPlatformService +implements IExtCryptoManager, +ICryptoManagerProvider { + public static final Type TYPE; + private static final BIcon icon; + private ICoreCryptoManager cryptoManager; + private NKeyStore trustKeyStore; + private NKeyStore keyStore; + private NExemptionStore exemptionStore; + private IProviderInfo providerInfo; + static /* synthetic */ Class class$com$tridium$platcrypto$core$BCertManagerService; + static /* synthetic */ Class class$com$tridium$platcrypto$socket$CryptoClientTlsSocketFactory; + + public final Type getType() { + return TYPE; + } + + public final Type[] getServiceTypes() { + return new Type[]{TYPE}; + } + + public final boolean isValidPlatform() { + if (System.getProperty("java.vm.name").equalsIgnoreCase("J9")) { + Log.getLog((String)"crypto").error("Unable to install new crypto service with the j9 vm"); + return false; + } + try { + if (Nre.serviceManager.getService("crypto:CryptoService") != null) { + Log.getLog((String)"crypto").warning("Unable to install new crypto service while legacy crypto.jar is installed"); + return false; + } + } + catch (Exception exception) {} + return true; + } + + public final String getLicenseFeature() { + return "crypto"; + } + + public final int getSlotFlags() { + return 1; + } + + public final synchronized void serviceStarted() throws Exception { + super.serviceStarted(); + HttpsURLConnection.setDefaultSSLSocketFactory((SSLSocketFactory)this.getClientSocketFactory(BTlsEnum.tlsv1.getTag())); + BISession bISession = this.getSession(); + if (bISession instanceof BLocalHost) { + this.cryptoManager = CoreCryptoManager.get((ISecurityInfoProvider)Nre.getSecurityInfoProvider()); + } else if (bISession instanceof BFoxSession) { + this.cryptoManager = new ChannelCryptoManager((BComponent)this); + } else { + throw new Exception("unrecognized session: " + bISession.getClass().getName()); + } + } + + public final void serviceStopped() throws Exception { + super.serviceStopped(); + BFoxChannelRegistry bFoxChannelRegistry = BFoxChannelRegistry.getPrototype(); + if (bFoxChannelRegistry.get("crypto") != null) { + bFoxChannelRegistry.remove("crypto"); + } + } + + public final BIcon getIcon() { + return icon; + } + + public final boolean hasNavChildren() { + return false; + } + + public final synchronized IKeyStore getTrustStore() throws Exception { + if (this.trustKeyStore == null) { + this.trustKeyStore = new NKeyStore(this.cryptoManager.getTrustStore()); + } + return this.trustKeyStore; + } + + public final synchronized IKeyStore getKeyStore() throws Exception { + if (this.keyStore == null) { + this.keyStore = new NKeyStore(this.cryptoManager.getKeyStore()); + } + return this.keyStore; + } + + public final synchronized ICoreExemptionStore getExemptionStore() throws Exception { + if (this.exemptionStore == null) { + this.exemptionStore = new NExemptionStore(this.cryptoManager.getExemptionStore()); + } + return this.exemptionStore; + } + + public final synchronized IProviderInfo getProviderInfo() throws Exception { + if (this.providerInfo == null) { + this.providerInfo = new NProviderInfo(this.cryptoManager.getProviderInfo()); + } + return this.providerInfo; + } + + public final File getBaseDir() { + try { + return new File(BCertManagerService.getFilePath(BOrd.make((String)"file:!"))); + } + catch (Exception exception) { + return Sys.getBajaHome(); + } + } + + public final IServerSocketFactory getServerSocketFactory(BSslTlsEnum bSslTlsEnum, boolean bl, String string) throws Exception { + return this.getServerSocketFactory(BTlsEnum.tlsv1.getTag(), bl, string); + } + + public final IServerSocketFactory getServerSocketFactory(String string, boolean bl, String string2) throws Exception { + return new CryptoServerSocketFactory(Nre.getSecurityInfoProvider(), string, bl, string2); + } + + public final IClientSocketFactory getClientSocketFactory(BSslTlsEnum bSslTlsEnum) throws Exception { + return new CryptoClientSocketFactory(Nre.getSecurityInfoProvider(), bSslTlsEnum.getTag()); + } + + public final IClientSocketFactory getClientSocketFactory(String string) throws Exception { + return new CryptoClientSocketFactory(Nre.getSecurityInfoProvider(), string); + } + + public final String getClientSocketFactoryClass(BSslTlsEnum bSslTlsEnum) throws Exception { + return this.getClientSocketFactoryClass(BTlsEnum.tlsv1.getTag()); + } + + public final String getClientSocketFactoryClass(String string) throws Exception { + CryptoClientNoArgSocketFactory.setBaseDir(Nre.getSecurityInfoProvider()); + Class clazz = class$com$tridium$platcrypto$socket$CryptoClientTlsSocketFactory; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$socket$CryptoClientTlsSocketFactory = BCertManagerService.class("[Lcom.tridium.platcrypto.socket.CryptoClientTlsSocketFactory;", false); + } + return clazz.getCanonicalName(); + } + + public final ICryptoManagerEx getCryptoManager() { + return this; + } + + public final synchronized ICoreCryptoManager getCoreCryptoManager() throws Exception { + if (this.cryptoManager == null) { + BISession bISession = this.getSession(); + if (bISession instanceof BLocalHost) { + this.cryptoManager = CoreCryptoManager.get((ISecurityInfoProvider)Nre.getSecurityInfoProvider(), (ILogger)new Logger(Log.getLog((String)"crypto"))); + } else if (bISession instanceof BFoxSession) { + this.cryptoManager = new ChannelCryptoManager((BComponent)this); + } else { + throw new Exception("unrecognized session: " + bISession.getClass().getName()); + } + } + return this.cryptoManager; + } + + private static final String getFilePath(BOrd bOrd) throws IOException { + OrdQuery[] ordQueryArray = bOrd.parse(); + FilePath filePath = (FilePath)ordQueryArray[ordQueryArray.length - 1]; + File file = BFileSystem.INSTANCE.pathToLocalFile(filePath); + return file.getPath(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.cryptoManager = null; + this.trustKeyStore = null; + this.keyStore = null; + this.exemptionStore = null; + this.providerInfo = null; + } + + public BCertManagerService() throws Exception { + this.this(); + this.setPlatformServiceDescription(this.getLexicon().getText("CertManagerService.description")); + BFoxChannelRegistry bFoxChannelRegistry = BFoxChannelRegistry.getPrototype(); + if (bFoxChannelRegistry.get("crypto") == null) { + bFoxChannelRegistry.add("crypto", (BValue)new BCryptoChannel()); + } + } + + static { + Class clazz = class$com$tridium$platcrypto$core$BCertManagerService; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$core$BCertManagerService = BCertManagerService.class("[Lcom.tridium.platcrypto.core.BCertManagerService;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BIcon.std((String)"files/certificate.png"); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/core/BWbAppletCertManager.java b/modules/cfr_output/com/tridium/platcrypto/core/BWbAppletCertManager.java new file mode 100644 index 0000000..3ac92d3 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/core/BWbAppletCertManager.java @@ -0,0 +1,169 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.ICoreCryptoManager + * com.tridium.crypto.core.io.ICoreExemptionStore + * javax.baja.io.net.IClientSocketFactory + * javax.baja.io.net.IServerSocketFactory + * javax.baja.log.Log + * javax.baja.security.crypto.BSslTlsEnum + * javax.baja.security.crypto.IKeyStore + * javax.baja.status.BStatus + * javax.baja.sys.BComponent + * javax.baja.sys.BIcon + * javax.baja.sys.BValue + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.core; + +import com.tridium.crypto.core.io.ICoreCryptoManager; +import com.tridium.crypto.core.io.ICoreExemptionStore; +import com.tridium.platcrypto.core.IExtCryptoManager; +import com.tridium.platcrypto.core.IProviderInfo; +import com.tridium.platcrypto.core.WbAppletCryptoManager; +import com.tridium.platcrypto.socket.CryptoWbAppletClientSocketFactory; +import java.io.File; +import java.io.IOException; +import java.security.GeneralSecurityException; +import javax.baja.io.net.IClientSocketFactory; +import javax.baja.io.net.IServerSocketFactory; +import javax.baja.log.Log; +import javax.baja.security.crypto.BSslTlsEnum; +import javax.baja.security.crypto.IKeyStore; +import javax.baja.status.BStatus; +import javax.baja.sys.BComponent; +import javax.baja.sys.BIcon; +import javax.baja.sys.BValue; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BWbAppletCertManager +extends BComponent +implements IExtCryptoManager { + public static final Property status = BWbAppletCertManager.newProperty((int)3, (BValue)BStatus.stale, null); + public static final Property javaxNetDebug = BWbAppletCertManager.newProperty((int)0, (boolean)false, null); + public static final Property unrestrictedPolicyFiles = BWbAppletCertManager.newProperty((int)3, (boolean)false, null); + public static final Type TYPE; + private static Log log; + private static Lexicon lex; + private static final BIcon icon; + static /* synthetic */ Class class$com$tridium$platcrypto$core$BWbAppletCertManager; + + public BStatus getStatus() { + return (BStatus)this.get(status); + } + + public void setStatus(BStatus bStatus) { + this.set(status, (BValue)bStatus, null); + } + + public boolean getJavaxNetDebug() { + return this.getBoolean(javaxNetDebug); + } + + public void setJavaxNetDebug(boolean bl) { + this.setBoolean(javaxNetDebug, bl, null); + } + + public boolean getUnrestrictedPolicyFiles() { + return this.getBoolean(unrestrictedPolicyFiles); + } + + public void setUnrestrictedPolicyFiles(boolean bl) { + this.setBoolean(unrestrictedPolicyFiles, bl, null); + } + + public Type getType() { + return TYPE; + } + + public static BWbAppletCertManager make() throws Exception { + return new BWbAppletCertManager(); + } + + public synchronized IKeyStore getTrustStore() throws IOException, GeneralSecurityException { + throw new UnsupportedOperationException("not supported by the applet"); + } + + public synchronized IKeyStore getKeyStore() throws IOException, GeneralSecurityException { + throw new UnsupportedOperationException("not supported by the applet"); + } + + public ICoreExemptionStore getExemptionStore() throws IOException { + throw new UnsupportedOperationException("not supported by the applet"); + } + + public IProviderInfo getProviderInfo() throws IOException { + throw new UnsupportedOperationException("not supported by the applet"); + } + + public IServerSocketFactory getServerSocketFactory(BSslTlsEnum bSslTlsEnum, boolean bl, String string) throws Exception { + throw new UnsupportedOperationException("not supported by the applet"); + } + + public IServerSocketFactory getServerSocketFactory(String string, boolean bl, String string2) throws Exception { + throw new UnsupportedOperationException("not supported by the applet"); + } + + public IClientSocketFactory getClientSocketFactory(BSslTlsEnum bSslTlsEnum) throws Exception { + return new CryptoWbAppletClientSocketFactory(bSslTlsEnum.getTag()); + } + + public IClientSocketFactory getClientSocketFactory(String string) throws Exception { + return new CryptoWbAppletClientSocketFactory(string); + } + + public String getClientSocketFactoryClass(BSslTlsEnum bSslTlsEnum) throws Exception { + throw new UnsupportedOperationException("not supported by the applet"); + } + + public String getClientSocketFactoryClass(String string) throws Exception { + throw new UnsupportedOperationException("not supported by the applet"); + } + + public ICoreCryptoManager getCoreCryptoManager() { + return new WbAppletCryptoManager(); + } + + public File getBaseDir() { + throw new UnsupportedOperationException("not supported by the applet"); + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$platcrypto$core$BWbAppletCertManager; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$core$BWbAppletCertManager = BWbAppletCertManager.class("[Lcom.tridium.platcrypto.core.BWbAppletCertManager;", false); + } + TYPE = Sys.loadType((Class)clazz); + log = Log.getLog((String)"crypto"); + lex = Lexicon.make((String)"platCrypto"); + icon = BIcon.make((String)lex.get("cert.x16.icon", "module://icons/x16/lock.png")); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/core/BWbCertManager.java b/modules/cfr_output/com/tridium/platcrypto/core/BWbCertManager.java new file mode 100644 index 0000000..abc221e --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/core/BWbCertManager.java @@ -0,0 +1,213 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.CoreCryptoManager + * com.tridium.crypto.core.io.ICoreCryptoManager + * com.tridium.crypto.core.io.ICoreExemptionStore + * com.tridium.nre.security.ISecurityInfoProvider + * com.tridium.sys.Nre + * javax.baja.file.BFileSystem + * javax.baja.file.FilePath + * javax.baja.io.net.IClientSocketFactory + * javax.baja.io.net.IServerSocketFactory + * javax.baja.log.Log + * javax.baja.naming.BOrd + * javax.baja.naming.OrdQuery + * javax.baja.security.crypto.BSslTlsEnum + * javax.baja.security.crypto.BTlsEnum + * javax.baja.security.crypto.IKeyStore + * javax.baja.sys.BComponent + * javax.baja.sys.BIcon + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.core; + +import com.tridium.crypto.core.io.CoreCryptoManager; +import com.tridium.crypto.core.io.ICoreCryptoManager; +import com.tridium.crypto.core.io.ICoreExemptionStore; +import com.tridium.nre.security.ISecurityInfoProvider; +import com.tridium.platcrypto.core.IExtCryptoManager; +import com.tridium.platcrypto.core.IProviderInfo; +import com.tridium.platcrypto.core.NExemptionStore; +import com.tridium.platcrypto.core.NKeyStore; +import com.tridium.platcrypto.core.NProviderInfo; +import com.tridium.platcrypto.socket.CryptoWbClientSocketFactory; +import com.tridium.sys.Nre; +import java.io.File; +import java.io.IOException; +import java.security.AccessController; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import javax.baja.file.BFileSystem; +import javax.baja.file.FilePath; +import javax.baja.io.net.IClientSocketFactory; +import javax.baja.io.net.IServerSocketFactory; +import javax.baja.log.Log; +import javax.baja.naming.BOrd; +import javax.baja.naming.OrdQuery; +import javax.baja.security.crypto.BSslTlsEnum; +import javax.baja.security.crypto.BTlsEnum; +import javax.baja.security.crypto.IKeyStore; +import javax.baja.sys.BComponent; +import javax.baja.sys.BIcon; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.Lexicon; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSocketFactory; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BWbCertManager +extends BComponent +implements IExtCryptoManager { + public static final Type TYPE; + private static Log log; + private static Lexicon lex; + private static final BIcon icon; + private ICoreCryptoManager cryptoManager; + private NKeyStore trustKeyStore; + private NKeyStore keyStore; + private NExemptionStore exemptionStore; + private NProviderInfo providerInfo; + static /* synthetic */ Class class$com$tridium$platcrypto$core$BWbCertManager; + + public Type getType() { + return TYPE; + } + + public static BWbCertManager make() throws Exception { + return new BWbCertManager(); + } + + public synchronized IKeyStore getTrustStore() throws Exception { + if (this.trustKeyStore == null) { + this.trustKeyStore = new NKeyStore(this.cryptoManager.getTrustStore()); + } + return this.trustKeyStore; + } + + public synchronized IKeyStore getKeyStore() throws Exception { + if (this.keyStore == null) { + this.keyStore = new NKeyStore(this.cryptoManager.getKeyStore()); + } + return this.keyStore; + } + + public synchronized ICoreExemptionStore getExemptionStore() throws Exception { + if (this.exemptionStore == null) { + this.exemptionStore = new NExemptionStore(this.cryptoManager.getExemptionStore()); + } + return this.exemptionStore; + } + + public synchronized IProviderInfo getProviderInfo() throws Exception { + if (this.providerInfo == null) { + this.providerInfo = new NProviderInfo(this.cryptoManager.getProviderInfo()); + } + return this.providerInfo; + } + + public File getBaseDir() { + try { + return new File(BWbCertManager.getFilePath(BOrd.make((String)"file:!workbench"))); + } + catch (Exception exception) { + return new File(Sys.getBajaHome(), "workbench"); + } + } + + public IServerSocketFactory getServerSocketFactory(BSslTlsEnum bSslTlsEnum, boolean bl, String string) throws Exception { + throw new UnsupportedOperationException("not supported by workbench"); + } + + public IServerSocketFactory getServerSocketFactory(String string, boolean bl, String string2) throws Exception { + throw new UnsupportedOperationException("not supported by workbench"); + } + + public IClientSocketFactory getClientSocketFactory(BSslTlsEnum bSslTlsEnum) throws Exception { + return new CryptoWbClientSocketFactory(Nre.getSecurityInfoProvider(), bSslTlsEnum.getTag()); + } + + public IClientSocketFactory getClientSocketFactory(String string) throws Exception { + return new CryptoWbClientSocketFactory(Nre.getSecurityInfoProvider(), string); + } + + public String getClientSocketFactoryClass(BSslTlsEnum bSslTlsEnum) throws Exception { + throw new UnsupportedOperationException("not supported by the workbench"); + } + + public String getClientSocketFactoryClass(String string) throws Exception { + throw new UnsupportedOperationException("not supported by the workbench"); + } + + public ICoreCryptoManager getCoreCryptoManager() { + return this.cryptoManager; + } + + private static final String getFilePath(BOrd bOrd) throws IOException { + OrdQuery[] ordQueryArray = bOrd.parse(); + FilePath filePath = (FilePath)ordQueryArray[ordQueryArray.length - 1]; + File file = BFileSystem.INSTANCE.pathToLocalFile(filePath); + return file.getPath(); + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.cryptoManager = null; + this.trustKeyStore = null; + this.keyStore = null; + this.exemptionStore = null; + this.providerInfo = null; + } + + public BWbCertManager() throws Exception { + this.this(); + log.trace("WbCryptoFactory started"); + try { + AccessController.doPrivileged(new PrivilegedExceptionAction(){ + + public final Object run() throws Exception { + HttpsURLConnection.setDefaultSSLSocketFactory((SSLSocketFactory)BWbCertManager.this.getClientSocketFactory(BTlsEnum.DEFAULT.getTag())); + return null; + } + }); + } + catch (PrivilegedActionException privilegedActionException) { + throw privilegedActionException.getException(); + } + this.cryptoManager = CoreCryptoManager.get((ISecurityInfoProvider)Nre.getSecurityInfoProvider()); + } + + static { + Class clazz = class$com$tridium$platcrypto$core$BWbCertManager; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$core$BWbCertManager = BWbCertManager.class("[Lcom.tridium.platcrypto.core.BWbCertManager;", false); + } + TYPE = Sys.loadType((Class)clazz); + log = Log.getLog((String)"crypto"); + lex = Lexicon.make((String)"platCrypto"); + icon = BIcon.std((String)"files/certificate.png"); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/core/BX509Certificate.java b/modules/cfr_output/com/tridium/platcrypto/core/BX509Certificate.java new file mode 100644 index 0000000..ed30678 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/core/BX509Certificate.java @@ -0,0 +1,237 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.crypto.core.cert.NX509CertificateEntry + * javax.baja.nre.util.ByteArrayUtil + * javax.baja.sys.BAbsTime + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platcrypto.core; + +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.crypto.core.cert.NX509CertificateEntry; +import javax.baja.nre.util.ByteArrayUtil; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BX509Certificate +extends BComponent { + public static final Property alias = BX509Certificate.newProperty((int)3, (String)"", null); + public static final Property version = BX509Certificate.newProperty((int)3, (String)"", null); + public static final Property serialNumber = BX509Certificate.newProperty((int)3, (String)"", null); + public static final Property issuerDN = BX509Certificate.newProperty((int)3, (String)"", null); + public static final Property subjectDN = BX509Certificate.newProperty((int)3, (String)"", null); + public static final Property notBefore = BX509Certificate.newProperty((int)3, (BValue)BAbsTime.DEFAULT, null); + public static final Property notAfter = BX509Certificate.newProperty((int)3, (BValue)BAbsTime.DEFAULT, null); + public static final Property keyAlgorithm = BX509Certificate.newProperty((int)3, (String)"", null); + public static final Property keySize = BX509Certificate.newProperty((int)3, (int)0, null); + public static final Property signatureAlgorithm = BX509Certificate.newProperty((int)3, (String)"", null); + public static final Property signatureSize = BX509Certificate.newProperty((int)3, (int)0, null); + public static final Property basicConstraints = BX509Certificate.newProperty((int)3, (String)"", null); + public static final Property keyUsage = BX509Certificate.newProperty((int)3, (String)"", null); + public static final Property ExtendedKeyUsage = BX509Certificate.newProperty((int)3, (String)"", null); + public static final Property md5Fingerprint = BX509Certificate.newProperty((int)3, (String)"", null); + public static final Property sha1Fingerprint = BX509Certificate.newProperty((int)3, (String)"", null); + public static final Property valid = BX509Certificate.newProperty((int)3, (boolean)false, null); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platcrypto$core$BX509Certificate; + + public String getAlias() { + return this.getString(alias); + } + + public void setAlias(String string) { + this.setString(alias, string, null); + } + + public String getVersion() { + return this.getString(version); + } + + public void setVersion(String string) { + this.setString(version, string, null); + } + + public String getSerialNumber() { + return this.getString(serialNumber); + } + + public void setSerialNumber(String string) { + this.setString(serialNumber, string, null); + } + + public String getIssuerDN() { + return this.getString(issuerDN); + } + + public void setIssuerDN(String string) { + this.setString(issuerDN, string, null); + } + + public String getSubjectDN() { + return this.getString(subjectDN); + } + + public void setSubjectDN(String string) { + this.setString(subjectDN, string, null); + } + + public BAbsTime getNotBefore() { + return (BAbsTime)this.get(notBefore); + } + + public void setNotBefore(BAbsTime bAbsTime) { + this.set(notBefore, (BValue)bAbsTime, null); + } + + public BAbsTime getNotAfter() { + return (BAbsTime)this.get(notAfter); + } + + public void setNotAfter(BAbsTime bAbsTime) { + this.set(notAfter, (BValue)bAbsTime, null); + } + + public String getKeyAlgorithm() { + return this.getString(keyAlgorithm); + } + + public void setKeyAlgorithm(String string) { + this.setString(keyAlgorithm, string, null); + } + + public int getKeySize() { + return this.getInt(keySize); + } + + public void setKeySize(int n) { + this.setInt(keySize, n, null); + } + + public String getSignatureAlgorithm() { + return this.getString(signatureAlgorithm); + } + + public void setSignatureAlgorithm(String string) { + this.setString(signatureAlgorithm, string, null); + } + + public int getSignatureSize() { + return this.getInt(signatureSize); + } + + public void setSignatureSize(int n) { + this.setInt(signatureSize, n, null); + } + + public String getBasicConstraints() { + return this.getString(basicConstraints); + } + + public void setBasicConstraints(String string) { + this.setString(basicConstraints, string, null); + } + + public String getKeyUsage() { + return this.getString(keyUsage); + } + + public void setKeyUsage(String string) { + this.setString(keyUsage, string, null); + } + + public String getExtendedKeyUsage() { + return this.getString(ExtendedKeyUsage); + } + + public void setExtendedKeyUsage(String string) { + this.setString(ExtendedKeyUsage, string, null); + } + + public String getMd5Fingerprint() { + return this.getString(md5Fingerprint); + } + + public void setMd5Fingerprint(String string) { + this.setString(md5Fingerprint, string, null); + } + + public String getSha1Fingerprint() { + return this.getString(sha1Fingerprint); + } + + public void setSha1Fingerprint(String string) { + this.setString(sha1Fingerprint, string, null); + } + + public boolean getValid() { + return this.getBoolean(valid); + } + + public void setValid(boolean bl) { + this.setBoolean(valid, bl, null); + } + + public Type getType() { + return TYPE; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BX509Certificate() { + } + + public BX509Certificate(NX509CertificateEntry nX509CertificateEntry) { + this.setAlias(nX509CertificateEntry.getAlias()); + NX509Certificate nX509Certificate = nX509CertificateEntry.getCertificate(0); + this.setVersion("v" + nX509Certificate.getVersion()); + this.setSerialNumber(ByteArrayUtil.toHexString((byte[])nX509Certificate.getSerialNumber().toByteArray(), (String)" ")); + this.setIssuerDN(nX509Certificate.getIssuerDN().toString()); + this.setSubjectDN(nX509Certificate.getSubjectDN().toString()); + this.setNotBefore(BAbsTime.make((long)nX509Certificate.getNotBefore().getTime())); + this.setNotAfter(BAbsTime.make((long)nX509Certificate.getNotAfter().getTime())); + this.setKeyAlgorithm(nX509Certificate.getKeyAlgorithm()); + this.setKeySize(nX509Certificate.getKeySize()); + this.setSignatureAlgorithm(nX509Certificate.getSignatureAlgorithm()); + this.setSignatureSize(nX509Certificate.getSignatureSize()); + this.setBasicConstraints(nX509Certificate.getBasicConstraints()); + this.setKeyUsage(nX509Certificate.getKeyUsage()); + this.setExtendedKeyUsage(nX509Certificate.getExtendedKeyUsage()); + this.setMd5Fingerprint(nX509Certificate.getMD5Fingerprint()); + this.setSha1Fingerprint(nX509Certificate.getSHA1Fingerprint()); + this.setValid(nX509Certificate.checkValidity()); + } + + static { + Class clazz = class$com$tridium$platcrypto$core$BX509Certificate; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$core$BX509Certificate = BX509Certificate.class("[Lcom.tridium.platcrypto.core.BX509Certificate;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/core/ICryptoManagerProvider.java b/modules/cfr_output/com/tridium/platcrypto/core/ICryptoManagerProvider.java new file mode 100644 index 0000000..b13c332 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/core/ICryptoManagerProvider.java @@ -0,0 +1,14 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.ICoreCryptoManager + */ +package com.tridium.platcrypto.core; + +import com.tridium.crypto.core.io.ICoreCryptoManager; + +public interface ICryptoManagerProvider { + public ICoreCryptoManager getCoreCryptoManager() throws Exception; +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/core/IExtCryptoManager.java b/modules/cfr_output/com/tridium/platcrypto/core/IExtCryptoManager.java new file mode 100644 index 0000000..1e21bce --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/core/IExtCryptoManager.java @@ -0,0 +1,27 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.ICoreCryptoManager + * com.tridium.crypto.core.io.ICoreExemptionStore + * javax.baja.security.crypto.ICryptoManagerEx + */ +package com.tridium.platcrypto.core; + +import com.tridium.crypto.core.io.ICoreCryptoManager; +import com.tridium.crypto.core.io.ICoreExemptionStore; +import com.tridium.platcrypto.core.IProviderInfo; +import java.io.File; +import javax.baja.security.crypto.ICryptoManagerEx; + +public interface IExtCryptoManager +extends ICryptoManagerEx { + public ICoreExemptionStore getExemptionStore() throws Exception; + + public IProviderInfo getProviderInfo() throws Exception; + + public File getBaseDir(); + + public ICoreCryptoManager getCoreCryptoManager() throws Exception; +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/core/IProviderInfo.java b/modules/cfr_output/com/tridium/platcrypto/core/IProviderInfo.java new file mode 100644 index 0000000..4265efb --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/core/IProviderInfo.java @@ -0,0 +1,17 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.provider.IProvider + */ +package com.tridium.platcrypto.core; + +import com.tridium.crypto.core.provider.IProvider; +import java.util.Enumeration; + +public interface IProviderInfo { + public Enumeration providers() throws Exception; + + public IProvider getProvider(String var1) throws Exception; +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/core/NExemptionStore.java b/modules/cfr_output/com/tridium/platcrypto/core/NExemptionStore.java new file mode 100644 index 0000000..0e19248 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/core/NExemptionStore.java @@ -0,0 +1,51 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NHostExemption + * com.tridium.crypto.core.io.ICoreExemptionStore + */ +package com.tridium.platcrypto.core; + +import com.tridium.crypto.core.cert.NHostExemption; +import com.tridium.crypto.core.io.ICoreExemptionStore; +import java.io.IOException; +import java.util.Enumeration; + +public class NExemptionStore +implements ICoreExemptionStore { + private ICoreExemptionStore exemptionStore; + + public Enumeration exemptions() throws Exception { + return this.exemptionStore.exemptions(); + } + + public NHostExemption getExemption(String string) throws Exception { + return this.exemptionStore.getExemption(string); + } + + public void setExemption(NHostExemption nHostExemption) throws Exception { + this.exemptionStore.setExemption(nHostExemption); + } + + public void deleteExemption(String string) throws Exception { + this.exemptionStore.deleteExemption(string); + } + + public long getLastModified() throws Exception { + return this.exemptionStore.getLastModified(); + } + + public void load() throws Exception { + this.exemptionStore.load(); + } + + public void save() throws IOException, Exception { + this.exemptionStore.save(); + } + + public NExemptionStore(ICoreExemptionStore iCoreExemptionStore) { + this.exemptionStore = iCoreExemptionStore; + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/core/NKeyStore.java b/modules/cfr_output/com/tridium/platcrypto/core/NKeyStore.java new file mode 100644 index 0000000..c32bcb2 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/core/NKeyStore.java @@ -0,0 +1,133 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NPKCS10CertificationRequest + * com.tridium.crypto.core.io.ICoreKeyStore + * javax.baja.security.crypto.IKeyStore + */ +package com.tridium.platcrypto.core; + +import com.tridium.crypto.core.cert.NPKCS10CertificationRequest; +import com.tridium.crypto.core.io.ICoreKeyStore; +import java.security.Key; +import java.security.KeyStore; +import java.security.cert.X509Certificate; +import java.util.Date; +import java.util.Enumeration; +import javax.baja.security.crypto.IKeyStore; + +public class NKeyStore +implements IKeyStore, +ICoreKeyStore { + private ICoreKeyStore keyStore; + + public Enumeration aliases() throws Exception { + return this.keyStore.aliases(); + } + + public boolean containsAlias(String string) throws Exception { + return this.keyStore.containsAlias(string); + } + + public void deleteEntry(String string) throws Exception { + this.keyStore.deleteEntry(string); + } + + public X509Certificate getCertificate(String string) throws Exception { + return this.keyStore.getCertificate(string); + } + + public String getCertificateAlias(X509Certificate x509Certificate) throws Exception { + return this.keyStore.getCertificateAlias(x509Certificate); + } + + public X509Certificate[] getCertificateChain(String string) throws Exception { + return this.keyStore.getCertificateChain(string); + } + + public Date getCreationDate(String string) throws Exception { + return this.keyStore.getCreationDate(string); + } + + public Key getKey(String string, char[] cArray) throws Exception { + return this.keyStore.getKey(string, cArray); + } + + public boolean isCertificateEntry(String string) throws Exception { + return this.keyStore.isCertificateEntry(string); + } + + public boolean isKeyEntry(String string) throws Exception { + return this.keyStore.isKeyEntry(string); + } + + public void setCertificateEntry(String string, X509Certificate x509Certificate) throws Exception { + this.keyStore.setCertificateEntry(string, x509Certificate); + } + + public void setKeyEntry(String string, byte[] byArray, X509Certificate[] x509CertificateArray) throws Exception { + this.keyStore.setKeyEntry(string, byArray, x509CertificateArray); + } + + public void setKeyEntry(String string, Key key, char[] cArray, X509Certificate[] x509CertificateArray) throws Exception { + this.keyStore.setKeyEntry(string, key, cArray, x509CertificateArray); + } + + public int size() throws Exception { + return this.keyStore.size(); + } + + public Enumeration getCertificates() throws Exception { + return this.keyStore.getCertificates(); + } + + public String findCertificate(X509Certificate x509Certificate) throws Exception { + return this.keyStore.findCertificate(x509Certificate); + } + + public void deleteEntries(String[] stringArray) throws Exception { + this.keyStore.deleteEntries(stringArray); + } + + public int generateSelfSignedCert(String string, String string2, String string3, String string4, String string5, String string6, String string7, Date date, Date date2, int n, int n2, String string8, String string9) throws Exception { + return this.keyStore.generateSelfSignedCert(string, string2, string3, string4, string5, string6, string7, date, date2, n, n2, string8, string9); + } + + public int generateSelfSignedCert(String string, String string2, Date date, Date date2, int n, int n2, String string3, String string4) throws Exception { + return this.keyStore.generateSelfSignedCert(string, string2, date, date2, n, n2, string3, string4); + } + + public NPKCS10CertificationRequest generateCSR(String string, String string2) throws Exception { + return this.keyStore.generateCSR(string, string2); + } + + public int getCertGenerationStatus(int n) throws Exception { + return this.keyStore.getCertGenerationStatus(n); + } + + public long getLastModified() throws Exception { + return this.keyStore.getLastModified(); + } + + public void load() throws Exception { + this.keyStore.load(); + } + + public void save() throws Exception { + this.keyStore.save(); + } + + public KeyStore getKeyStore() throws Exception { + return this.keyStore.getKeyStore(); + } + + public boolean canGenerateCertificate() { + return true; + } + + public NKeyStore(ICoreKeyStore iCoreKeyStore) { + this.keyStore = iCoreKeyStore; + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/core/NProviderInfo.java b/modules/cfr_output/com/tridium/platcrypto/core/NProviderInfo.java new file mode 100644 index 0000000..dcac3e7 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/core/NProviderInfo.java @@ -0,0 +1,32 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.ICoreProviderInfo + * com.tridium.crypto.core.provider.IProvider + */ +package com.tridium.platcrypto.core; + +import com.tridium.crypto.core.io.ICoreProviderInfo; +import com.tridium.crypto.core.provider.IProvider; +import com.tridium.platcrypto.core.IProviderInfo; +import java.util.Enumeration; + +public class NProviderInfo +implements IProviderInfo, +ICoreProviderInfo { + private ICoreProviderInfo providerInfo; + + public Enumeration providers() throws Exception { + return this.providerInfo.providers(); + } + + public IProvider getProvider(String string) throws Exception { + return this.providerInfo.getProvider(string); + } + + public NProviderInfo(ICoreProviderInfo iCoreProviderInfo) { + this.providerInfo = iCoreProviderInfo; + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/core/WbAppletCryptoManager.java b/modules/cfr_output/com/tridium/platcrypto/core/WbAppletCryptoManager.java new file mode 100644 index 0000000..3fbb7bd --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/core/WbAppletCryptoManager.java @@ -0,0 +1,59 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.CoreKeyStore + * com.tridium.crypto.core.io.ICoreCryptoManager + * com.tridium.crypto.core.io.ICoreExemptionStore + * com.tridium.crypto.core.io.ICoreKeyStore + * com.tridium.crypto.core.io.ICoreProviderInfo + */ +package com.tridium.platcrypto.core; + +import com.tridium.crypto.core.io.CoreKeyStore; +import com.tridium.crypto.core.io.ICoreCryptoManager; +import com.tridium.crypto.core.io.ICoreExemptionStore; +import com.tridium.crypto.core.io.ICoreKeyStore; +import com.tridium.crypto.core.io.ICoreProviderInfo; +import java.io.File; +import java.io.FileNotFoundException; + +public class WbAppletCryptoManager +implements ICoreCryptoManager { + public ICoreKeyStore getKeyStore() throws Exception { + throw new UnsupportedOperationException("not supported by the applet"); + } + + public ICoreKeyStore getTrustStore() throws Exception { + File file = null; + String string = System.getProperty("javax.net.ssl.trustStore", null); + String string2 = System.getProperty("javax.net.ssl.trustStorePassword", "changeit"); + if (string != null) { + file = new File(string); + } + if (string == null || !file.exists()) { + file = new File(System.getProperty("java.home"), "lib/security/jssecacerts"); + } + if (!file.exists()) { + file = new File(System.getProperty("java.home"), "lib/security/cacerts"); + } + if (!file.exists()) { + throw new FileNotFoundException("Unable to find default truststore"); + } + CoreKeyStore coreKeyStore = new CoreKeyStore((ICoreCryptoManager)this, file, string2.toCharArray(), null); + return coreKeyStore; + } + + public ICoreExemptionStore getExemptionStore() throws Exception { + return null; + } + + public ICoreProviderInfo getProviderInfo() throws Exception { + throw new UnsupportedOperationException("not supported by the applet"); + } + + public boolean isSecure() { + throw new UnsupportedOperationException("not supported by the applet"); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/BDaemonSecureScheme.java b/modules/cfr_output/com/tridium/platcrypto/daemon/BDaemonSecureScheme.java new file mode 100644 index 0000000..db89e61 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/BDaemonSecureScheme.java @@ -0,0 +1,155 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.platform.daemon.BDaemonScheme$DaemonQuery + * com.tridium.platform.daemon.BDaemonSession + * javax.baja.naming.BHost + * javax.baja.naming.BOrdScheme + * javax.baja.naming.InvalidOrdBaseException + * javax.baja.naming.OrdQuery + * javax.baja.naming.OrdTarget + * javax.baja.naming.SyntaxException + * javax.baja.naming.UnresolvedException + * javax.baja.security.AuthenticationException + * javax.baja.sys.BObject + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platcrypto.daemon; + +import com.tridium.platcrypto.daemon.BDaemonSecureSession; +import com.tridium.platform.daemon.BDaemonScheme; +import com.tridium.platform.daemon.BDaemonSession; +import javax.baja.naming.BHost; +import javax.baja.naming.BOrdScheme; +import javax.baja.naming.InvalidOrdBaseException; +import javax.baja.naming.OrdQuery; +import javax.baja.naming.OrdTarget; +import javax.baja.naming.SyntaxException; +import javax.baja.naming.UnresolvedException; +import javax.baja.security.AuthenticationException; +import javax.baja.sys.BObject; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BDaemonSecureScheme +extends BOrdScheme { + public static final BDaemonSecureScheme INSTANCE = new BDaemonSecureScheme(); + public static final int DEFAULT_PORT = 5011; + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platcrypto$daemon$BDaemonSecureScheme; + + public OrdQuery parse(String string) { + return new DaemonQuery(string); + } + + public OrdTarget resolve(OrdTarget ordTarget, OrdQuery ordQuery) throws SyntaxException, UnresolvedException { + if (!(ordTarget.get() instanceof BHost)) { + throw new InvalidOrdBaseException(); + } + BHost bHost = (BHost)ordTarget.get(); + BDaemonScheme.DaemonQuery daemonQuery = (BDaemonScheme.DaemonQuery)ordQuery; + int n = daemonQuery == null ? 5011 : daemonQuery.getPort(); + String[] stringArray = daemonQuery == null ? null : daemonQuery.getTunnelAuthorities(); + BDaemonSession bDaemonSession = null; + try { + bDaemonSession = BDaemonSecureSession.make(bHost, n, stringArray); + bDaemonSession.connect(); + } + catch (AuthenticationException authenticationException) { + if (bDaemonSession != null) { + bDaemonSession.disconnect(); + } + throw authenticationException; + } + catch (Exception exception) { + throw new UnresolvedException(ordQuery.toString(), (Throwable)exception); + } + return new OrdTarget(ordTarget, (BObject)bDaemonSession); + } + + static String[] validateAuthorities(String[] stringArray) { + if (stringArray == null) { + return null; + } + int n = stringArray.length; + if (n < 1) { + return null; + } + String[] stringArray2 = new String[n]; + int n2 = 0; + int n3 = 0; + while (n3 < n) { + if (stringArray[n3] != null && !stringArray[n3].equals("")) { + stringArray2[n2] = stringArray[n3]; + ++n2; + } + ++n3; + } + String[] stringArray3 = new String[n2]; + System.arraycopy(stringArray2, 0, stringArray3, 0, n2); + return stringArray3; + } + + public Type getType() { + return TYPE; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private BDaemonSecureScheme() { + super("platformssl"); + } + + static { + Class clazz = class$com$tridium$platcrypto$daemon$BDaemonSecureScheme; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$daemon$BDaemonSecureScheme = BDaemonSecureScheme.class("[Lcom.tridium.platcrypto.daemon.BDaemonSecureScheme;", false); + } + TYPE = Sys.loadType((Class)clazz); + } + + public static class DaemonQuery + extends BDaemonScheme.DaemonQuery + implements OrdQuery { + public String getScheme() { + return "platformssl"; + } + + public String toString() { + return "platformssl:" + this.getBody(); + } + + public int getDefaultPort() { + return 5011; + } + + DaemonQuery(String string) { + super(string); + } + + DaemonQuery(int n) { + super(n); + } + + DaemonQuery(int n, String[] stringArray) { + super(n, stringArray); + } + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/BDaemonSecureSession.java b/modules/cfr_output/com/tridium/platcrypto/daemon/BDaemonSecureSession.java new file mode 100644 index 0000000..97451c7 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/BDaemonSecureSession.java @@ -0,0 +1,254 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.net.HttpUtil + * com.tridium.platform.BPlatformSSLSettings + * com.tridium.platform.daemon.BDaemonSession + * com.tridium.util.BSessionInfo + * javax.baja.io.net.IClientSocketFactory + * javax.baja.naming.BHost + * javax.baja.naming.BOrd + * javax.baja.naming.OrdQuery + * javax.baja.nav.BINavNode + * javax.baja.net.HttpConnection + * javax.baja.net.HttpsConnection + * javax.baja.security.BIUserCredentials + * javax.baja.sys.BIcon + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.LexiconText + */ +package com.tridium.platcrypto.daemon; + +import com.tridium.net.HttpUtil; +import com.tridium.platcrypto.daemon.BDaemonSecureScheme; +import com.tridium.platcrypto.util.BSslSessionInfo; +import com.tridium.platform.BPlatformSSLSettings; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.util.BSessionInfo; +import java.net.ConnectException; +import java.net.Socket; +import java.net.SocketException; +import javax.baja.io.net.IClientSocketFactory; +import javax.baja.naming.BHost; +import javax.baja.naming.BOrd; +import javax.baja.naming.OrdQuery; +import javax.baja.nav.BINavNode; +import javax.baja.net.HttpConnection; +import javax.baja.net.HttpsConnection; +import javax.baja.security.BIUserCredentials; +import javax.baja.sys.BIcon; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.LexiconText; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BDaemonSecureSession +extends BDaemonSession { + public static final String PLATFORM_SSL_ORD = "platformssl"; + public static final Type TYPE; + private static final BIcon secureBadgeConnected; + private static final BIcon secureBadgeDisconnected; + private IClientSocketFactory socketFactory; + private Socket lastSocket; + private Object SOCKET_FACTORY_LOCK; + private BOrd ordInHost; + private BOrd absOrd; + static /* synthetic */ Class class$com$tridium$platcrypto$daemon$BDaemonSecureSession; + + public Type getType() { + return TYPE; + } + + protected BDaemonSession makeNewSession(BHost bHost, int n, String[] stringArray) { + return BDaemonSecureSession.make(bHost, n, stringArray); + } + + public static BDaemonSession makeIgnoringCache(BHost bHost, int n, String[] stringArray) { + StringBuffer stringBuffer = new StringBuffer("noCache:"); + stringBuffer.append(PLATFORM_SSL_ORD); + if (n != 5011) { + stringBuffer.append(":").append(n); + } + if (stringArray != null) { + int n2 = 0; + while (n2 < stringArray.length) { + if (stringArray[n2] != null) { + stringBuffer.append("/").append(stringArray[n2]); + } + ++n2; + } + } + return new BDaemonSecureSession(stringBuffer.toString(), bHost, n, stringArray, BOrd.make((String)"")); + } + + public static BDaemonSession make(BHost bHost, int n, String[] stringArray) { + BDaemonSession bDaemonSession; + StringBuffer stringBuffer = new StringBuffer(PLATFORM_SSL_ORD); + if (n != 5011) { + stringBuffer.append(":").append(n); + } + if (stringArray != null) { + int n2 = 0; + while (n2 < stringArray.length) { + if (stringArray[n2] != null) { + stringBuffer.append("/").append(stringArray[n2]); + } + ++n2; + } + } + if ((bDaemonSession = (BDaemonSession)bHost.getNavChild(stringBuffer.toString())) == null || !(bDaemonSession instanceof BDaemonSecureSession)) { + BOrd bOrd; + if (stringArray != null) { + int n3 = 0; + while (n3 < stringArray.length) { + HttpUtil.parseHost((String)stringArray[n3]); + HttpUtil.parsePort((String)stringArray[n3], (int)3011); + ++n3; + } + bOrd = BOrd.make((OrdQuery)new BDaemonSecureScheme.DaemonQuery(n, stringArray)); + } else { + bOrd = BOrd.make((OrdQuery)new BDaemonSecureScheme.DaemonQuery(n)); + } + bDaemonSession = new BDaemonSecureSession(stringBuffer.toString(), bHost, n, stringArray, bOrd); + bHost.addNavChild((BINavNode)bDaemonSession); + } + return bDaemonSession; + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + protected HttpConnection createNewConnection(String string, long l, int n, int n2, String string2) throws SocketException { + try { + Object object = this.SOCKET_FACTORY_LOCK; + synchronized (object) { + if (this.socketFactory == null) { + this.socketFactory = HttpsConnection.getDefaultSocketFactory(); + } + HttpsConnection httpsConnection = new HttpsConnection(this.getHost(), this.getPort(), string2, this.socketFactory); + return this.initConnection((HttpConnection)httpsConnection, string, l, n, n2); + } + } + catch (Exception exception) { + return null; + } + } + + protected void setDefaultAgent() { + this.getAgentList().remove("platform:DaemonTunnelSessionAgent"); + this.getAgentList().remove("platform:DaemonSessionAgent"); + if (this.tunnelAuthorities != null) { + this.getAgentList().toTop("platformssl:DaemonSecureTunnelSessionAgent"); + } else { + this.getAgentList().toTop("platformssl:DaemonSecureSessionAgent"); + } + } + + protected int connect(HttpConnection httpConnection) throws ConnectException { + int n = super.connect(httpConnection); + this.lastSocket = httpConnection.getSocket(); + return n; + } + + public BSessionInfo getSessionInfo() { + BHost bHost = this.getHost(); + if (bHost != null) { + String string = null; + if (this.getCredentials() instanceof BIUserCredentials) { + string = ((BIUserCredentials)this.getCredentials()).getUsername(); + } + return BSslSessionInfo.make(bHost.getHostname(), this.getLastConnectedAbsTime(), this.lastSocket, string); + } + return null; + } + + public boolean shouldDowngrade(BPlatformSSLSettings bPlatformSSLSettings) { + return bPlatformSSLSettings.getSslEnabled() ^ true; + } + + public boolean isSecure() { + return true; + } + + protected String getLexiconPrefix() { + return "DaemonSecureSession."; + } + + protected int getDefaultPort() { + return 5011; + } + + public BIcon getIcon() { + return BIcon.make((BIcon)super.getIcon(), (BIcon)(this.isConnected() ? secureBadgeConnected : secureBadgeDisconnected)); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public synchronized void disconnect(boolean bl) { + super.disconnect(bl); + Object object = this.SOCKET_FACTORY_LOCK; + synchronized (object) { + this.socketFactory = null; + return; + } + } + + public BOrd getNavOrd() { + return this.getAbsoluteOrd(); + } + + public BOrd getOrdInHost() { + return this.ordInHost; + } + + public BOrd getAbsoluteOrd() { + return this.absOrd; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.lastSocket = null; + this.SOCKET_FACTORY_LOCK = new Object(); + } + + protected BDaemonSecureSession(String string, BHost bHost, int n, String[] stringArray, BOrd bOrd) { + super(string, bHost, n, stringArray, bOrd, stringArray == null ? LexiconText.make((String)"platCrypto", (String)"daemon.secure.session") : LexiconText.make((String)"platCrypto", (String)"daemon.secure.tunnel.session")); + this.this(); + this.ordInHost = bOrd; + this.absOrd = BOrd.make((BOrd)bHost.getAbsoluteOrd(), (BOrd)this.ordInHost); + } + + static { + Class clazz = class$com$tridium$platcrypto$daemon$BDaemonSecureSession; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$daemon$BDaemonSecureSession = BDaemonSecureSession.class("[Lcom.tridium.platcrypto.daemon.BDaemonSecureSession;", false); + } + TYPE = Sys.loadType((Class)clazz); + secureBadgeConnected = BIcon.std((String)"badges/lock.png"); + secureBadgeDisconnected = BIcon.std((String)"badges/lockDisconnected.png"); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatCryptoBase.java b/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatCryptoBase.java new file mode 100644 index 0000000..6f350df --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatCryptoBase.java @@ -0,0 +1,100 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.platform.daemon.BDaemonSession + * com.tridium.platform.daemon.message.DaemonMessage + * javax.baja.security.AuthenticationException + * javax.baja.sys.BComponent + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + * javax.baja.xml.XParser + */ +package com.tridium.platcrypto.daemon; + +import com.tridium.platcrypto.daemon.messages.CryptoServletMessage; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.daemon.message.DaemonMessage; +import java.io.InputStream; +import java.net.ConnectException; +import javax.baja.security.AuthenticationException; +import javax.baja.sys.BComponent; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; +import javax.baja.xml.XParser; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BPlatCryptoBase +extends BComponent { + public static final Type TYPE; + private BDaemonSession session; + static /* synthetic */ Class class$com$tridium$platcrypto$daemon$BPlatCryptoBase; + + public Type getType() { + return TYPE; + } + + public XElem send(CryptoServletMessage cryptoServletMessage) throws ConnectException, AuthenticationException { + try { + if (cryptoServletMessage.getMethod().equals("POST")) { + return this.getDaemonSession().post((DaemonMessage)cryptoServletMessage); + } + InputStream inputStream = this.getDaemonSession().getInputStream((DaemonMessage)cryptoServletMessage); + XParser xParser = XParser.make((InputStream)inputStream); + if (xParser != null) { + return xParser.parse(); + } + } + catch (Exception exception) {} + return null; + } + + public XElem[] send(CryptoServletMessage cryptoServletMessage, String string) throws Exception { + XElem xElem; + InputStream inputStream = this.getDaemonSession().getInputStream((DaemonMessage)cryptoServletMessage); + XParser xParser = XParser.make((InputStream)inputStream); + if (xParser != null && (xElem = xParser.parse()) != null) { + XElem[] xElemArray = xElem.elems(string); + return xElemArray; + } + return new XElem[0]; + } + + public BDaemonSession getDaemonSession() { + return this.session; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BPlatCryptoBase() throws UnsupportedOperationException { + throw new UnsupportedOperationException(); + } + + public BPlatCryptoBase(BDaemonSession bDaemonSession) { + this.session = bDaemonSession; + } + + static { + Class clazz = class$com$tridium$platcrypto$daemon$BPlatCryptoBase; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$daemon$BPlatCryptoBase = BPlatCryptoBase.class("[Lcom.tridium.platcrypto.daemon.BPlatCryptoBase;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatCryptoManager.java b/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatCryptoManager.java new file mode 100644 index 0000000..31559f5 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatCryptoManager.java @@ -0,0 +1,91 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.ICoreCryptoManager + * com.tridium.crypto.core.io.ICoreExemptionStore + * com.tridium.crypto.core.io.ICoreKeyStore + * com.tridium.crypto.core.io.ICoreProviderInfo + * com.tridium.platform.daemon.BDaemonSession + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platcrypto.daemon; + +import com.tridium.crypto.core.io.ICoreCryptoManager; +import com.tridium.crypto.core.io.ICoreExemptionStore; +import com.tridium.crypto.core.io.ICoreKeyStore; +import com.tridium.crypto.core.io.ICoreProviderInfo; +import com.tridium.platcrypto.daemon.BPlatCryptoBase; +import com.tridium.platcrypto.daemon.BPlatExemptionStore; +import com.tridium.platcrypto.daemon.BPlatKeyStore; +import com.tridium.platcrypto.daemon.BPlatProviderInfo; +import com.tridium.platcrypto.daemon.BPlatTrustStore; +import com.tridium.platform.daemon.BDaemonSession; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPlatCryptoManager +extends BPlatCryptoBase +implements ICoreCryptoManager { + public static final Type TYPE; + public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; + static /* synthetic */ Class class$com$tridium$platcrypto$daemon$BPlatCryptoManager; + + public Type getType() { + return TYPE; + } + + public ICoreExemptionStore getExemptionStore() throws Exception { + return new BPlatExemptionStore(this.getDaemonSession()); + } + + public ICoreKeyStore getKeyStore() throws Exception { + return new BPlatKeyStore(this.getDaemonSession()); + } + + public ICoreProviderInfo getProviderInfo() throws Exception { + return new BPlatProviderInfo(this.getDaemonSession()); + } + + public ICoreKeyStore getTrustStore() throws Exception { + return new BPlatTrustStore(this.getDaemonSession()); + } + + public boolean isSecure() { + return this.getDaemonSession().isSecure(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BPlatCryptoManager() throws UnsupportedOperationException { + throw new UnsupportedOperationException(); + } + + public BPlatCryptoManager(BDaemonSession bDaemonSession) { + super(bDaemonSession); + } + + static { + Class clazz = class$com$tridium$platcrypto$daemon$BPlatCryptoManager; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$daemon$BPlatCryptoManager = BPlatCryptoManager.class("[Lcom.tridium.platcrypto.daemon.BPlatCryptoManager;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatExemptionStore.java b/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatExemptionStore.java new file mode 100644 index 0000000..ecff595 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatExemptionStore.java @@ -0,0 +1,216 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NHostExemption + * com.tridium.crypto.core.io.ICoreExemptionStore + * com.tridium.platform.daemon.BDaemonSession + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.platcrypto.daemon; + +import com.tridium.crypto.core.cert.NHostExemption; +import com.tridium.crypto.core.io.ICoreExemptionStore; +import com.tridium.platcrypto.daemon.BPlatCryptoBase; +import com.tridium.platcrypto.daemon.messages.CryptoServletMessage; +import com.tridium.platform.daemon.BDaemonSession; +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPlatExemptionStore +extends BPlatCryptoBase +implements ICoreExemptionStore { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platcrypto$daemon$BPlatExemptionStore; + + public Type getType() { + return TYPE; + } + + public Enumeration exemptions() throws Exception { + XElem[] xElemArray = this.send(new GetExemptionsMessage(), "exemption"); + ArrayList arrayList = new ArrayList(); + if (xElemArray != null) { + int n = 0; + while (n < xElemArray.length) { + arrayList.add(NHostExemption.decodeFromString((String)xElemArray[n].text().string())); + ++n; + } + return Collections.enumeration(arrayList); + } + return null; + } + + public NHostExemption getExemption(String string) throws Exception { + XElem[] xElemArray = this.send(new GetExemptionMessage(string), "exemption"); + if (xElemArray != null && xElemArray.length > 0) { + return NHostExemption.decodeFromString((String)xElemArray[0].text().string()); + } + return null; + } + + public void setExemption(NHostExemption nHostExemption) throws Exception { + this.send(new SetExemptionMessage(nHostExemption)); + } + + public void deleteExemption(String string) throws Exception { + this.send(new DeleteExemptionMessage(string)); + } + + public long getLastModified() throws Exception { + return 0L; + } + + public void load() throws Exception { + } + + public void save() throws IOException, Exception { + this.send(new SaveExemptionMessage()); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BPlatExemptionStore() throws UnsupportedOperationException { + throw new UnsupportedOperationException(); + } + + public BPlatExemptionStore(BDaemonSession bDaemonSession) { + super(bDaemonSession); + } + + static { + Class clazz = class$com$tridium$platcrypto$daemon$BPlatExemptionStore; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$daemon$BPlatExemptionStore = BPlatExemptionStore.class("[Lcom.tridium.platcrypto.daemon.BPlatExemptionStore;", false); + } + TYPE = Sys.loadType((Class)clazz); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class GetExemptionsMessage + extends CryptoServletMessage { + public String getAction() { + return "getExemptions"; + } + + private GetExemptionsMessage() { + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class GetExemptionMessage + extends CryptoServletMessage { + public String getAction() { + return "getExemption"; + } + + public GetExemptionMessage(String string) { + this.add("host", string); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class SetExemptionMessage + extends CryptoServletMessage { + private NHostExemption exemption; + + public String getMethod() { + return "POST"; + } + + public String getAction() { + return "setExemption"; + } + + /* + * Exception decompiling + */ + public void write(OutputStream var1_1) { + /* + * This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. + * + * org.benf.cfr.reader.util.ConfusedCFRException: Back jump on a try block [egrp 2[TRYBLOCK] [2 : 69->73)] java.lang.Throwable + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.insertExceptionBlocks(Op02WithProcessedDataAndRefs.java:2283) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:415) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201) + * at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94) + * at org.benf.cfr.reader.entities.Method.analyse(Method.java:531) + * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055) + * at org.benf.cfr.reader.entities.ClassFile.analyseInnerClassesPass1(ClassFile.java:923) + * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1035) + * at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942) + * at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257) + * at org.benf.cfr.reader.Driver.doJar(Driver.java:139) + * at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76) + * at org.benf.cfr.reader.Main.main(Main.java:54) + */ + throw new IllegalStateException("Decompilation failed"); + } + + public SetExemptionMessage(NHostExemption nHostExemption) { + this.exemption = nHostExemption; + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class DeleteExemptionMessage + extends CryptoServletMessage { + public String getAction() { + return "deleteExemption"; + } + + public DeleteExemptionMessage(String string) { + try { + this.add("host", string); + } + catch (Exception exception) { + throw new IllegalArgumentException("Invalid host", exception); + } + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class SaveExemptionMessage + extends CryptoServletMessage { + public String getAction() { + return "saveExemptions"; + } + + private SaveExemptionMessage() { + } + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatKeyStore.java b/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatKeyStore.java new file mode 100644 index 0000000..da71cf7 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatKeyStore.java @@ -0,0 +1,457 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NKey + * com.tridium.crypto.core.cert.NPKCS10CertificationRequest + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.crypto.core.cert.NX509CertificateEntry + * com.tridium.crypto.core.io.ICoreKeyStore + * com.tridium.platform.daemon.BDaemonSession + * com.tridium.platform.daemon.BStationSurrogate + * com.tridium.platform.daemon.message.DaemonMessage + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + * javax.baja.xml.XParser + * javax.baja.xml.XText + */ +package com.tridium.platcrypto.daemon; + +import com.tridium.crypto.core.cert.NKey; +import com.tridium.crypto.core.cert.NPKCS10CertificationRequest; +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.crypto.core.cert.NX509CertificateEntry; +import com.tridium.crypto.core.io.ICoreKeyStore; +import com.tridium.platcrypto.daemon.BPlatCryptoBase; +import com.tridium.platcrypto.daemon.messages.CertGenerationStatusMessage; +import com.tridium.platcrypto.daemon.messages.FindCertificateMessage; +import com.tridium.platcrypto.daemon.messages.GenerateCertificateMessage; +import com.tridium.platcrypto.daemon.messages.GetKeyMessage; +import com.tridium.platcrypto.daemon.messages.KeyStoreMessage; +import com.tridium.platcrypto.daemon.messages.SetCertificateEntryMessage; +import com.tridium.platcrypto.daemon.messages.SetKeyEntryMessage; +import com.tridium.platcrypto.daemon.messages.SetKeyEntryWithResponseMessage; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.daemon.BStationSurrogate; +import com.tridium.platform.daemon.message.DaemonMessage; +import java.io.InputStream; +import java.security.Key; +import java.security.KeyStore; +import java.security.cert.X509Certificate; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.Enumeration; +import java.util.List; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; +import javax.baja.xml.XParser; +import javax.baja.xml.XText; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPlatKeyStore +extends BPlatCryptoBase +implements ICoreKeyStore { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platcrypto$daemon$BPlatKeyStore; + + public Type getType() { + return TYPE; + } + + public String getKeyStoreType() { + return "keystore"; + } + + private final List getAliases() throws Exception { + InputStream inputStream = this.getDaemonSession().getInputStream((DaemonMessage)new KeyStoreMessage(this.getKeyStoreType())); + XElem xElem = XParser.make((InputStream)inputStream).parse(); + XElem[] xElemArray = xElem.elems("key"); + int n = 0; + if (xElemArray != null) { + n = xElemArray.length; + } + ArrayList arrayList = new ArrayList(n); + if (xElemArray != null) { + int n2 = 0; + while (n2 < xElemArray.length) { + String string = xElemArray[n2].get("alias"); + if (string != null && string.length() > 0) { + arrayList.add(string); + } + ++n2; + } + } + return arrayList; + } + + public Enumeration aliases() throws Exception { + return Collections.enumeration(this.getAliases()); + } + + public boolean containsAlias(String string) throws Exception { + return this.getAliases().contains(string); + } + + public void deleteEntries(String[] stringArray) throws Exception { + int n = 0; + while (n < stringArray.length) { + this.deleteEntry(stringArray[n]); + ++n; + } + } + + public void deleteEntry(String string) throws Exception { + this.getDaemonSession().sendMessage((DaemonMessage)new DeleteEntryMessage(this.getKeyStoreType(), string)); + } + + public X509Certificate[] getCertificateChain(String string) throws Exception { + XElem[] xElemArray = this.send(new GetCertificateChainMessage(this.getKeyStoreType(), string), "certificate"); + if (xElemArray == null || xElemArray.length == 0) { + return null; + } + X509Certificate[] x509CertificateArray = new X509Certificate[xElemArray.length]; + int n = 0; + while (n < x509CertificateArray.length) { + if (xElemArray[n] != null && xElemArray[n].text() != null && xElemArray[n].text().length() > 0) { + x509CertificateArray[n] = NX509Certificate.decodeFromString((String)xElemArray[n].text().string()); + } + ++n; + } + return x509CertificateArray; + } + + public Key getKey(String string, char[] cArray) throws Exception { + String string2; + XText xText; + InputStream inputStream = this.getDaemonSession().getInputStream((DaemonMessage)new GetKeyMessage(this.getKeyStoreType(), string, cArray)); + XElem xElem = XParser.make((InputStream)inputStream).parse(); + if (xElem != null && (xText = xElem.text()) != null && (string2 = xText.toString()) != null && string2.length() > 0) { + return NKey.decodeFromString((String)string2); + } + return null; + } + + public Date getCreationDate(String string) throws Exception { + String string2; + InputStream inputStream = this.getDaemonSession().getInputStream((DaemonMessage)new KeyStoreMessage(this.getKeyStoreType(), string)); + XElem[] xElemArray = XParser.make((InputStream)inputStream).parse().elems("key"); + if (xElemArray.length > 0 && (string2 = xElemArray[0].get("creationDate")) != null && string2.length() == "yyyy-MM-dd HH:mm:ss".length()) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date = simpleDateFormat.parse(string2); + return date; + } + return null; + } + + public boolean isKeyEntry(String string) throws Exception { + InputStream inputStream = this.getDaemonSession().getInputStream((DaemonMessage)new KeyStoreMessage(this.getKeyStoreType(), string)); + XElem[] xElemArray = XParser.make((InputStream)inputStream).parse().elems("key"); + if (xElemArray.length > 0) { + return xElemArray[0].getb("keyEntry"); + } + return false; + } + + public boolean isCertificateEntry(String string) throws Exception { + InputStream inputStream = this.getDaemonSession().getInputStream((DaemonMessage)new KeyStoreMessage(this.getKeyStoreType(), string)); + XElem[] xElemArray = XParser.make((InputStream)inputStream).parse().elems("key"); + if (xElemArray.length > 0) { + return xElemArray[0].getb("certEntry"); + } + return false; + } + + public void setCertificateEntry(String string, X509Certificate x509Certificate) throws Exception { + this.send(new SetCertificateEntryMessage(this.getKeyStoreType(), string, x509Certificate)); + } + + public void setKeyEntry(String string, byte[] byArray, X509Certificate[] x509CertificateArray) throws Exception { + XElem xElem = this.send(new SetKeyEntryWithResponseMessage(this.getKeyStoreType(), string, byArray, x509CertificateArray)); + if (xElem.text() != null) { + if (!xElem.text().string().equalsIgnoreCase("success")) { + throw new Exception(xElem.text().string()); + } + } else { + this.send(new SetKeyEntryMessage(this.getKeyStoreType(), string, byArray, x509CertificateArray)); + } + } + + public void setKeyEntry(String string, Key key, char[] cArray, X509Certificate[] x509CertificateArray) throws Exception { + XElem xElem = this.send(new SetKeyEntryWithResponseMessage(this.getKeyStoreType(), string, key, cArray, x509CertificateArray)); + if (xElem.text() != null) { + if (!xElem.text().string().equalsIgnoreCase("success")) { + throw new Exception(xElem.text().string()); + } + } else { + this.send(new SetKeyEntryMessage(this.getKeyStoreType(), string, key, cArray, x509CertificateArray)); + } + } + + public Enumeration getCertificates() throws Exception { + XElem[] xElemArray = this.send(new GetCertificatesMessage(this.getKeyStoreType()), "certificateEntry"); + int n = 0; + if (xElemArray != null) { + n = xElemArray.length; + } + ArrayList arrayList = new ArrayList(n); + if (xElemArray != null) { + int n2 = 0; + while (n2 < xElemArray.length) { + String string = xElemArray[n2].text().toString(); + if (string != null && string.length() > 0) { + arrayList.add(NX509CertificateEntry.decodeFromString((String)string)); + } + ++n2; + } + } + return Collections.enumeration(arrayList); + } + + public String findCertificate(X509Certificate x509Certificate) throws Exception { + Enumeration enumeration = this.getCertificates(); + while (enumeration.hasMoreElements()) { + NX509CertificateEntry nX509CertificateEntry = (NX509CertificateEntry)enumeration.nextElement(); + NX509Certificate nX509Certificate = nX509CertificateEntry.getCertificate(0); + if (nX509Certificate == null || !nX509Certificate.getPublicKey().equals(x509Certificate.getPublicKey())) continue; + return nX509CertificateEntry.getAlias(); + } + return null; + } + + public int generateSelfSignedCert(String string, String string2, String string3, String string4, String string5, String string6, String string7, Date date, Date date2, int n, int n2, String string8, String string9) throws Exception { + XElem xElem = this.send(new GenerateCertificateMessage(this.getKeyStoreType(), string, string2, string3, string4, string5, string6, string7, date, date2, n, n2, string8, string9)); + if (xElem != null) { + return xElem.geti("requestId", -1); + } + return -1; + } + + public int generateSelfSignedCert(String string, String string2, Date date, Date date2, int n, int n2, String string3, String string4) throws Exception { + XElem xElem = this.send(new GenerateCertificateMessage(this.getKeyStoreType(), string, string2, date, date2, n, n2, string3, string4)); + if (xElem != null) { + return xElem.geti("requestId", -1); + } + return -1; + } + + public int getCertGenerationStatus(int n) throws Exception { + XElem xElem = this.send(new CertGenerationStatusMessage(this.getKeyStoreType(), n)); + if (xElem != null) { + return xElem.geti("status", -1); + } + return -1; + } + + public NPKCS10CertificationRequest generateCSR(String string, String string2) throws Exception { + XElem xElem = this.send(new GenerateCsrMessage(this.getKeyStoreType(), string, string2)); + if (xElem != null && xElem.text() != null) { + String string3 = xElem.text().toString(); + return NPKCS10CertificationRequest.make((String)string3); + } + return null; + } + + public X509Certificate getCertificate(String string) throws Exception { + XElem xElem = this.send(new GetCertificateMessage(this.getKeyStoreType(), string)); + if (xElem != null && xElem.text() != null) { + String string2 = xElem.text().toString(); + return NX509Certificate.decodeFromString((String)string2); + } + return null; + } + + public String getCertificateAlias(X509Certificate x509Certificate) throws Exception { + InputStream inputStream = this.getDaemonSession().getInputStream((DaemonMessage)new GetCertificateAliasMessage(this.getKeyStoreType(), x509Certificate)); + XElem xElem = XParser.make((InputStream)inputStream).parse(); + String string = xElem.get("alias"); + return string; + } + + public int size() throws Exception { + return this.getAliases().size(); + } + + public long getLastModified() throws Exception { + return 0L; + } + + public void load() throws Exception { + } + + public void save() throws Exception { + this.send(new SaveMessage(this.getKeyStoreType())); + } + + public KeyStore getKeyStore() throws Exception { + throw new UnsupportedOperationException("can't access raw keystore remotely"); + } + + public boolean canGenerateCertificate() { + boolean bl = false; + try { + BDaemonSession bDaemonSession = this.getDaemonSession(); + if (bDaemonSession.getHostProperties().supportsServlet("crypto")) { + InputStream inputStream = this.getDaemonSession().getInputStream((DaemonMessage)new SendAliasesMessage(this.getKeyStoreType())); + XElem xElem = XParser.make((InputStream)inputStream).parse(); + bl = xElem.attrIndex("canGenerate") != -1 ? xElem.getb("canGenerate", false) : (bDaemonSession.getHostProperties().getOsName().startsWith("qnx") ? BStationSurrogate.isAnyStationRunning((BDaemonSession)bDaemonSession) ^ true : true); + } + } + catch (Exception exception) {} + return bl; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BPlatKeyStore() throws UnsupportedOperationException { + throw new UnsupportedOperationException(); + } + + public BPlatKeyStore(BDaemonSession bDaemonSession) { + super(bDaemonSession); + } + + static { + Class clazz = class$com$tridium$platcrypto$daemon$BPlatKeyStore; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$daemon$BPlatKeyStore = BPlatKeyStore.class("[Lcom.tridium.platcrypto.daemon.BPlatKeyStore;", false); + } + TYPE = Sys.loadType((Class)clazz); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class DeleteEntryMessage + extends KeyStoreMessage { + public String getAction() { + return "deleteEntry"; + } + + public DeleteEntryMessage(String string, String string2) { + super(string); + this.add("alias", string2); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class GetCertificateChainMessage + extends KeyStoreMessage { + public String getAction() { + return "getCertificateChain"; + } + + public GetCertificateChainMessage(String string, String string2) { + super(string); + this.add("alias", string2); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class GetCertificatesMessage + extends KeyStoreMessage { + public String getAction() { + return "getCertificates"; + } + + public GetCertificatesMessage(String string) { + super(string); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class GenerateCsrMessage + extends KeyStoreMessage { + public String getAction() { + return "generateCsr"; + } + + public GenerateCsrMessage(String string, String string2, String string3) { + super(string); + this.add("alias", string2); + if (string3 != null) { + this.add("passwd", string3); + } + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class GetCertificateMessage + extends KeyStoreMessage { + public String getAction() { + return "getCertificate"; + } + + public GetCertificateMessage(String string, String string2) { + super(string); + this.add("alias", string2); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class GetCertificateAliasMessage + extends FindCertificateMessage { + public String getAction() { + return "getCertificateAlias"; + } + + public GetCertificateAliasMessage(String string, X509Certificate x509Certificate) { + super(string, x509Certificate); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class SaveMessage + extends KeyStoreMessage { + public String getAction() { + return "saveKeyStore"; + } + + public SaveMessage(String string) { + super(string); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + public class SendAliasesMessage + extends KeyStoreMessage { + public String getAction() { + return "sendAliases"; + } + + public SendAliasesMessage(String string) { + super(string); + } + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatProviderInfo.java b/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatProviderInfo.java new file mode 100644 index 0000000..49b9209 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatProviderInfo.java @@ -0,0 +1,94 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.ICoreProviderInfo + * com.tridium.crypto.core.provider.IProvider + * com.tridium.crypto.core.provider.NProvider + * com.tridium.platform.daemon.BDaemonSession + * com.tridium.platform.daemon.message.DaemonMessage + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + * javax.baja.xml.XParser + */ +package com.tridium.platcrypto.daemon; + +import com.tridium.crypto.core.io.ICoreProviderInfo; +import com.tridium.crypto.core.provider.IProvider; +import com.tridium.crypto.core.provider.NProvider; +import com.tridium.platcrypto.daemon.BPlatCryptoBase; +import com.tridium.platcrypto.daemon.messages.GetProviderMessage; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.daemon.message.DaemonMessage; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; +import javax.baja.xml.XParser; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPlatProviderInfo +extends BPlatCryptoBase +implements ICoreProviderInfo { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platcrypto$daemon$BPlatProviderInfo; + + public Type getType() { + return TYPE; + } + + public IProvider getProvider(String string) throws Exception { + InputStream inputStream = this.getDaemonSession().getInputStream((DaemonMessage)new GetProviderMessage(string)); + XElem[] xElemArray = XParser.make((InputStream)inputStream).parse().elems("provider"); + if (xElemArray != null && xElemArray.length > 0) { + return NProvider.decodeFromString((String)xElemArray[0].text().string()); + } + return null; + } + + public Enumeration providers() throws Exception { + InputStream inputStream = this.getDaemonSession().getInputStream((DaemonMessage)new GetProviderMessage()); + XElem[] xElemArray = XParser.make((InputStream)inputStream).parse().elems("provider"); + ArrayList arrayList = new ArrayList(); + if (xElemArray != null && xElemArray.length > 0) { + arrayList.add(NProvider.decodeFromString((String)xElemArray[0].text().string())); + } + return Collections.enumeration(arrayList); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BPlatProviderInfo() throws UnsupportedOperationException { + throw new UnsupportedOperationException(); + } + + public BPlatProviderInfo(BDaemonSession bDaemonSession) { + super(bDaemonSession); + } + + static { + Class clazz = class$com$tridium$platcrypto$daemon$BPlatProviderInfo; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$daemon$BPlatProviderInfo = BPlatProviderInfo.class("[Lcom.tridium.platcrypto.daemon.BPlatProviderInfo;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatTrustStore.java b/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatTrustStore.java new file mode 100644 index 0000000..87ab0ac --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/BPlatTrustStore.java @@ -0,0 +1,61 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.platform.daemon.BDaemonSession + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platcrypto.daemon; + +import com.tridium.platcrypto.daemon.BPlatKeyStore; +import com.tridium.platform.daemon.BDaemonSession; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPlatTrustStore +extends BPlatKeyStore { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platcrypto$daemon$BPlatTrustStore; + + public Type getType() { + return TYPE; + } + + public String getKeyStoreType() { + return "truststore"; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BPlatTrustStore() throws UnsupportedOperationException { + throw new UnsupportedOperationException(); + } + + public BPlatTrustStore(BDaemonSession bDaemonSession) { + super(bDaemonSession); + } + + static { + Class clazz = class$com$tridium$platcrypto$daemon$BPlatTrustStore; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$daemon$BPlatTrustStore = BPlatTrustStore.class("[Lcom.tridium.platcrypto.daemon.BPlatTrustStore;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/messages/CertGenerationStatusMessage.java b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/CertGenerationStatusMessage.java new file mode 100644 index 0000000..52acca6 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/CertGenerationStatusMessage.java @@ -0,0 +1,19 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platcrypto.daemon.messages; + +import com.tridium.platcrypto.daemon.messages.KeyStoreMessage; + +public class CertGenerationStatusMessage +extends KeyStoreMessage { + public String getAction() { + return "genCertStatus"; + } + + public CertGenerationStatusMessage(String string, int n) { + super(string); + this.add("requestId", "" + n); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/messages/CryptoServletMessage.java b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/CryptoServletMessage.java new file mode 100644 index 0000000..3b03056 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/CryptoServletMessage.java @@ -0,0 +1,47 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.platform.daemon.message.DaemonMessage + */ +package com.tridium.platcrypto.daemon.messages; + +import com.tridium.platform.daemon.message.DaemonMessage; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +public class CryptoServletMessage +extends DaemonMessage { + private static final String ENC = "UTF-8"; + private StringBuilder message = new StringBuilder("crypto"); + + public String getAction() { + return "sendAliases"; + } + + public String getMessageString() { + return this.message.toString(); + } + + protected void add(String string, String string2) { + this.message.append("&").append(CryptoServletMessage.encode(string)).append("=").append(CryptoServletMessage.encode(string2)); + } + + private static final String encode(String string) { + String string2 = ""; + if (string != null) { + try { + string2 = URLEncoder.encode(string, ENC); + } + catch (UnsupportedEncodingException unsupportedEncodingException) { + string2 = URLEncoder.encode(string); + } + } + return string2; + } + + public CryptoServletMessage() { + this.message.append("?action=").append(this.getAction()); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/messages/FindCertificateMessage.java b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/FindCertificateMessage.java new file mode 100644 index 0000000..5a509ba --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/FindCertificateMessage.java @@ -0,0 +1,59 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platcrypto.daemon.messages; + +import com.tridium.platcrypto.daemon.messages.KeyStoreMessage; +import java.io.OutputStream; +import java.security.cert.X509Certificate; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class FindCertificateMessage +extends KeyStoreMessage { + private X509Certificate cert; + + public String getMethod() { + return "POST"; + } + + public String getAction() { + return "findCertificate"; + } + + /* + * Exception decompiling + */ + public void write(OutputStream var1_1) { + /* + * This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. + * + * org.benf.cfr.reader.util.ConfusedCFRException: Back jump on a try block [egrp 2[TRYBLOCK] [2 : 62->66)] java.lang.Throwable + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.insertExceptionBlocks(Op02WithProcessedDataAndRefs.java:2283) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:415) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201) + * at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94) + * at org.benf.cfr.reader.entities.Method.analyse(Method.java:531) + * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055) + * at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942) + * at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257) + * at org.benf.cfr.reader.Driver.doJar(Driver.java:139) + * at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76) + * at org.benf.cfr.reader.Main.main(Main.java:54) + */ + throw new IllegalStateException("Decompilation failed"); + } + + private final /* synthetic */ void this() { + this.cert = null; + } + + public FindCertificateMessage(String string, X509Certificate x509Certificate) { + super(string); + this.this(); + this.cert = x509Certificate; + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/messages/GenerateCertificateMessage.java b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/GenerateCertificateMessage.java new file mode 100644 index 0000000..dd0d43a --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/GenerateCertificateMessage.java @@ -0,0 +1,53 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platcrypto.daemon.messages; + +import com.tridium.platcrypto.daemon.messages.KeyStoreMessage; +import java.text.SimpleDateFormat; +import java.util.Date; + +public class GenerateCertificateMessage +extends KeyStoreMessage { + private final void setCommon(Date date, Date date2, int n, int n2, String string, String string2) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + this.add("notBefore", simpleDateFormat.format(date)); + this.add("notAfter", simpleDateFormat.format(date2)); + this.add("keySize", String.valueOf(n)); + this.add("keyUsage", String.valueOf(n2)); + this.add("email", string); + if (string2 != null) { + this.add("password", string2); + } + } + + public String getAction() { + return "generateCert"; + } + + public GenerateCertificateMessage(String string, String string2, String string3, String string4, String string5, String string6, String string7, String string8, Date date, Date date2, int n, int n2, String string9, String string10) { + super(string); + this.add("alias", string2); + this.add("cn", string3); + if (string4 != null) { + this.add("ou", string4); + } + this.add("o", string5); + if (string6 != null) { + this.add("l", string6); + } + if (string7 != null) { + this.add("st", string7); + } + this.add("c", string8); + this.setCommon(date, date2, n, n2, string9, string10); + } + + public GenerateCertificateMessage(String string, String string2, String string3, Date date, Date date2, int n, int n2, String string4, String string5) { + super(string); + this.add("alias", string2); + this.add("dn", string3); + this.setCommon(date, date2, n, n2, string4, string5); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/messages/GetKeyMessage.java b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/GetKeyMessage.java new file mode 100644 index 0000000..e5048d3 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/GetKeyMessage.java @@ -0,0 +1,30 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.nre.util.LegacyStorageUtil + */ +package com.tridium.platcrypto.daemon.messages; + +import com.tridium.nre.util.LegacyStorageUtil; +import com.tridium.platcrypto.daemon.messages.KeyStoreMessage; +import java.io.IOException; + +public class GetKeyMessage +extends KeyStoreMessage { + public String getAction() { + return "getKey"; + } + + public GetKeyMessage(String string, String string2, char[] cArray) { + super(string); + this.add("alias", string2); + if (cArray != null && cArray.length > 0) { + try { + this.add("password", LegacyStorageUtil.encode((String)String.valueOf(cArray))); + } + catch (IOException iOException) {} + } + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/messages/GetProviderMessage.java b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/GetProviderMessage.java new file mode 100644 index 0000000..e0866de --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/GetProviderMessage.java @@ -0,0 +1,21 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platcrypto.daemon.messages; + +import com.tridium.platcrypto.daemon.messages.CryptoServletMessage; + +public class GetProviderMessage +extends CryptoServletMessage { + public String getAction() { + return "getProvider"; + } + + public GetProviderMessage() { + } + + public GetProviderMessage(String string) { + this.add("name", string); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/messages/KeyStoreMessage.java b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/KeyStoreMessage.java new file mode 100644 index 0000000..0b7cb06 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/KeyStoreMessage.java @@ -0,0 +1,19 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platcrypto.daemon.messages; + +import com.tridium.platcrypto.daemon.messages.CryptoServletMessage; + +public class KeyStoreMessage +extends CryptoServletMessage { + public KeyStoreMessage(String string) { + this.add("keyStoreType", string); + } + + public KeyStoreMessage(String string, String string2) { + this.add("keyStoreType", string); + this.add("alias", string2); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/messages/SetCertificateEntryMessage.java b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/SetCertificateEntryMessage.java new file mode 100644 index 0000000..774560b --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/SetCertificateEntryMessage.java @@ -0,0 +1,54 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platcrypto.daemon.messages; + +import com.tridium.platcrypto.daemon.messages.KeyStoreMessage; +import java.io.OutputStream; +import java.security.cert.X509Certificate; + +public class SetCertificateEntryMessage +extends KeyStoreMessage { + private String alias; + private X509Certificate cert; + + public String getAction() { + return "setCertificateEntry"; + } + + public String getMethod() { + return "POST"; + } + + /* + * Exception decompiling + */ + public void write(OutputStream var1_1) { + /* + * This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. + * + * org.benf.cfr.reader.util.ConfusedCFRException: Back jump on a try block [egrp 2[TRYBLOCK] [2 : 95->99)] java.lang.Throwable + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.insertExceptionBlocks(Op02WithProcessedDataAndRefs.java:2283) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:415) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201) + * at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94) + * at org.benf.cfr.reader.entities.Method.analyse(Method.java:531) + * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055) + * at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942) + * at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257) + * at org.benf.cfr.reader.Driver.doJar(Driver.java:139) + * at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76) + * at org.benf.cfr.reader.Main.main(Main.java:54) + */ + throw new IllegalStateException("Decompilation failed"); + } + + public SetCertificateEntryMessage(String string, String string2, X509Certificate x509Certificate) { + super(string); + this.add("alias", string2); + this.alias = string2; + this.cert = x509Certificate; + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/messages/SetKeyEntryMessage.java b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/SetKeyEntryMessage.java new file mode 100644 index 0000000..d3dceff --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/SetKeyEntryMessage.java @@ -0,0 +1,69 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platcrypto.daemon.messages; + +import com.tridium.platcrypto.daemon.messages.KeyStoreMessage; +import java.io.OutputStream; +import java.security.Key; +import java.security.cert.X509Certificate; + +public class SetKeyEntryMessage +extends KeyStoreMessage { + private String alias; + private Key key; + private byte[] rawKey; + private char[] password; + private X509Certificate[] chain; + + public String getAction() { + return "setKeyEntry"; + } + + public String getMethod() { + return "POST"; + } + + /* + * Exception decompiling + */ + public void write(OutputStream var1_1) { + /* + * This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. + * + * org.benf.cfr.reader.util.ConfusedCFRException: Back jump on a try block [egrp 5[TRYBLOCK] [5 : 279->283)] java.lang.Throwable + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.insertExceptionBlocks(Op02WithProcessedDataAndRefs.java:2283) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:415) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201) + * at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94) + * at org.benf.cfr.reader.entities.Method.analyse(Method.java:531) + * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055) + * at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942) + * at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257) + * at org.benf.cfr.reader.Driver.doJar(Driver.java:139) + * at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76) + * at org.benf.cfr.reader.Main.main(Main.java:54) + */ + throw new IllegalStateException("Decompilation failed"); + } + + public SetKeyEntryMessage(String string, String string2, byte[] byArray, X509Certificate[] x509CertificateArray) { + super(string); + this.add("alias", string2); + this.alias = string2; + this.chain = x509CertificateArray; + this.rawKey = byArray; + this.password = null; + } + + public SetKeyEntryMessage(String string, String string2, Key key, char[] cArray, X509Certificate[] x509CertificateArray) { + super(string); + this.add("alias", string2); + this.alias = string2; + this.chain = x509CertificateArray; + this.key = key; + this.password = cArray; + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/messages/SetKeyEntryWithResponseMessage.java b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/SetKeyEntryWithResponseMessage.java new file mode 100644 index 0000000..3063f61 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/messages/SetKeyEntryWithResponseMessage.java @@ -0,0 +1,24 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platcrypto.daemon.messages; + +import com.tridium.platcrypto.daemon.messages.SetKeyEntryMessage; +import java.security.Key; +import java.security.cert.X509Certificate; + +public class SetKeyEntryWithResponseMessage +extends SetKeyEntryMessage { + public String getAction() { + return "setKeyEntryWithResponse"; + } + + public SetKeyEntryWithResponseMessage(String string, String string2, byte[] byArray, X509Certificate[] x509CertificateArray) { + super(string, string2, byArray, x509CertificateArray); + } + + public SetKeyEntryWithResponseMessage(String string, String string2, Key key, char[] cArray, X509Certificate[] x509CertificateArray) { + super(string, string2, key, cArray, x509CertificateArray); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/ui/BDaemonSecureCnxHandler.java b/modules/cfr_output/com/tridium/platcrypto/daemon/ui/BDaemonSecureCnxHandler.java new file mode 100644 index 0000000..babdeb0 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/ui/BDaemonSecureCnxHandler.java @@ -0,0 +1,99 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.platform.ui.BDaemonCnxHandler + * com.tridium.workbench.ord.BHostOrdFE + * javax.baja.naming.BOrd + * javax.baja.naming.OrdQuery + * javax.baja.security.BICredentials + * javax.baja.security.BUsernameAndPassword + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.daemon.ui; + +import com.tridium.platcrypto.daemon.BDaemonSecureScheme; +import com.tridium.platcrypto.daemon.ui.BDaemonSecureSessionOrdFE; +import com.tridium.platform.ui.BDaemonCnxHandler; +import com.tridium.workbench.ord.BHostOrdFE; +import javax.baja.naming.BOrd; +import javax.baja.naming.OrdQuery; +import javax.baja.security.BICredentials; +import javax.baja.security.BUsernameAndPassword; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BDaemonSecureCnxHandler +extends BDaemonCnxHandler { + public static final Type TYPE; + private static final String KEY = "open.ssl.daemon"; + static /* synthetic */ Class class$com$tridium$platcrypto$daemon$ui$BDaemonSecureCnxHandler; + + public Type getType() { + return TYPE; + } + + public boolean isSecure() { + return true; + } + + protected void saveHostAddress() throws Exception { + BOrd bOrd; + this.ordFE.setAutoSaveHistory(false); + this.hostOrd = bOrd = (BOrd)this.ordFE.saveValue(); + this.port = 5011; + if (!bOrd.isNull()) { + OrdQuery[] ordQueryArray = bOrd.parse(); + int n = 1; + while (n < ordQueryArray.length) { + if (ordQueryArray[n] instanceof BDaemonSecureScheme.DaemonQuery) { + BDaemonSecureScheme.DaemonQuery daemonQuery = (BDaemonSecureScheme.DaemonQuery)ordQueryArray[n]; + this.port = daemonQuery.getPort(); + this.tunnelAuthorities = daemonQuery.getTunnelAuthorities(); + break; + } + ++n; + } + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BDaemonSecureCnxHandler() { + super(BDaemonSecureScheme.INSTANCE.getId(), 5011, (BHostOrdFE)new BDaemonSecureSessionOrdFE(), (BICredentials)new BUsernameAndPassword(), TYPE.getModule().getLexicon(), KEY); + } + + public BDaemonSecureCnxHandler(Lexicon lexicon, String string) { + super(BDaemonSecureScheme.INSTANCE.getId(), 5011, (BHostOrdFE)new BDaemonSecureSessionOrdFE(), (BICredentials)new BUsernameAndPassword(), lexicon, string); + } + + public BDaemonSecureCnxHandler(String string, int n, BHostOrdFE bHostOrdFE, BICredentials bICredentials, Lexicon lexicon, String string2) { + super(string, n, bHostOrdFE, bICredentials, lexicon, string2); + } + + static { + Class clazz = class$com$tridium$platcrypto$daemon$ui$BDaemonSecureCnxHandler; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$daemon$ui$BDaemonSecureCnxHandler = BDaemonSecureCnxHandler.class("[Lcom.tridium.platcrypto.daemon.ui.BDaemonSecureCnxHandler;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/ui/BDaemonSecureSessionAgent.java b/modules/cfr_output/com/tridium/platcrypto/daemon/ui/BDaemonSecureSessionAgent.java new file mode 100644 index 0000000..d70d825 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/ui/BDaemonSecureSessionAgent.java @@ -0,0 +1,68 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.platform.daemon.BDaemonSession + * com.tridium.workbench.nav.BSessionAgent + * javax.baja.naming.BHost + * javax.baja.naming.BISession + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.platcrypto.daemon.ui; + +import com.tridium.platcrypto.daemon.BDaemonSecureSession; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.workbench.nav.BSessionAgent; +import javax.baja.naming.BHost; +import javax.baja.naming.BISession; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BDaemonSecureSessionAgent +extends BSessionAgent { + public static final BDaemonSecureSessionAgent INSTANCE = new BDaemonSecureSessionAgent(); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platcrypto$daemon$ui$BDaemonSecureSessionAgent; + + public Type getType() { + return TYPE; + } + + public void pickle(BISession bISession, XElem xElem) { + BDaemonSession bDaemonSession = (BDaemonSession)bISession; + xElem.addAttr("port", "" + bDaemonSession.getPort()); + } + + public BISession unpickle(BHost bHost, XElem xElem) { + int n = xElem.geti("port", 5011); + return BDaemonSecureSession.make(bHost, n, null); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$platcrypto$daemon$ui$BDaemonSecureSessionAgent; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$daemon$ui$BDaemonSecureSessionAgent = BDaemonSecureSessionAgent.class("[Lcom.tridium.platcrypto.daemon.ui.BDaemonSecureSessionAgent;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/daemon/ui/BDaemonSecureSessionOrdFE.java b/modules/cfr_output/com/tridium/platcrypto/daemon/ui/BDaemonSecureSessionOrdFE.java new file mode 100644 index 0000000..e9cda0e --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/daemon/ui/BDaemonSecureSessionOrdFE.java @@ -0,0 +1,61 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.platform.ui.BDaemonSessionOrdFE + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platcrypto.daemon.ui; + +import com.tridium.platform.ui.BDaemonSessionOrdFE; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BDaemonSecureSessionOrdFE +extends BDaemonSessionOrdFE { + public static final Type TYPE; + private static final int HTTPS_TUNNEL_PORT = 443; + static /* synthetic */ Class class$com$tridium$platcrypto$daemon$ui$BDaemonSecureSessionOrdFE; + + public Type getType() { + return TYPE; + } + + protected int getDefaultPort() { + return 5011; + } + + protected int getDefaultTunnelPort() { + return 443; + } + + protected String getDefaultOrdScheme() { + return "platformssl"; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$platcrypto$daemon$ui$BDaemonSecureSessionOrdFE; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$daemon$ui$BDaemonSecureSessionOrdFE = BDaemonSecureSessionOrdFE.class("[Lcom.tridium.platcrypto.daemon.ui.BDaemonSecureSessionOrdFE;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/fox/BCryptoChannel.java b/modules/cfr_output/com/tridium/platcrypto/fox/BCryptoChannel.java new file mode 100644 index 0000000..7a61970 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/fox/BCryptoChannel.java @@ -0,0 +1,911 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.CertUtils + * com.tridium.crypto.core.cert.NHostExemption + * com.tridium.crypto.core.cert.NKey + * com.tridium.crypto.core.cert.NPKCS10CertificationRequest + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.crypto.core.cert.NX509CertificateEntry + * com.tridium.crypto.core.io.CoreCryptoManager + * com.tridium.crypto.core.io.ICoreCryptoManager + * com.tridium.crypto.core.io.ICoreExemptionStore + * com.tridium.crypto.core.io.ICoreKeyStore + * com.tridium.crypto.core.provider.IProvider + * com.tridium.crypto.core.provider.NProvider + * com.tridium.fox.session.FoxRequest + * com.tridium.fox.session.FoxResponse + * com.tridium.fox.session.InvalidCommandException + * com.tridium.fox.sys.BFoxChannel + * com.tridium.fox.sys.BFoxSession + * com.tridium.nre.security.ISecurityInfoProvider + * com.tridium.nre.util.LegacyStorageUtil + * com.tridium.sys.Nre + * javax.baja.file.BFileSystem + * javax.baja.file.FilePath + * javax.baja.log.Log + * javax.baja.naming.BISession + * javax.baja.naming.BLocalHost + * javax.baja.naming.BOrd + * javax.baja.naming.OrdQuery + * javax.baja.nre.util.Array + * javax.baja.sys.BComponent + * javax.baja.sys.Sys + * javax.baja.sys.Type + * org.bouncycastle.jce.PrincipalUtil + * org.bouncycastle.jce.X509Principal + */ +package com.tridium.platcrypto.fox; + +import com.tridium.crypto.core.cert.CertUtils; +import com.tridium.crypto.core.cert.NHostExemption; +import com.tridium.crypto.core.cert.NKey; +import com.tridium.crypto.core.cert.NPKCS10CertificationRequest; +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.crypto.core.cert.NX509CertificateEntry; +import com.tridium.crypto.core.io.CoreCryptoManager; +import com.tridium.crypto.core.io.ICoreCryptoManager; +import com.tridium.crypto.core.io.ICoreExemptionStore; +import com.tridium.crypto.core.io.ICoreKeyStore; +import com.tridium.crypto.core.provider.IProvider; +import com.tridium.crypto.core.provider.NProvider; +import com.tridium.fox.session.FoxRequest; +import com.tridium.fox.session.FoxResponse; +import com.tridium.fox.session.InvalidCommandException; +import com.tridium.fox.sys.BFoxChannel; +import com.tridium.fox.sys.BFoxSession; +import com.tridium.nre.security.ISecurityInfoProvider; +import com.tridium.nre.util.LegacyStorageUtil; +import com.tridium.platcrypto.fox.ChannelCryptoManager; +import com.tridium.sys.Nre; +import java.io.File; +import java.io.IOException; +import java.security.Key; +import java.security.UnrecoverableKeyException; +import java.security.cert.X509Certificate; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.Enumeration; +import java.util.List; +import java.util.Vector; +import javax.baja.file.BFileSystem; +import javax.baja.file.FilePath; +import javax.baja.log.Log; +import javax.baja.naming.BISession; +import javax.baja.naming.BLocalHost; +import javax.baja.naming.BOrd; +import javax.baja.naming.OrdQuery; +import javax.baja.nre.util.Array; +import javax.baja.sys.BComponent; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import org.bouncycastle.jce.PrincipalUtil; +import org.bouncycastle.jce.X509Principal; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BCryptoChannel +extends BFoxChannel { + public static final Type TYPE; + private static Log log; + private ICoreCryptoManager service; + private boolean validChannel; + static /* synthetic */ Class class$com$tridium$platcrypto$fox$BCryptoChannel; + static /* synthetic */ Class class$com$tridium$crypto$core$cert$NX509CertificateEntry; + static /* synthetic */ Class class$com$tridium$crypto$core$cert$NHostExemption; + + public Type getType() { + return TYPE; + } + + public void sessionOpened() throws Exception { + if (this.isRunning()) { + Log.getLog((String)"crypto").trace("pairing CertManagerService with CryptoChannel"); + BISession bISession = this.getSession(); + if (bISession instanceof BLocalHost) { + this.service = CoreCryptoManager.get((ISecurityInfoProvider)Nre.getSecurityInfoProvider()); + } else if (bISession instanceof BFoxSession) { + this.service = new ChannelCryptoManager((BComponent)this); + } + } + } + + public void sessionClosed(Throwable throwable) throws Exception { + Log.getLog((String)"crypto").trace("unpairing CertManagerService with CryptoChannel"); + } + + public FoxResponse process(FoxRequest foxRequest) throws Throwable { + String string = foxRequest.command; + if (string == "keystore.serverAliases") { + return this.keyStoreServerAliases(foxRequest); + } + if (string == "keystore.aliases") { + return this.keyStoreAliases(foxRequest); + } + if (string == "keystore.containsAlias") { + return this.keyStoreContainsAlias(foxRequest); + } + if (string == "keystore.deleteEntry") { + return this.keyStoreDeleteEntry(foxRequest); + } + if (string == "keystore.getCertificate") { + return this.keyStoreGetCertificate(foxRequest); + } + if (string == "keystore.getCertificateAlias") { + return this.keyStoreGetCertificateAlias(foxRequest); + } + if (string == "keystore.getCertificateChain") { + return this.keyStoreGetCertificateChain(foxRequest); + } + if (string == "keystore.getCreationDate") { + return this.keyStoreGetCreationDate(foxRequest); + } + if (string == "keystore.getKey") { + return this.keyStoreGetKey(foxRequest); + } + if (string == "keystore.isCertificateEntry") { + return this.keyStoreIsCertificateEntry(foxRequest); + } + if (string == "keystore.isKeyEntry") { + return this.keyStoreIsKeyEntry(foxRequest); + } + if (string == "keystore.setCertificateEntry") { + return this.keyStoreSetCertificateEntry(foxRequest); + } + if (string == "keystore.setKeyEntry0") { + return this.keyStoreSetKeyEntry0(foxRequest); + } + if (string == "keystore.setKeyEntry1") { + return this.keyStoreSetKeyEntry1(foxRequest); + } + if (string == "keystore.size") { + return this.keyStoreSize(foxRequest); + } + if (string == "keystore.save") { + return this.keyStoreSave(foxRequest); + } + if (string == "keystore.getCertificates") { + return this.keyStoreGetCertificates(foxRequest); + } + if (string == "keystore.deleteEntries") { + return this.keyStoreDeleteEntries(foxRequest); + } + if (string == "keystore.findCertificate") { + return this.keyStoreFindCertificate(foxRequest); + } + if (string == "keystore.generateSelfSignedCert") { + return this.keyStoreGenerateSelfSignedCert(foxRequest); + } + if (string == "keystore.getCertGenerationStatus") { + return this.keyGetCertGenerationStatus(foxRequest); + } + if (string == "keystore.generateCSR") { + return this.keyStoreGenerateCSR(foxRequest); + } + if (string == "provider.Providers") { + return this.providerProviders(foxRequest); + } + if (string == "provider.getProvider") { + return this.providerGetProvider(foxRequest); + } + if (string == "exemption.exemptions") { + return this.exemptionExemptions(foxRequest); + } + if (string == "exemption.setExemption") { + return this.exemptionSetExemption(foxRequest); + } + if (string == "exemption.deleteExemption") { + return this.exemptionDeleteExemption(foxRequest); + } + if (string == "exemption.getExemption") { + return this.exemptionGetExemption(foxRequest); + } + if (string == "exemption.save") { + return this.exemptionSave(foxRequest); + } + throw new InvalidCommandException(string); + } + + public Enumeration keyStoreServerAliases() throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.serverAliases"); + foxRequest.add("useTrustStore", false); + FoxResponse foxResponse = this.sendSync(foxRequest); + String[] stringArray = foxResponse.listStrings("alias"); + List list = Arrays.asList(stringArray); + Enumeration enumeration = Collections.enumeration(list); + return enumeration; + } + + private final FoxResponse keyStoreServerAliases(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + Enumeration enumeration = iCoreKeyStore.aliases(); + while (enumeration.hasMoreElements()) { + String string = (String)enumeration.nextElement(); + if (!CertUtils.isValidServerCert((String)string, (ICoreKeyStore)iCoreKeyStore)) continue; + foxResponse.add("alias", string); + } + return foxResponse; + } + + public Enumeration keyStoreAliases(boolean bl) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.aliases"); + foxRequest.add("useTrustStore", bl); + FoxResponse foxResponse = this.sendSync(foxRequest); + String[] stringArray = foxResponse.listStrings("alias"); + List list = Arrays.asList(stringArray); + Enumeration enumeration = Collections.enumeration(list); + return enumeration; + } + + private final FoxResponse keyStoreAliases(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + Enumeration enumeration = iCoreKeyStore.aliases(); + while (enumeration.hasMoreElements()) { + String string = (String)enumeration.nextElement(); + foxResponse.add("alias", string); + } + return foxResponse; + } + + public boolean keyStoreContainsAlias(boolean bl, String string) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.containsAlias"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("alias", string); + FoxResponse foxResponse = this.sendSync(foxRequest); + return foxResponse.getBoolean("containsAlias"); + } + + private final FoxResponse keyStoreContainsAlias(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + foxResponse.add("containsAlias", iCoreKeyStore.containsAlias(foxRequest.getString("alias"))); + return foxResponse; + } + + public void keyStoreDeleteEntry(boolean bl, String string) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.deleteEntry"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("alias", string); + this.sendSync(foxRequest); + } + + private final FoxResponse keyStoreDeleteEntry(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + iCoreKeyStore.deleteEntry(foxRequest.getString("alias")); + return foxResponse; + } + + public X509Certificate keyStoreGetCertificate(boolean bl, String string) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.getCertificate"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("alias", string); + FoxResponse foxResponse = this.sendSync(foxRequest); + String string2 = foxResponse.getString("certificate", null); + if (string2 != null) { + X509Certificate x509Certificate = NX509Certificate.decodeFromString((String)string2); + return x509Certificate; + } + return null; + } + + private final FoxResponse keyStoreGetCertificate(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + X509Certificate x509Certificate = iCoreKeyStore.getCertificate(foxRequest.getString("alias")); + if (x509Certificate != null) { + foxResponse.add("certificate", NX509Certificate.encodeToString((X509Certificate)x509Certificate)); + } + return foxResponse; + } + + public String keyStoreGetCertificateAlias(boolean bl, X509Certificate x509Certificate) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.getCertificateAlias"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("certificate", NX509Certificate.encodeToString((X509Certificate)x509Certificate)); + FoxResponse foxResponse = this.sendSync(foxRequest); + return foxResponse.getString("alias", null); + } + + private final FoxResponse keyStoreGetCertificateAlias(FoxRequest foxRequest) throws Exception { + X509Certificate x509Certificate; + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + String string = iCoreKeyStore.getCertificateAlias(x509Certificate = NX509Certificate.decodeFromString((String)foxRequest.getString("certificate"))); + if (string != null) { + foxResponse.add("alias", string); + } + return foxResponse; + } + + public X509Certificate[] keyStoreGetCertificateChain(boolean bl, String string) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.getCertificateChain"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("alias", string); + FoxResponse foxResponse = this.sendSync(foxRequest); + String[] stringArray = foxResponse.listStrings("certificateChain"); + X509Certificate[] x509CertificateArray = null; + if (stringArray.length > 0) { + x509CertificateArray = new X509Certificate[stringArray.length]; + int n = 0; + while (n < stringArray.length) { + x509CertificateArray[n] = NX509Certificate.decodeFromString((String)stringArray[n]); + ++n; + } + } + return x509CertificateArray; + } + + private final FoxResponse keyStoreGetCertificateChain(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + X509Certificate[] x509CertificateArray = iCoreKeyStore.getCertificateChain(foxRequest.getString("alias")); + if (x509CertificateArray != null) { + int n = 0; + while (n < x509CertificateArray.length) { + foxResponse.add("certificateChain", NX509Certificate.encodeToString((X509Certificate)x509CertificateArray[n])); + ++n; + } + } + return foxResponse; + } + + public Date keyStoreGetCreationDate(boolean bl, String string) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.getCreationDate"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("alias", string); + FoxResponse foxResponse = this.sendSync(foxRequest); + Date date = new Date(foxResponse.getTime("creationDate")); + return date; + } + + private final FoxResponse keyStoreGetCreationDate(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + Date date = iCoreKeyStore.getCreationDate(foxRequest.getString("alias")); + foxResponse.add("creationDate", date.getTime()); + return foxResponse; + } + + public Key keyStoreGetKey(boolean bl, String string, char[] cArray) throws Exception { + Object object; + Object object2; + FoxRequest foxRequest = this.makeRequest("keystore.getKey"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("alias", string); + if (cArray != null) { + object2 = new String(cArray); + object = LegacyStorageUtil.encode((String)object2); + foxRequest.add("password", (String)object); + } + object2 = this.sendSync(foxRequest); + object = null; + boolean bl2 = object2.getBoolean("success", false); + if (bl2) { + String string2 = object2.getString("key", null); + if (string2 != null) { + object = NKey.decodeFromString((String)string2); + } + return object; + } + throw new UnrecoverableKeyException("unable to recover key"); + } + + private final FoxResponse keyStoreGetKey(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + try { + Key key; + char[] cArray = null; + if (foxRequest.getString("password", null) != null) { + cArray = LegacyStorageUtil.decode((String)foxRequest.getString("password")).toCharArray(); + } + if ((key = iCoreKeyStore.getKey(foxRequest.getString("alias"), cArray)) != null) { + foxResponse.add("success", true); + foxResponse.add("key", NKey.encodeToString((Key)key)); + } else { + foxResponse.add("success", false); + } + return foxResponse; + } + catch (UnrecoverableKeyException unrecoverableKeyException) { + foxResponse.add("success", false); + return foxResponse; + } + } + + public boolean keyStoreIsCertificateEntry(boolean bl, String string) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.isCertificateEntry"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("alias", string); + FoxResponse foxResponse = this.sendSync(foxRequest); + return foxResponse.getBoolean("isCertificateEntry"); + } + + private final FoxResponse keyStoreIsCertificateEntry(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + foxResponse.add("isCertificateEntry", iCoreKeyStore.isCertificateEntry(foxRequest.getString("alias"))); + return foxResponse; + } + + public boolean keyStoreIsKeyEntry(boolean bl, String string) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.isKeyEntry"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("alias", string); + FoxResponse foxResponse = this.sendSync(foxRequest); + return foxResponse.getBoolean("isKeyEntry"); + } + + private final FoxResponse keyStoreIsKeyEntry(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + foxResponse.add("isKeyEntry", iCoreKeyStore.isKeyEntry(foxRequest.getString("alias"))); + return foxResponse; + } + + public void keyStoreSetCertificateEntry(boolean bl, String string, X509Certificate x509Certificate) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.setCertificateEntry"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("alias", string); + foxRequest.add("certificate", NX509Certificate.encodeToString((X509Certificate)x509Certificate)); + this.sendSync(foxRequest); + } + + private final FoxResponse keyStoreSetCertificateEntry(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + X509Certificate x509Certificate = NX509Certificate.decodeFromString((String)foxRequest.getString("certificate")); + iCoreKeyStore.setCertificateEntry(foxRequest.getString("alias"), x509Certificate); + return foxResponse; + } + + public void keyStoreSetKeyEntry0(boolean bl, String string, byte[] byArray, X509Certificate[] x509CertificateArray) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.setKeyEntry0"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("alias", string); + foxRequest.add("key", byArray); + if (x509CertificateArray != null) { + int n = 0; + while (n < x509CertificateArray.length) { + foxRequest.add("chain", NX509Certificate.encodeToString((X509Certificate)x509CertificateArray[n])); + ++n; + } + } + this.sendSync(foxRequest); + } + + private final FoxResponse keyStoreSetKeyEntry0(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + byte[] byArray = foxRequest.getBlob("key"); + X509Certificate[] x509CertificateArray = null; + String[] stringArray = null; + try { + stringArray = foxRequest.listStrings("chain"); + x509CertificateArray = new X509Certificate[stringArray.length]; + int n = 0; + while (n < stringArray.length) { + x509CertificateArray[n] = NX509Certificate.decodeFromString((String)stringArray[n]); + ++n; + } + } + catch (IOException iOException) {} + iCoreKeyStore.setKeyEntry(foxRequest.getString("alias"), byArray, x509CertificateArray); + return foxResponse; + } + + public void keyStoreSetKeyEntry1(boolean bl, String string, Key key, char[] cArray, X509Certificate[] x509CertificateArray) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.setKeyEntry1"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("alias", string); + foxRequest.add("key", NKey.encodeToString((Key)key)); + if (cArray != null) { + String string2 = new String(cArray); + String string3 = LegacyStorageUtil.encode((String)string2); + foxRequest.add("password", string3); + } + if (x509CertificateArray != null) { + int n = 0; + while (n < x509CertificateArray.length) { + foxRequest.add("chain", NX509Certificate.encodeToString((X509Certificate)x509CertificateArray[n])); + ++n; + } + } + this.sendSync(foxRequest); + } + + private final FoxResponse keyStoreSetKeyEntry1(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + Key key = NKey.decodeFromString((String)foxRequest.getString("key")); + char[] cArray = null; + if (foxRequest.getString("password", null) != null) { + cArray = LegacyStorageUtil.decode((String)foxRequest.getString("password")).toCharArray(); + } + X509Certificate[] x509CertificateArray = null; + String[] stringArray = null; + try { + stringArray = foxRequest.listStrings("chain"); + x509CertificateArray = new X509Certificate[stringArray.length]; + int n = 0; + while (n < stringArray.length) { + x509CertificateArray[n] = NX509Certificate.decodeFromString((String)stringArray[n]); + ++n; + } + } + catch (IOException iOException) {} + iCoreKeyStore.setKeyEntry(foxRequest.getString("alias"), key, cArray, x509CertificateArray); + return foxResponse; + } + + public int keyStoreSize(boolean bl) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.size"); + foxRequest.add("useTrustStore", bl); + FoxResponse foxResponse = this.sendSync(foxRequest); + return foxResponse.getInt("size"); + } + + private final FoxResponse keyStoreSize(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + foxResponse.add("size", iCoreKeyStore.size()); + return foxResponse; + } + + public void keyStoreSave(boolean bl) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.save"); + foxRequest.add("useTrustStore", bl); + this.sendSync(foxRequest); + } + + private final FoxResponse keyStoreSave(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + iCoreKeyStore.save(); + return foxResponse; + } + + public Enumeration keyStoreGetCertificates(boolean bl) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.getCertificates"); + foxRequest.add("useTrustStore", bl); + FoxResponse foxResponse = this.sendSync(foxRequest); + String[] stringArray = foxResponse.listStrings("cert"); + Class clazz = class$com$tridium$crypto$core$cert$NX509CertificateEntry; + if (clazz == null) { + clazz = class$com$tridium$crypto$core$cert$NX509CertificateEntry = BCryptoChannel.class("[Lcom.tridium.crypto.core.cert.NX509CertificateEntry;", false); + } + Array array = new Array(clazz); + int n = 0; + while (n < stringArray.length) { + NX509CertificateEntry nX509CertificateEntry = NX509CertificateEntry.decodeFromString((String)stringArray[n]); + array.add((Object)nX509CertificateEntry); + ++n; + } + Enumeration enumeration = Collections.enumeration(array.list()); + return enumeration; + } + + private final FoxResponse keyStoreGetCertificates(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + Enumeration enumeration = iCoreKeyStore.getCertificates(); + while (enumeration.hasMoreElements()) { + NX509CertificateEntry nX509CertificateEntry = (NX509CertificateEntry)enumeration.nextElement(); + foxResponse.add("cert", nX509CertificateEntry.encodeToString()); + } + return foxResponse; + } + + public String keyStoreFindCertificate(boolean bl, X509Certificate x509Certificate) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.findCertificate"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("certificate", NX509Certificate.encodeToString((X509Certificate)x509Certificate)); + FoxResponse foxResponse = this.sendSync(foxRequest); + return foxResponse.getString("alias", null); + } + + private final FoxResponse keyStoreFindCertificate(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + X509Certificate x509Certificate = NX509Certificate.decodeFromString((String)foxRequest.getString("certificate")); + X509Principal x509Principal = PrincipalUtil.getSubjectX509Principal((X509Certificate)x509Certificate); + Enumeration enumeration = iCoreKeyStore.aliases(); + while (enumeration.hasMoreElements()) { + String string = (String)enumeration.nextElement(); + X509Certificate x509Certificate2 = iCoreKeyStore.getCertificate(string); + if (!x509Certificate2.getType().equals("X.509")) continue; + X509Certificate x509Certificate3 = x509Certificate2; + X509Principal x509Principal2 = PrincipalUtil.getSubjectX509Principal((X509Certificate)x509Certificate3); + if (!x509Principal.equals((Object)x509Principal2)) break; + foxResponse.add("alias", string); + break; + } + return foxResponse; + } + + public void keyStoreDeleteEntries(boolean bl, String[] stringArray) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.deleteEntries"); + foxRequest.add("useTrustStore", bl); + int n = 0; + while (n < stringArray.length) { + foxRequest.add("alias", stringArray[n]); + ++n; + } + this.sendSync(foxRequest); + } + + private final FoxResponse keyStoreDeleteEntries(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + String[] stringArray = foxRequest.listStrings("alias"); + int n = 0; + while (n < stringArray.length) { + log.trace("deleting entry " + stringArray[n]); + iCoreKeyStore.deleteEntry(stringArray[n]); + ++n; + } + return foxResponse; + } + + public int keyStoreGenerateSelfSignedCert(boolean bl, String string, String string2, Date date, Date date2, int n, int n2, String string3, String string4) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.generateSelfSignedCert"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("alias", string); + foxRequest.add("dn", string2); + foxRequest.add("notBefore", date.getTime()); + foxRequest.add("notAfter", date2.getTime()); + foxRequest.add("keySize", n); + foxRequest.add("keyUsage", n2); + foxRequest.add("email", string3); + foxRequest.add("password", string4); + FoxResponse foxResponse = this.sendSync(foxRequest); + return foxResponse.getInt("requestId", -1); + } + + private final FoxResponse keyStoreGenerateSelfSignedCert(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + String string = foxRequest.getString("alias"); + String string2 = foxRequest.getString("dn"); + Date date = new Date(foxRequest.getTime("notBefore")); + Date date2 = new Date(foxRequest.getTime("notAfter")); + int n = foxRequest.getInt("keySize"); + int n2 = foxRequest.getInt("keyUsage"); + String string3 = foxRequest.getString("email", null); + String string4 = foxRequest.getString("password", null); + int n3 = iCoreKeyStore.generateSelfSignedCert(string, string2, date, date2, n, n2, string3, string4); + foxResponse.add("requestId", n3); + return foxResponse; + } + + public int keyGetCertGenerationStatus(boolean bl, int n) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.getCertGenerationStatus"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("requestId", n); + FoxResponse foxResponse = this.sendSync(foxRequest); + return foxResponse.getInt("status", -1); + } + + private final FoxResponse keyGetCertGenerationStatus(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + int n = foxRequest.getInt("requestId", -1); + int n2 = iCoreKeyStore.getCertGenerationStatus(n); + foxResponse.add("requestId", n); + foxResponse.add("status", n2); + return foxResponse; + } + + public NPKCS10CertificationRequest keyStoreGenerateCSR(boolean bl, String string, String string2) throws Exception { + FoxRequest foxRequest = this.makeRequest("keystore.generateCSR"); + foxRequest.add("useTrustStore", bl); + foxRequest.add("alias", string); + if (string2 != null) { + foxRequest.add("passwd", string2); + } + FoxResponse foxResponse = this.sendSync(foxRequest); + NPKCS10CertificationRequest nPKCS10CertificationRequest = NPKCS10CertificationRequest.make((String)foxResponse.getString("csr")); + return nPKCS10CertificationRequest; + } + + private final FoxResponse keyStoreGenerateCSR(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest); + String string = foxRequest.getString("alias"); + String string2 = foxRequest.getString("passwd", null); + NPKCS10CertificationRequest nPKCS10CertificationRequest = iCoreKeyStore.generateCSR(string, string2); + foxResponse.add("csr", nPKCS10CertificationRequest.encodeToString()); + return foxResponse; + } + + public Enumeration providerProviders() throws Exception { + FoxRequest foxRequest = this.makeRequest("provider.Providers"); + FoxResponse foxResponse = this.sendSync(foxRequest); + Vector vector = new Vector(); + String[] stringArray = foxResponse.listStrings("provider"); + int n = 0; + while (n < stringArray.length) { + vector.add(NProvider.decodeFromString((String)stringArray[n])); + ++n; + } + return vector.elements(); + } + + private final FoxResponse providerProviders(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + NProvider[] nProviderArray = NProvider.getProviders(); + int n = 0; + while (n < nProviderArray.length) { + foxResponse.add("provider", nProviderArray[n].encodeToString()); + ++n; + } + return foxResponse; + } + + public IProvider providerGetProvider(String string) throws Exception { + FoxRequest foxRequest = this.makeRequest("provider.getProvider"); + foxRequest.add("name", string); + FoxResponse foxResponse = this.sendSync(foxRequest); + return NProvider.decodeFromString((String)foxResponse.getString("provider")); + } + + private final FoxResponse providerGetProvider(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + NProvider[] nProviderArray = NProvider.getProviders(); + int n = 0; + while (n < nProviderArray.length) { + foxResponse.add("provider", nProviderArray[n].encodeToString()); + ++n; + } + return foxResponse; + } + + public Enumeration exemptionExemptions() throws Exception { + FoxRequest foxRequest = this.makeRequest("exemption.exemptions"); + FoxResponse foxResponse = this.sendSync(foxRequest); + String[] stringArray = foxResponse.listStrings("exemption"); + Class clazz = class$com$tridium$crypto$core$cert$NHostExemption; + if (clazz == null) { + clazz = class$com$tridium$crypto$core$cert$NHostExemption = BCryptoChannel.class("[Lcom.tridium.crypto.core.cert.NHostExemption;", false); + } + Array array = new Array(clazz); + int n = 0; + while (n < stringArray.length) { + array.push((Object)NHostExemption.decodeFromString((String)stringArray[n])); + ++n; + } + Enumeration enumeration = Collections.enumeration(array.list()); + return enumeration; + } + + private final FoxResponse exemptionExemptions(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreExemptionStore iCoreExemptionStore = this.service.getExemptionStore(); + Enumeration enumeration = iCoreExemptionStore.exemptions(); + while (enumeration.hasMoreElements()) { + NHostExemption nHostExemption = (NHostExemption)enumeration.nextElement(); + foxResponse.add("exemption", nHostExemption.encodeToString()); + } + return foxResponse; + } + + public void exemptionSetExemption(NHostExemption nHostExemption) throws Exception { + FoxRequest foxRequest = this.makeRequest("exemption.setExemption"); + foxRequest.add("exemption", nHostExemption.encodeToString()); + this.sendSync(foxRequest); + } + + private final FoxResponse exemptionSetExemption(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreExemptionStore iCoreExemptionStore = this.service.getExemptionStore(); + NHostExemption nHostExemption = NHostExemption.make((String)foxRequest.getString("exemption")); + iCoreExemptionStore.setExemption(nHostExemption); + return foxResponse; + } + + public void exemptionDeleteExemption(String string) throws Exception { + FoxRequest foxRequest = this.makeRequest("exemption.deleteExemption"); + foxRequest.add("host", string); + this.sendSync(foxRequest); + } + + private final FoxResponse exemptionDeleteExemption(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreExemptionStore iCoreExemptionStore = this.service.getExemptionStore(); + String string = foxRequest.getString("host"); + iCoreExemptionStore.deleteExemption(string); + return foxResponse; + } + + public NHostExemption exemptionGetExemption(String string) throws Exception { + FoxRequest foxRequest = this.makeRequest("exemption.getExemption"); + foxRequest.add("host", string); + FoxResponse foxResponse = this.sendSync(foxRequest); + String string2 = foxResponse.getString("exemption"); + NHostExemption nHostExemption = NHostExemption.make((String)string2); + return nHostExemption; + } + + private final FoxResponse exemptionGetExemption(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreExemptionStore iCoreExemptionStore = this.service.getExemptionStore(); + String string = foxRequest.getString("host"); + NHostExemption nHostExemption = iCoreExemptionStore.getExemption(string); + foxResponse.add("exemption", nHostExemption.encodeToString()); + return foxResponse; + } + + public void exemptionSave() throws Exception { + FoxRequest foxRequest = this.makeRequest("exemption.save"); + this.sendSync(foxRequest); + } + + private final FoxResponse exemptionSave(FoxRequest foxRequest) throws Exception { + FoxResponse foxResponse = new FoxResponse(foxRequest); + ICoreExemptionStore iCoreExemptionStore = this.service.getExemptionStore(); + iCoreExemptionStore.save(); + return foxResponse; + } + + private final ICoreKeyStore getCorrectKeyStore(FoxRequest foxRequest) throws Exception { + boolean bl = foxRequest.getBoolean("useTrustStore"); + if (bl) { + return this.service.getTrustStore(); + } + return this.service.getKeyStore(); + } + + public File getBaseDir() { + try { + return new File(BCryptoChannel.getFilePath(BOrd.make((String)"file:!"))); + } + catch (Exception exception) { + return Sys.getBajaHome(); + } + } + + private static final String getFilePath(BOrd bOrd) throws IOException { + OrdQuery[] ordQueryArray = bOrd.parse(); + FilePath filePath = (FilePath)ordQueryArray[ordQueryArray.length - 1]; + File file = BFileSystem.INSTANCE.pathToLocalFile(filePath); + return file.getPath(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.validChannel = false; + } + + public BCryptoChannel() { + super("crypto"); + this.this(); + } + + static { + Class clazz = class$com$tridium$platcrypto$fox$BCryptoChannel; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$fox$BCryptoChannel = BCryptoChannel.class("[Lcom.tridium.platcrypto.fox.BCryptoChannel;", false); + } + TYPE = Sys.loadType((Class)clazz); + log = Log.getLog((String)"crypto"); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/fox/ChannelBase.java b/modules/cfr_output/com/tridium/platcrypto/fox/ChannelBase.java new file mode 100644 index 0000000..11ce9c0 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/fox/ChannelBase.java @@ -0,0 +1,64 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.fox.sys.BFoxSession + * javax.baja.naming.BLocalHost + * javax.baja.security.crypto.CertManagerFactory + * javax.baja.sys.BComponent + */ +package com.tridium.platcrypto.fox; + +import com.tridium.fox.sys.BFoxSession; +import com.tridium.platcrypto.fox.BCryptoChannel; +import java.io.IOException; +import javax.baja.naming.BLocalHost; +import javax.baja.security.crypto.CertManagerFactory; +import javax.baja.sys.BComponent; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class ChannelBase { + protected BCryptoChannel channel; + private BComponent parent; + + protected void checkChannel() throws IOException { + if (!CertManagerFactory.isCertManagerActive()) { + return; + } + BFoxSession bFoxSession = (BFoxSession)this.parent.getSession(); + this.channel = (BCryptoChannel)bFoxSession.getConnection().getChannels().get("crypto", BCryptoChannel.TYPE); + if (this.channel == null) { + throw new IOException("crypto fox channel not found"); + } + } + + public boolean isSecure() { + boolean bl = false; + if (!CertManagerFactory.isCertManagerActive()) { + return false; + } + BFoxSession bFoxSession = (BFoxSession)this.parent.getSession(); + this.channel = (BCryptoChannel)bFoxSession.getConnection().getChannels().get("crypto", BCryptoChannel.TYPE); + if (this.channel != null) { + if (bFoxSession.getUseFoxs()) { + bl = true; + } else if (bFoxSession.getHost() instanceof BLocalHost) { + bl = true; + } + } + return bl; + } + + private final /* synthetic */ void this() { + this.channel = null; + this.parent = null; + } + + public ChannelBase(BComponent bComponent) { + this.this(); + this.parent = bComponent; + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/fox/ChannelCryptoManager.java b/modules/cfr_output/com/tridium/platcrypto/fox/ChannelCryptoManager.java new file mode 100644 index 0000000..d3915f0 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/fox/ChannelCryptoManager.java @@ -0,0 +1,49 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.ICoreCryptoManager + * com.tridium.crypto.core.io.ICoreExemptionStore + * com.tridium.crypto.core.io.ICoreKeyStore + * com.tridium.crypto.core.io.ICoreProviderInfo + * javax.baja.sys.BComponent + */ +package com.tridium.platcrypto.fox; + +import com.tridium.crypto.core.io.ICoreCryptoManager; +import com.tridium.crypto.core.io.ICoreExemptionStore; +import com.tridium.crypto.core.io.ICoreKeyStore; +import com.tridium.crypto.core.io.ICoreProviderInfo; +import com.tridium.platcrypto.fox.ChannelBase; +import com.tridium.platcrypto.fox.ChannelExemptionStore; +import com.tridium.platcrypto.fox.ChannelKeyStore; +import com.tridium.platcrypto.fox.ChannelProviderInfo; +import javax.baja.sys.BComponent; + +public class ChannelCryptoManager +extends ChannelBase +implements ICoreCryptoManager { + private BComponent parent; + + public ICoreKeyStore getKeyStore() throws Exception { + return new ChannelKeyStore(this.parent, false); + } + + public ICoreKeyStore getTrustStore() throws Exception { + return new ChannelKeyStore(this.parent, true); + } + + public ICoreExemptionStore getExemptionStore() throws Exception { + return new ChannelExemptionStore(this.parent); + } + + public ICoreProviderInfo getProviderInfo() throws Exception { + return new ChannelProviderInfo(this.parent); + } + + public ChannelCryptoManager(BComponent bComponent) { + super(bComponent); + this.parent = bComponent; + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/fox/ChannelExemptionStore.java b/modules/cfr_output/com/tridium/platcrypto/fox/ChannelExemptionStore.java new file mode 100644 index 0000000..a01ac27 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/fox/ChannelExemptionStore.java @@ -0,0 +1,58 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NHostExemption + * com.tridium.crypto.core.io.ICoreExemptionStore + * javax.baja.sys.BComponent + */ +package com.tridium.platcrypto.fox; + +import com.tridium.crypto.core.cert.NHostExemption; +import com.tridium.crypto.core.io.ICoreExemptionStore; +import com.tridium.platcrypto.fox.ChannelBase; +import java.util.Enumeration; +import javax.baja.sys.BComponent; + +public class ChannelExemptionStore +extends ChannelBase +implements ICoreExemptionStore { + public Enumeration exemptions() throws Exception { + this.checkChannel(); + return this.channel.exemptionExemptions(); + } + + public void setExemption(NHostExemption nHostExemption) throws Exception { + this.checkChannel(); + this.channel.exemptionSetExemption(nHostExemption); + } + + public void deleteExemption(String string) throws Exception { + this.checkChannel(); + this.channel.exemptionDeleteExemption(string); + } + + public NHostExemption getExemption(String string) throws Exception { + this.checkChannel(); + return this.channel.exemptionGetExemption(string); + } + + public long getLastModified() throws Exception { + this.checkChannel(); + return 0L; + } + + public void load() throws Exception { + this.checkChannel(); + } + + public void save() throws Exception { + this.checkChannel(); + this.channel.exemptionSave(); + } + + public ChannelExemptionStore(BComponent bComponent) { + super(bComponent); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/fox/ChannelKeyStore.java b/modules/cfr_output/com/tridium/platcrypto/fox/ChannelKeyStore.java new file mode 100644 index 0000000..ded528f --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/fox/ChannelKeyStore.java @@ -0,0 +1,174 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.CertUtils + * com.tridium.crypto.core.cert.NPKCS10CertificationRequest + * com.tridium.crypto.core.io.ICoreKeyStore + * javax.baja.log.Log + * javax.baja.security.crypto.IKeyStore + * javax.baja.sys.BComponent + */ +package com.tridium.platcrypto.fox; + +import com.tridium.crypto.core.cert.CertUtils; +import com.tridium.crypto.core.cert.NPKCS10CertificationRequest; +import com.tridium.crypto.core.io.ICoreKeyStore; +import com.tridium.platcrypto.fox.ChannelBase; +import java.security.Key; +import java.security.KeyStore; +import java.security.cert.X509Certificate; +import java.util.Date; +import java.util.Enumeration; +import javax.baja.log.Log; +import javax.baja.security.crypto.IKeyStore; +import javax.baja.sys.BComponent; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class ChannelKeyStore +extends ChannelBase +implements IKeyStore, +ICoreKeyStore { + protected static Log log = Log.getLog((String)"crypto"); + private boolean isTrustStore; + + public Enumeration aliases() throws Exception { + this.checkChannel(); + return this.channel.keyStoreAliases(this.isTrustStore); + } + + public boolean containsAlias(String string) throws Exception { + this.checkChannel(); + return this.channel.keyStoreContainsAlias(this.isTrustStore, string); + } + + public void deleteEntry(String string) throws Exception { + this.checkChannel(); + this.channel.keyStoreDeleteEntry(this.isTrustStore, string); + } + + public X509Certificate getCertificate(String string) throws Exception { + this.checkChannel(); + return this.channel.keyStoreGetCertificate(this.isTrustStore, string); + } + + public String getCertificateAlias(X509Certificate x509Certificate) throws Exception { + this.checkChannel(); + return this.channel.keyStoreGetCertificateAlias(this.isTrustStore, x509Certificate); + } + + public X509Certificate[] getCertificateChain(String string) throws Exception { + this.checkChannel(); + return this.channel.keyStoreGetCertificateChain(this.isTrustStore, string); + } + + public Date getCreationDate(String string) throws Exception { + this.checkChannel(); + return this.channel.keyStoreGetCreationDate(this.isTrustStore, string); + } + + public Key getKey(String string, char[] cArray) throws Exception { + this.checkChannel(); + return this.channel.keyStoreGetKey(this.isTrustStore, string, cArray); + } + + public boolean isCertificateEntry(String string) throws Exception { + this.checkChannel(); + return this.channel.keyStoreIsCertificateEntry(this.isTrustStore, string); + } + + public boolean isKeyEntry(String string) throws Exception { + this.checkChannel(); + return this.channel.keyStoreIsKeyEntry(this.isTrustStore, string); + } + + public void setCertificateEntry(String string, X509Certificate x509Certificate) throws Exception { + this.checkChannel(); + this.channel.keyStoreSetCertificateEntry(this.isTrustStore, string, x509Certificate); + } + + public void setKeyEntry(String string, byte[] byArray, X509Certificate[] x509CertificateArray) throws Exception { + this.checkChannel(); + this.channel.keyStoreSetKeyEntry0(this.isTrustStore, string, byArray, x509CertificateArray); + } + + public void setKeyEntry(String string, Key key, char[] cArray, X509Certificate[] x509CertificateArray) throws Exception { + this.checkChannel(); + this.channel.keyStoreSetKeyEntry1(this.isTrustStore, string, key, cArray, x509CertificateArray); + } + + public int size() throws Exception { + this.checkChannel(); + return this.channel.keyStoreSize(this.isTrustStore); + } + + public long getLastModified() throws Exception { + this.checkChannel(); + return 0L; + } + + public void load() throws Exception { + this.checkChannel(); + } + + public void save() throws Exception { + this.checkChannel(); + this.channel.keyStoreSave(this.isTrustStore); + } + + public Enumeration getCertificates() throws Exception { + this.checkChannel(); + return this.channel.keyStoreGetCertificates(this.isTrustStore); + } + + public String findCertificate(X509Certificate x509Certificate) throws Exception { + this.checkChannel(); + return this.channel.keyStoreFindCertificate(this.isTrustStore, x509Certificate); + } + + public void deleteEntries(String[] stringArray) throws Exception { + this.checkChannel(); + this.channel.keyStoreDeleteEntries(this.isTrustStore, stringArray); + } + + public KeyStore getKeyStore() throws Exception { + throw new UnsupportedOperationException("can't access raw keystore remotely"); + } + + public int generateSelfSignedCert(String string, String string2, String string3, String string4, String string5, String string6, String string7, Date date, Date date2, int n, int n2, String string8, String string9) throws Exception { + this.checkChannel(); + String string10 = CertUtils.assembleDN((String)string2, (String)string3, (String)string4, (String)string5, (String)string6, (String)string7); + return this.channel.keyStoreGenerateSelfSignedCert(this.isTrustStore, string, string10, date, date2, n, n2, string8, string9); + } + + public int generateSelfSignedCert(String string, String string2, Date date, Date date2, int n, int n2, String string3, String string4) throws Exception { + this.checkChannel(); + return this.channel.keyStoreGenerateSelfSignedCert(this.isTrustStore, string, string2, date, date2, n, n2, string3, string4); + } + + public int getCertGenerationStatus(int n) throws Exception { + return this.channel.keyGetCertGenerationStatus(this.isTrustStore, n); + } + + public NPKCS10CertificationRequest generateCSR(String string, String string2) throws Exception { + this.checkChannel(); + return this.channel.keyStoreGenerateCSR(this.isTrustStore, string, string2); + } + + public boolean canGenerateCertificate() { + return true; + } + + private final /* synthetic */ void this() { + this.isTrustStore = false; + } + + public ChannelKeyStore(BComponent bComponent, boolean bl) { + super(bComponent); + this.this(); + this.isTrustStore = bl; + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/fox/ChannelProviderInfo.java b/modules/cfr_output/com/tridium/platcrypto/fox/ChannelProviderInfo.java new file mode 100644 index 0000000..ec40782 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/fox/ChannelProviderInfo.java @@ -0,0 +1,36 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.ICoreProviderInfo + * com.tridium.crypto.core.provider.IProvider + * javax.baja.sys.BComponent + */ +package com.tridium.platcrypto.fox; + +import com.tridium.crypto.core.io.ICoreProviderInfo; +import com.tridium.crypto.core.provider.IProvider; +import com.tridium.platcrypto.core.IProviderInfo; +import com.tridium.platcrypto.fox.ChannelBase; +import java.util.Enumeration; +import javax.baja.sys.BComponent; + +public class ChannelProviderInfo +extends ChannelBase +implements IProviderInfo, +ICoreProviderInfo { + public Enumeration providers() throws Exception { + this.checkChannel(); + return this.channel.providerProviders(); + } + + public IProvider getProvider(String string) throws Exception { + this.checkChannel(); + return this.channel.providerGetProvider(string); + } + + public ChannelProviderInfo(BComponent bComponent) { + super(bComponent); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/fox/ui/BFoxSCnxHandler.java b/modules/cfr_output/com/tridium/platcrypto/fox/ui/BFoxSCnxHandler.java new file mode 100644 index 0000000..bdba463 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/fox/ui/BFoxSCnxHandler.java @@ -0,0 +1,102 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.fox.sys.BFoxsScheme$FoxQuery + * com.tridium.workbench.nav.BFoxCnxHandler + * com.tridium.workbench.ord.BFoxsSessionOrdFE + * com.tridium.workbench.ord.BHostOrdFE + * javax.baja.naming.BOrd + * javax.baja.naming.OrdQuery + * javax.baja.security.BICredentials + * javax.baja.security.BUsernameAndPassword + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.fox.ui; + +import com.tridium.fox.sys.BFoxsScheme; +import com.tridium.workbench.nav.BFoxCnxHandler; +import com.tridium.workbench.ord.BFoxsSessionOrdFE; +import com.tridium.workbench.ord.BHostOrdFE; +import javax.baja.naming.BOrd; +import javax.baja.naming.OrdQuery; +import javax.baja.security.BICredentials; +import javax.baja.security.BUsernameAndPassword; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxSCnxHandler +extends BFoxCnxHandler { + public static final Type TYPE; + private static final String KEY = "open.ssl.station"; + static /* synthetic */ Class class$com$tridium$platcrypto$fox$ui$BFoxSCnxHandler; + + public Type getType() { + return TYPE; + } + + protected void saveHostAddress() throws Exception { + this.ordFE.setAutoSaveHistory(false); + BOrd bOrd = (BOrd)this.ordFE.saveValue(); + OrdQuery[] ordQueryArray = bOrd.parse(); + this.hostOrd = BOrd.make((OrdQuery)ordQueryArray[0]); + int n = this.defaultPort; + String[] stringArray = null; + int n2 = 1; + while (n2 < ordQueryArray.length) { + if (ordQueryArray[n2] instanceof BFoxsScheme.FoxQuery) { + BFoxsScheme.FoxQuery foxQuery = (BFoxsScheme.FoxQuery)ordQueryArray[n2]; + n = foxQuery.getPort(); + stringArray = foxQuery.getTunnelAuthorities(); + break; + } + ++n2; + } + this.port = n; + this.tunnelAuthorities = stringArray; + } + + public boolean isSecure() { + return true; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BFoxSCnxHandler() { + super("foxs", 4911, (BHostOrdFE)new BFoxsSessionOrdFE(), (BICredentials)new BUsernameAndPassword(), TYPE.getModule().getLexicon(), KEY); + } + + public BFoxSCnxHandler(Lexicon lexicon, String string) { + super("foxs", 4911, (BHostOrdFE)new BFoxsSessionOrdFE(), (BICredentials)new BUsernameAndPassword(), lexicon, string); + } + + public BFoxSCnxHandler(String string, int n, BHostOrdFE bHostOrdFE, BICredentials bICredentials, Lexicon lexicon, String string2) { + super(string, n, bHostOrdFE, bICredentials, lexicon, string2); + } + + static { + Class clazz = class$com$tridium$platcrypto$fox$ui$BFoxSCnxHandler; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$fox$ui$BFoxSCnxHandler = BFoxSCnxHandler.class("[Lcom.tridium.platcrypto.fox.ui.BFoxSCnxHandler;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/fox/ui/BFoxSslSessionAgent.java b/modules/cfr_output/com/tridium/platcrypto/fox/ui/BFoxSslSessionAgent.java new file mode 100644 index 0000000..049e490 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/fox/ui/BFoxSslSessionAgent.java @@ -0,0 +1,73 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.fox.sys.BFoxSession + * com.tridium.workbench.nav.BFoxSessionAgent + * javax.baja.naming.BHost + * javax.baja.naming.BISession + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.platcrypto.fox.ui; + +import com.tridium.fox.sys.BFoxSession; +import com.tridium.workbench.nav.BFoxSessionAgent; +import javax.baja.naming.BHost; +import javax.baja.naming.BISession; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFoxSslSessionAgent +extends BFoxSessionAgent { + public static final BFoxSslSessionAgent INSTANCE = new BFoxSslSessionAgent(); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platcrypto$fox$ui$BFoxSslSessionAgent; + + public Type getType() { + return TYPE; + } + + public void pickle(BISession bISession, XElem xElem) { + BFoxSession bFoxSession = (BFoxSession)bISession; + xElem.addAttr("port", "" + bFoxSession.getPort()); + xElem.addAttr("useFoxs", "true"); + if (bFoxSession.getStationName() != null) { + xElem.addAttr("stationName", bFoxSession.getStationName()); + } + } + + public BISession unpickle(BHost bHost, XElem xElem) { + int n = xElem.geti("port", 4911); + String string = xElem.get("stationName", null); + boolean bl = xElem.getb("useFoxs", true); + return BFoxSession.make((String)string, (BHost)bHost, (int)n, (boolean)true); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$platcrypto$fox$ui$BFoxSslSessionAgent; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$fox$ui$BFoxSslSessionAgent = BFoxSslSessionAgent.class("[Lcom.tridium.platcrypto.fox.ui.BFoxSslSessionAgent;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/socket/CryptoClientNoArgSocketFactory.java b/modules/cfr_output/com/tridium/platcrypto/socket/CryptoClientNoArgSocketFactory.java new file mode 100644 index 0000000..97b66b8 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/socket/CryptoClientNoArgSocketFactory.java @@ -0,0 +1,24 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.nre.security.ISecurityInfoProvider + */ +package com.tridium.platcrypto.socket; + +import com.tridium.nre.security.ISecurityInfoProvider; +import com.tridium.platcrypto.socket.CryptoClientSocketFactory; + +public abstract class CryptoClientNoArgSocketFactory +extends CryptoClientSocketFactory { + private static ISecurityInfoProvider secInfo = null; + + public static void setBaseDir(ISecurityInfoProvider iSecurityInfoProvider) throws Exception { + secInfo = iSecurityInfoProvider; + } + + public CryptoClientNoArgSocketFactory(String string) throws Exception { + super(secInfo, string); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/socket/CryptoClientSocketFactory.java b/modules/cfr_output/com/tridium/platcrypto/socket/CryptoClientSocketFactory.java new file mode 100644 index 0000000..18fbfaf --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/socket/CryptoClientSocketFactory.java @@ -0,0 +1,29 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.CryptoCoreClientSocketFactory + * com.tridium.crypto.core.util.ILogger + * com.tridium.nre.security.ISecurityInfoProvider + * javax.baja.io.net.IClientSocketFactory + * javax.baja.log.Log + */ +package com.tridium.platcrypto.socket; + +import com.tridium.crypto.core.io.CryptoCoreClientSocketFactory; +import com.tridium.crypto.core.util.ILogger; +import com.tridium.nre.security.ISecurityInfoProvider; +import com.tridium.platcrypto.util.Logger; +import javax.baja.io.net.IClientSocketFactory; +import javax.baja.log.Log; + +public class CryptoClientSocketFactory +extends CryptoCoreClientSocketFactory +implements IClientSocketFactory { + private static ILogger log = new Logger(Log.getLog((String)"crypto")); + + public CryptoClientSocketFactory(ISecurityInfoProvider iSecurityInfoProvider, String string) throws Exception { + super(iSecurityInfoProvider, string, log); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/socket/CryptoClientTlsSocketFactory.java b/modules/cfr_output/com/tridium/platcrypto/socket/CryptoClientTlsSocketFactory.java new file mode 100644 index 0000000..deae4a9 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/socket/CryptoClientTlsSocketFactory.java @@ -0,0 +1,30 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.security.crypto.BTlsEnum + */ +package com.tridium.platcrypto.socket; + +import com.tridium.platcrypto.socket.CryptoClientNoArgSocketFactory; +import javax.baja.security.crypto.BTlsEnum; +import javax.net.SocketFactory; +import javax.net.ssl.SSLSocketFactory; + +public final class CryptoClientTlsSocketFactory +extends CryptoClientNoArgSocketFactory { + public static final SocketFactory getDefault() { + try { + return new CryptoClientTlsSocketFactory(); + } + catch (Exception exception) { + exception.printStackTrace(); + return SSLSocketFactory.getDefault(); + } + } + + public CryptoClientTlsSocketFactory() throws Exception { + super(BTlsEnum.DEFAULT.getTag()); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/socket/CryptoServerSocketFactory.java b/modules/cfr_output/com/tridium/platcrypto/socket/CryptoServerSocketFactory.java new file mode 100644 index 0000000..3e9079d --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/socket/CryptoServerSocketFactory.java @@ -0,0 +1,29 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.CryptoCoreServerSocketFactory + * com.tridium.crypto.core.util.ILogger + * com.tridium.nre.security.ISecurityInfoProvider + * javax.baja.io.net.IServerSocketFactory + * javax.baja.log.Log + */ +package com.tridium.platcrypto.socket; + +import com.tridium.crypto.core.io.CryptoCoreServerSocketFactory; +import com.tridium.crypto.core.util.ILogger; +import com.tridium.nre.security.ISecurityInfoProvider; +import com.tridium.platcrypto.util.Logger; +import javax.baja.io.net.IServerSocketFactory; +import javax.baja.log.Log; + +public class CryptoServerSocketFactory +extends CryptoCoreServerSocketFactory +implements IServerSocketFactory { + private static ILogger log = new Logger(Log.getLog((String)"crypto")); + + public CryptoServerSocketFactory(ISecurityInfoProvider iSecurityInfoProvider, String string, boolean bl, String string2) throws Exception { + super(iSecurityInfoProvider, string, string2, log); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/socket/CryptoWbAppletClientSocketFactory.java b/modules/cfr_output/com/tridium/platcrypto/socket/CryptoWbAppletClientSocketFactory.java new file mode 100644 index 0000000..f5eeb63 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/socket/CryptoWbAppletClientSocketFactory.java @@ -0,0 +1,29 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.CryptoSupport + */ +package com.tridium.platcrypto.socket; + +import com.tridium.crypto.core.io.CryptoSupport; +import com.tridium.platcrypto.socket.CryptoClientSocketFactory; +import com.tridium.platcrypto.util.TridiumAppletX509TrustManager; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; + +public class CryptoWbAppletClientSocketFactory +extends CryptoClientSocketFactory { + protected SSLContext createSSLContext(String string) throws Exception { + SSLContext sSLContext = SSLContext.getInstance(CryptoSupport.getProtocolName((String)string)); + this.trustMgr = new TridiumAppletX509TrustManager(); + TrustManager[] trustManagerArray = new TrustManager[]{this.trustMgr}; + sSLContext.init(null, trustManagerArray, null); + return sSLContext; + } + + public CryptoWbAppletClientSocketFactory(String string) throws Exception { + super(null, string); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/socket/CryptoWbClientSocketFactory.java b/modules/cfr_output/com/tridium/platcrypto/socket/CryptoWbClientSocketFactory.java new file mode 100644 index 0000000..0f1ff64 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/socket/CryptoWbClientSocketFactory.java @@ -0,0 +1,37 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.CoreCryptoManager + * com.tridium.crypto.core.io.CryptoSupport + * com.tridium.nre.security.ISecurityInfoProvider + * com.tridium.sys.Nre + */ +package com.tridium.platcrypto.socket; + +import com.tridium.crypto.core.io.CoreCryptoManager; +import com.tridium.crypto.core.io.CryptoSupport; +import com.tridium.nre.security.ISecurityInfoProvider; +import com.tridium.platcrypto.socket.CryptoClientSocketFactory; +import com.tridium.platcrypto.ui.TridiumUIX509TrustManager; +import com.tridium.sys.Nre; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; + +public class CryptoWbClientSocketFactory +extends CryptoClientSocketFactory { + protected SSLContext createSSLContext(String string) throws Exception { + SSLContext sSLContext = SSLContext.getInstance(CryptoSupport.getProtocolName((String)string)); + CoreCryptoManager coreCryptoManager = CoreCryptoManager.get((ISecurityInfoProvider)Nre.getSecurityInfoProvider()); + this.trustMgr = new TridiumUIX509TrustManager(Nre.getSecurityInfoProvider()); + TrustManager[] trustManagerArray = new X509TrustManager[]{this.trustMgr}; + sSLContext.init(null, trustManagerArray, null); + return sSLContext; + } + + public CryptoWbClientSocketFactory(ISecurityInfoProvider iSecurityInfoProvider, String string) throws Exception { + super(iSecurityInfoProvider, string); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/spy/CryptoPlatformPage.java b/modules/cfr_output/com/tridium/platcrypto/spy/CryptoPlatformPage.java new file mode 100644 index 0000000..bac3cef --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/spy/CryptoPlatformPage.java @@ -0,0 +1,175 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.crypto.core.cert.NX509CertificateEntry + * com.tridium.crypto.core.io.CryptoSupport + * com.tridium.crypto.core.provider.IProvider + * com.tridium.crypto.core.provider.IProviderEntry + * com.tridium.crypto.core.provider.IProviderSection + * com.tridium.nre.security.SecurityInitializer + * javax.baja.security.crypto.CertManagerFactory + * javax.baja.security.crypto.IKeyStore + * javax.baja.spy.Spy + * javax.baja.spy.SpyDir + * javax.baja.spy.SpyWriter + */ +package com.tridium.platcrypto.spy; + +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.crypto.core.cert.NX509CertificateEntry; +import com.tridium.crypto.core.io.CryptoSupport; +import com.tridium.crypto.core.provider.IProvider; +import com.tridium.crypto.core.provider.IProviderEntry; +import com.tridium.crypto.core.provider.IProviderSection; +import com.tridium.nre.security.SecurityInitializer; +import com.tridium.platcrypto.core.IExtCryptoManager; +import java.security.cert.Certificate; +import java.security.cert.X509Certificate; +import java.util.Enumeration; +import javax.baja.security.crypto.CertManagerFactory; +import javax.baja.security.crypto.IKeyStore; +import javax.baja.spy.Spy; +import javax.baja.spy.SpyDir; +import javax.baja.spy.SpyWriter; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class CryptoPlatformPage +extends SpyDir { + private IExtCryptoManager service; + + public void write(SpyWriter spyWriter) throws Exception { + Object object; + Object object2; + String[] stringArray; + Object object3; + if (this.service == null) { + this.service = (IExtCryptoManager)CertManagerFactory.getInstanceEx(); + } + try { + object3 = this.service.getTrustStore(); + if (object3 != null) { + stringArray = object3.aliases(); + while (stringArray.hasMoreElements()) { + String string = (String)stringArray.nextElement(); + object2 = object3.getCertificate(string); + if (!((Certificate)object2).getType().equals("X.509")) continue; + object = NX509CertificateEntry.make((String)string, (X509Certificate[])new X509Certificate[]{object2}, null); + this.add(string, (Spy)new CertificatePage((NX509CertificateEntry)object)); + } + } + } + catch (Exception exception) {} + spyWriter.startProps("FIPS"); + spyWriter.prop((Object)"fips mode", (Object)(SecurityInitializer.isFips() ? "ON" : "OFF")); + spyWriter.endProps(); + spyWriter.startTable(false); + spyWriter.trTitle((Object)"Providers", 3); + spyWriter.w((Object)"").th((Object)"Provider").th((Object)"Version").th((Object)"Description").w((Object)"\n"); + object3 = this.service.getProviderInfo().providers(); + while (object3.hasMoreElements()) { + stringArray = (IProvider)object3.nextElement(); + this.add(stringArray.getName(), (Spy)new ProviderPage((IProvider)stringArray)); + spyWriter.w((Object)"").a(stringArray.getName()).w((Object)"").td((Object)("" + stringArray.getVersion())).w((Object)("" + stringArray.getDescription() + "")).w((Object)""); + } + spyWriter.endTable(); + spyWriter.startProps("Supported Ciphers"); + stringArray = CryptoSupport.getSupportedCiphers(); + int n = 0; + while (n < stringArray.length) { + spyWriter.prop((Object)stringArray[n], (Object)""); + ++n; + } + spyWriter.endProps(); + IKeyStore iKeyStore = this.service.getTrustStore(); + if (iKeyStore != null) { + spyWriter.startTable(false); + spyWriter.trTitle((Object)"Trusted Certificates", 4); + spyWriter.w((Object)"").th((Object)"Alias").th((Object)"Issued To").th((Object)"Issued By").th((Object)"Expires").w((Object)"\n"); + object2 = iKeyStore.aliases(); + while (object2.hasMoreElements()) { + object = (String)object2.nextElement(); + X509Certificate x509Certificate = iKeyStore.getCertificate((String)object); + if (!x509Certificate.getType().equals("X.509")) continue; + NX509Certificate nX509Certificate = NX509Certificate.make((X509Certificate)x509Certificate); + spyWriter.w((Object)"").a((String)object).w((Object)"").td(object).td((Object)nX509Certificate.getIssuer()).td((Object)nX509Certificate.getNotAfter()).w((Object)""); + } + spyWriter.endTable(); + } + } + + private final /* synthetic */ void this() { + this.service = null; + } + + public CryptoPlatformPage() { + this.this(); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class CertificatePage + extends SpyDir { + private NX509CertificateEntry cert; + + public void write(SpyWriter spyWriter) throws Exception { + if (CryptoPlatformPage.this.service == null) { + CryptoPlatformPage.this.service = (IExtCryptoManager)CertManagerFactory.getInstanceEx(); + } + spyWriter.startProps(this.cert.getAlias()); + spyWriter.prop((Object)"Version", (Object)("v" + this.cert.getCertificate(0).getVersion())); + spyWriter.prop((Object)"Serial Number", (Object)this.cert.getCertificate(0).getSerialNumber()); + spyWriter.prop((Object)"Issued By", (Object)this.cert.getCertificate(0).getIssuer()); + spyWriter.prop((Object)"Subject", (Object)this.cert.getCertificate(0).getSubject()); + spyWriter.prop((Object)"Not Before", (Object)this.cert.getCertificate(0).getNotBefore()); + spyWriter.prop((Object)"Not After", (Object)this.cert.getCertificate(0).getNotAfter()); + spyWriter.prop((Object)"Signature Algorithm", (Object)this.cert.getCertificate(0).getSignatureAlgorithm()); + spyWriter.prop((Object)"Basic Constraints", (Object)this.cert.getCertificate(0).getBasicConstraints()); + spyWriter.prop((Object)"Key Usage", (Object)this.cert.getCertificate(0).getKeyUsage()); + spyWriter.prop((Object)"Extended Key Usage", (Object)this.cert.getCertificate(0).getExtendedKeyUsage()); + spyWriter.prop((Object)"MD5 Fingerprint", (Object)this.cert.getCertificate(0).getMD5Fingerprint()); + spyWriter.prop((Object)"SHA1 Fingerprint", (Object)this.cert.getCertificate(0).getSHA1Fingerprint()); + spyWriter.endProps(); + } + + public CertificatePage(NX509CertificateEntry nX509CertificateEntry) { + this.cert = nX509CertificateEntry; + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class ProviderPage + extends SpyDir { + private IProvider provider; + + public void write(SpyWriter spyWriter) throws Exception { + spyWriter.startProps("info"); + spyWriter.prop((Object)"provider", (Object)this.provider.getName()); + spyWriter.prop((Object)"name", (Object)("" + this.provider.getVersion())); + spyWriter.prop((Object)"description", (Object)this.provider.getDescription()); + spyWriter.endProps(); + Enumeration enumeration = this.provider.sections(); + while (enumeration.hasMoreElements()) { + IProviderSection iProviderSection = (IProviderSection)enumeration.nextElement(); + spyWriter.startProps(iProviderSection.getName()); + Enumeration enumeration2 = iProviderSection.entries(); + while (enumeration2.hasMoreElements()) { + IProviderEntry iProviderEntry = (IProviderEntry)enumeration2.nextElement(); + spyWriter.prop((Object)iProviderEntry.getKey(), (Object)iProviderEntry.getValue()); + } + spyWriter.endProps(); + } + } + + public ProviderPage(IProvider iProvider) { + this.provider = iProvider; + } + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BCertEntryViewDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BCertEntryViewDialog.java new file mode 100644 index 0000000..2fbf1ac --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BCertEntryViewDialog.java @@ -0,0 +1,82 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509CertificateEntry + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BWidget + * javax.baja.ui.wizard.BWizardHeader + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NX509CertificateEntry; +import com.tridium.platcrypto.ui.BCertViewDialog; +import com.tridium.platcrypto.ui.BX509CertificatePane; +import java.util.Properties; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BWidget; +import javax.baja.ui.wizard.BWizardHeader; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BCertEntryViewDialog +extends BCertViewDialog { + public static final Type TYPE; + private NX509CertificateEntry entry; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BCertEntryViewDialog; + + public Type getType() { + return TYPE; + } + + public static void show(BWidget bWidget, NX509CertificateEntry nX509CertificateEntry) throws Exception { + BCertEntryViewDialog bCertEntryViewDialog = new BCertEntryViewDialog(bWidget, nX509CertificateEntry); + bCertEntryViewDialog.setBoundsCenteredOnOwner(); + bCertEntryViewDialog.setResizable(false); + bCertEntryViewDialog.open(); + } + + protected BWidget buildHeader() { + return new BWizardHeader(logo, this.entry.getAlias(), lex.getText("cert.view.dialog.info", new Object[]{this.cert.getSubject()})); + } + + protected BWidget buildProperties() { + Properties properties = new Properties(); + properties.setProperty("cert.field.alias", this.entry.getAlias()); + BX509CertificatePane bX509CertificatePane = new BX509CertificatePane(this.cert, properties, null); + return bX509CertificatePane; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private BCertEntryViewDialog(BWidget bWidget, NX509CertificateEntry nX509CertificateEntry) throws Exception { + super(bWidget, lex.getText("cert.view.dialog.title")); + this.entry = nX509CertificateEntry; + this.cert = nX509CertificateEntry.getCertificate(0); + this.setContent(this.buildDialog()); + this.setDefaultButton(this.okButton); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BCertEntryViewDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BCertEntryViewDialog = BCertEntryViewDialog.class("[Lcom.tridium.platcrypto.ui.BCertEntryViewDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BCertExportDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BCertExportDialog.java new file mode 100644 index 0000000..04e133e --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BCertExportDialog.java @@ -0,0 +1,327 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509Certificate + * javax.baja.gx.BImage + * javax.baja.gx.Size + * javax.baja.security.BPassword + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BCheckBox + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BWidgetEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.util.UiLexicon + * javax.baja.ui.wizard.BWizardHeader + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.platcrypto.ui.BCertViewDialog; +import com.tridium.platcrypto.ui.BExportResponse; +import com.tridium.platcrypto.ui.BPasswordField; +import javax.baja.gx.BImage; +import javax.baja.gx.Size; +import javax.baja.security.BPassword; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BCheckBox; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BWidgetEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.ui.wizard.BWizardHeader; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BCertExportDialog +extends BCertViewDialog { + public static final Action setModified = BCertExportDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Action cancelButtonPressed = BCertExportDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Type TYPE; + public static final int KEY_MODE_NONE = 0; + public static final int KEY_MODE_SERVER = 1; + public static final int KEY_MODE_CA = 2; + protected static BImage pkLogo; + protected BCheckBox exportCertCheckBox; + protected BCheckBox exportPkCheckBox; + protected BLabel caPasswordLbl; + protected BPasswordField caPassword; + protected BCheckBox reusePasswordCheckBox; + protected BCheckBox encryptPrivateKeyCheckBox; + protected BPasswordField exportedPassword; + protected BPasswordField exportedConfirmPassword; + protected BLabel exportedPasswordLbl; + protected BLabel exportedConfirmPasswordLbl; + protected BButton cancelButton; + protected BExportResponse closeResult; + protected int keyMode; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BCertExportDialog; + + public void setModified(BWidgetEvent bWidgetEvent) { + this.invoke(setModified, (BValue)bWidgetEvent, null); + } + + public void cancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.invoke(cancelButtonPressed, (BValue)bWidgetEvent, null); + } + + public Type getType() { + return TYPE; + } + + public static BExportResponse show(BWidget bWidget, NX509Certificate nX509Certificate, int n) throws Exception { + BCertExportDialog bCertExportDialog = new BCertExportDialog(bWidget, nX509Certificate, n); + bCertExportDialog.setBoundsCenteredOnOwner(); + bCertExportDialog.setResizable(false); + bCertExportDialog.open(); + return bCertExportDialog.getResult(); + } + + protected BWidget buildDialog() throws Exception { + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop(this.buildCertPane()); + if (this.keyMode != 0) { + bEdgePane.setCenter(this.buildKeyPane()); + } + bEdgePane.setBottom(this.buildButtons()); + return bEdgePane; + } + + protected BWidget buildCertPane() throws Exception { + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop((BWidget)new BWizardHeader(logo, lex.getText("cert.export.dialog.certificate"), "")); + BGridPane bGridPane = new BGridPane(1); + bGridPane.setHalign(BHalign.fill); + this.exportCertCheckBox = new BCheckBox(lex.getText("cert.export.cert.exportcert"), true); + bGridPane.add(null, (BValue)this.exportCertCheckBox); + this.linkTo("linkA", (BComponent)this.exportCertCheckBox, (Slot)BCheckBox.actionPerformed, (Slot)setModified); + bGridPane.add(null, (BValue)super.buildBody()); + if (this.keyMode == 0) { + bEdgePane.setCenter((BWidget)new BBorderPane((BWidget)bGridPane, 7.0, 7.0, 0.0, 17.0)); + this.exportCertCheckBox.setEnabled(false); + } else { + bEdgePane.setCenter((BWidget)new BBorderPane((BWidget)bGridPane, 7.0, 7.0, 14.0, 17.0)); + } + return bEdgePane; + } + + protected Size getCertViewSize() { + return new Size(450.0, 170.0); + } + + protected BWidget buildKeyPane() throws Exception { + BEdgePane bEdgePane; + BEdgePane bEdgePane2 = new BEdgePane(); + bEdgePane2.setTop((BWidget)new BWizardHeader(pkLogo, lex.getText("cert.export.dialog.privatekey"), "")); + BGridPane bGridPane = new BGridPane(1); + bGridPane.setHalign(BHalign.fill); + this.exportPkCheckBox = new BCheckBox(lex.getText("cert.export.cert.exportprivatekey"), false); + bGridPane.add(null, (BValue)this.exportPkCheckBox); + this.linkTo("linkB", (BComponent)this.exportPkCheckBox, (Slot)BCheckBox.actionPerformed, (Slot)setModified); + if (this.keyMode == 2) { + bEdgePane = new BEdgePane(); + this.caPasswordLbl = new BLabel(lex.getText("cert.export.password.prompt"), BHalign.left); + bEdgePane.setLeft((BWidget)this.caPasswordLbl); + this.caPasswordLbl.setEnabled(false); + this.caPassword = new BPasswordField(); + bEdgePane.setCenter((BWidget)new BBorderPane((BWidget)this.caPassword, 0.0, 0.0, 0.0, (double)5)); + this.caPassword.setEnabled(false); + bGridPane.add(null, (BValue)bEdgePane); + } + bEdgePane = new BEdgePane(); + this.encryptPrivateKeyCheckBox = new BCheckBox(lex.getText("cert.export.encryptprivatekey"), true); + bEdgePane.setTop((BWidget)this.encryptPrivateKeyCheckBox); + this.encryptPrivateKeyCheckBox.setEnabled(false); + this.linkTo("linkC", (BComponent)this.encryptPrivateKeyCheckBox, (Slot)BCheckBox.actionPerformed, (Slot)setModified); + bEdgePane.setLeft((BWidget)new BLabel(" ")); + BGridPane bGridPane2 = new BGridPane(1); + this.reusePasswordCheckBox = new BCheckBox(lex.getText("cert.export.reuse"), true); + if (this.keyMode == 2) { + bGridPane2.add(null, (BValue)this.reusePasswordCheckBox); + this.reusePasswordCheckBox.setEnabled(false); + this.linkTo("linkD", (BComponent)this.reusePasswordCheckBox, (Slot)BCheckBox.actionPerformed, (Slot)setModified); + } else { + this.reusePasswordCheckBox.setVisible(false); + this.reusePasswordCheckBox.setSelected(false); + } + BGridPane bGridPane3 = new BGridPane(2); + bGridPane3.setRowGap((double)5); + bGridPane3.setColumnGap((double)5); + bGridPane3.setColumnAlign(BHalign.left); + bGridPane3.setStretchColumn(1); + this.exportedPasswordLbl = new BLabel(lex.get("password.field.password"), BHalign.left); + bGridPane3.add(null, (BValue)this.exportedPasswordLbl); + this.exportedPasswordLbl.setEnabled(false); + this.exportedPassword = new BPasswordField(); + bGridPane3.add(null, (BValue)this.exportedPassword); + this.exportedPassword.setEnabled(false); + this.linkTo("linkE", (BComponent)this.exportedPassword, (Slot)BPasswordField.textModified, (Slot)setModified); + this.exportedConfirmPasswordLbl = new BLabel(lex.get("password.field.confirm"), BHalign.left); + bGridPane3.add(null, (BValue)this.exportedConfirmPasswordLbl); + this.exportedConfirmPasswordLbl.setEnabled(false); + this.exportedConfirmPassword = new BPasswordField(); + bGridPane3.add(null, (BValue)this.exportedConfirmPassword); + this.exportedConfirmPassword.setEnabled(false); + this.linkTo("linkF", (BComponent)this.exportedConfirmPassword, (Slot)BPasswordField.textModified, (Slot)setModified); + bGridPane2.add(null, (BValue)bGridPane3); + bEdgePane.setCenter((BWidget)bGridPane2); + bGridPane.add(null, (BValue)new BBorderPane((BWidget)bEdgePane, (double)4, 0.0, 0.0, 0.0)); + bEdgePane2.setCenter((BWidget)new BBorderPane((BWidget)bGridPane, 7.0, 7.0, 7.0, 17.0)); + return bEdgePane2; + } + + protected BWidget buildButtons() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + this.okButton = new BButton(UiLexicon.bajaui().getText("dialog.ok")); + bGridPane.add(null, (BValue)this.okButton); + this.linkTo("linkY", (BComponent)this.okButton, (Slot)BButton.actionPerformed, (Slot)okButtonPressed); + this.okButton.setEnabled(true); + this.cancelButton = new BButton(UiLexicon.bajaui().getText("dialog.cancel")); + bGridPane.add(null, (BValue)this.cancelButton); + this.linkTo("linkZ", (BComponent)this.cancelButton, (Slot)BButton.actionPerformed, (Slot)cancelButtonPressed); + this.cancelButton.setEnabled(true); + return new BBorderPane((BWidget)bGridPane, 7.0, 7.0, 10.0, 7.0); + } + + public void doSetModified(BWidgetEvent bWidgetEvent) { + if (this.exportPkCheckBox.getSelected()) { + if (this.keyMode == 2) { + this.caPasswordLbl.setEnabled(true); + this.caPassword.setEnabled(true); + } + this.encryptPrivateKeyCheckBox.setEnabled(true); + if (this.encryptPrivateKeyCheckBox.getSelected()) { + if (this.keyMode == 2) { + this.reusePasswordCheckBox.setEnabled(true); + } + if (this.reusePasswordCheckBox.getSelected()) { + this.exportedPassword.setEnabled(false); + this.exportedPasswordLbl.setEnabled(false); + this.exportedConfirmPassword.setEnabled(false); + this.exportedConfirmPasswordLbl.setEnabled(false); + this.okButton.setEnabled(true); + } else { + this.exportedPassword.setEnabled(true); + this.exportedPasswordLbl.setEnabled(true); + this.exportedConfirmPassword.setEnabled(true); + this.exportedConfirmPasswordLbl.setEnabled(true); + if (this.exportedPassword.getText().length() == 0 || this.exportedConfirmPassword.getText().length() == 0) { + this.okButton.setEnabled(false); + } else if (this.exportedPassword.getText().equals(this.exportedConfirmPassword.getText())) { + this.okButton.setEnabled(true); + } else { + this.okButton.setEnabled(false); + } + } + } else { + this.reusePasswordCheckBox.setEnabled(false); + this.exportedPassword.setEnabled(false); + this.exportedPasswordLbl.setEnabled(false); + this.exportedConfirmPassword.setEnabled(false); + this.exportedConfirmPasswordLbl.setEnabled(false); + this.okButton.setEnabled(true); + } + } else { + if (this.keyMode == 2) { + this.caPasswordLbl.setEnabled(false); + this.caPassword.setEnabled(false); + } + this.reusePasswordCheckBox.setEnabled(false); + this.encryptPrivateKeyCheckBox.setEnabled(false); + this.exportedPassword.setEnabled(false); + this.exportedPasswordLbl.setEnabled(false); + this.exportedConfirmPassword.setEnabled(false); + this.exportedConfirmPasswordLbl.setEnabled(false); + this.okButton.setEnabled(true); + } + if (!this.exportPkCheckBox.getSelected() && !this.exportCertCheckBox.getSelected()) { + this.okButton.setEnabled(false); + } + } + + public void doOkButtonPressed(BWidgetEvent bWidgetEvent) { + switch (this.keyMode) { + case 2: { + this.closeResult = BExportResponse.make(this.exportCertCheckBox.getSelected(), this.exportPkCheckBox.getSelected(), BPassword.make((String)this.caPassword.getText()), this.encryptPrivateKeyCheckBox.getSelected(), this.reusePasswordCheckBox.getSelected(), BPassword.make((String)this.exportedPassword.getText())); + break; + } + case 1: { + this.closeResult = BExportResponse.make(this.exportCertCheckBox.getSelected(), this.exportPkCheckBox.getSelected(), BPassword.DEFAULT, this.encryptPrivateKeyCheckBox.getSelected(), this.reusePasswordCheckBox.getSelected(), BPassword.make((String)this.exportedPassword.getText())); + break; + } + default: { + this.closeResult = BExportResponse.make(this.exportCertCheckBox.getSelected(), false, BPassword.DEFAULT, false, false, BPassword.DEFAULT); + } + } + this.close(); + } + + public void doCancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.closeResult = null; + this.close(); + } + + public BExportResponse getResult() { + return this.closeResult; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.closeResult = null; + this.keyMode = 0; + } + + protected BCertExportDialog(BWidget bWidget, NX509Certificate nX509Certificate, int n) throws Exception { + super(bWidget, lex.getText("cert.export.dialog.title")); + this.this(); + this.cert = nX509Certificate; + this.keyMode = n; + this.setContent(this.buildDialog()); + this.setDefaultButton(this.okButton); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BCertExportDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BCertExportDialog = BCertExportDialog.class("[Lcom.tridium.platcrypto.ui.BCertExportDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + pkLogo = BImage.make((String)lex.get("key.x32.icon", "module://icons/x32/lock.png")); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BCertImportDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BCertImportDialog.java new file mode 100644 index 0000000..7249f5e --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BCertImportDialog.java @@ -0,0 +1,192 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509Certificate + * javax.baja.gx.BImage + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BTextField + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BWidgetEvent + * javax.baja.ui.event.BWindowEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.util.UiLexicon + * javax.baja.ui.wizard.BWizardHeader + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.platcrypto.ui.BCertViewDialog; +import javax.baja.gx.BImage; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BTextField; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BWidgetEvent; +import javax.baja.ui.event.BWindowEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.ui.wizard.BWizardHeader; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BCertImportDialog +extends BCertViewDialog { + public static final Action cancelButtonPressed = BCertImportDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Action setModified = BCertImportDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Type TYPE; + static final BImage logo; + private BButton cancelButton; + private BTextField aliasTextField; + private String alias; + private boolean readonly; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BCertImportDialog; + + public void cancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.invoke(cancelButtonPressed, (BValue)bWidgetEvent, null); + } + + public void setModified(BWidgetEvent bWidgetEvent) { + this.invoke(setModified, (BValue)bWidgetEvent, null); + } + + public Type getType() { + return TYPE; + } + + public static String prompt(BWidget bWidget, NX509Certificate nX509Certificate, String string, boolean bl) throws Exception { + BCertImportDialog bCertImportDialog = new BCertImportDialog(bWidget, nX509Certificate, string, bl); + bCertImportDialog.setBoundsCenteredOnOwner(); + bCertImportDialog.setResizable(false); + bCertImportDialog.open(); + return bCertImportDialog.getAlias(); + } + + protected BWidget buildHeader() { + return new BWizardHeader(logo, this.getTitle(), lex.getText("cert.import.dialog.info", new Object[]{this.cert.getSubject()})); + } + + protected BWidget buildContent() throws Exception { + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop(this.buildAliasPrompt()); + bEdgePane.setCenter(super.buildContent()); + return bEdgePane; + } + + private final BWidget buildAliasPrompt() { + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setLeft(BCertImportDialog.createPaddedLabel(lex.getText("cert.field.aliasPrompt"))); + this.aliasTextField = new BTextField(this.alias == null ? "" : this.alias, 30, true); + bEdgePane.setCenter((BWidget)this.aliasTextField); + this.aliasTextField.setEditable(this.readonly ^ true); + this.linkTo(null, (BComponent)this.aliasTextField, (Slot)BTextField.textModified, (Slot)setModified); + BBorderPane bBorderPane = new BBorderPane((BWidget)bEdgePane, 20.0, 20.0, 20.0, 0.0); + return bBorderPane; + } + + protected BWidget buildButtons() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + this.okButton = new BButton(UiLexicon.bajaui().getText("dialog.ok")); + bGridPane.add(null, (BValue)this.okButton); + this.linkTo("linkA", (BComponent)this.okButton, (Slot)BButton.actionPerformed, (Slot)okButtonPressed); + this.okButton.setEnabled(true); + this.cancelButton = new BButton(UiLexicon.bajaui().getText("dialog.cancel")); + bGridPane.add(null, (BValue)this.cancelButton); + this.linkTo("linkB", (BComponent)this.cancelButton, (Slot)BButton.actionPerformed, (Slot)cancelButtonPressed); + this.cancelButton.setEnabled(true); + return new BBorderPane((BWidget)bGridPane, 7.0, 0.0, 0.0, 0.0); + } + + public void windowClosing(BWindowEvent bWindowEvent) { + this.close(); + } + + public String getAlias() { + return this.alias; + } + + public void doOkButtonPressed(BWidgetEvent bWidgetEvent) { + this.close(); + this.alias = this.aliasTextField.getText(); + } + + public void doCancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.close(); + this.alias = null; + } + + public void doSetModified(BWidgetEvent bWidgetEvent) { + try { + if (this.aliasTextField.getText().length() > 0) { + this.okButton.setEnabled(true); + } else { + this.okButton.setEnabled(false); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.alias = null; + } + + private BCertImportDialog(BWidget bWidget, NX509Certificate nX509Certificate, String string, boolean bl) throws Exception { + super(bWidget, lex.getText("cert.import.dialog.title")); + this.this(); + this.cert = nX509Certificate; + this.alias = string; + this.readonly = bl; + this.setContent(this.buildDialog()); + this.setDefaultButton(this.okButton); + if (this.aliasTextField.getText().length() > 0) { + this.okButton.setEnabled(true); + } else { + this.okButton.setEnabled(false); + } + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BCertImportDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BCertImportDialog = BCertImportDialog.class("[Lcom.tridium.platcrypto.ui.BCertImportDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + logo = BImage.make((String)lex.get("cert.x32.icon", "module://icons/x32/lock.png")); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BCertManagerTool.java b/modules/cfr_output/com/tridium/platcrypto/ui/BCertManagerTool.java new file mode 100644 index 0000000..45bc426 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BCertManagerTool.java @@ -0,0 +1,74 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.ICoreCryptoManager + * javax.baja.security.crypto.CertManagerFactory + * javax.baja.security.crypto.ICryptoManagerEx + * javax.baja.sys.BIcon + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.workbench.tool.BWbNavNodeTool + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.io.ICoreCryptoManager; +import com.tridium.platcrypto.core.ICryptoManagerProvider; +import com.tridium.platcrypto.core.IExtCryptoManager; +import javax.baja.security.crypto.CertManagerFactory; +import javax.baja.security.crypto.ICryptoManagerEx; +import javax.baja.sys.BIcon; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.workbench.tool.BWbNavNodeTool; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BCertManagerTool +extends BWbNavNodeTool +implements ICryptoManagerProvider { + public static final Type TYPE; + private static final BIcon icon; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BCertManagerTool; + + public Type getType() { + return TYPE; + } + + public ICryptoManagerEx getCryptoManager() throws Exception { + return CertManagerFactory.getInstanceEx(); + } + + public ICoreCryptoManager getCoreCryptoManager() throws Exception { + IExtCryptoManager iExtCryptoManager = (IExtCryptoManager)this.getCryptoManager(); + return iExtCryptoManager.getCoreCryptoManager(); + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BCertManagerTool; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BCertManagerTool = BCertManagerTool.class("[Lcom.tridium.platcrypto.ui.BCertManagerTool;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BIcon.std((String)"files/certificate.png"); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BCertManagerView.java b/modules/cfr_output/com/tridium/platcrypto/ui/BCertManagerView.java new file mode 100644 index 0000000..aaf03a6 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BCertManagerView.java @@ -0,0 +1,241 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.CertUtils + * com.tridium.crypto.core.io.ICoreCryptoManager + * com.tridium.platform.daemon.BDaemonSession + * com.tridium.platform.ui.util.BButtonPane + * com.tridium.platform.ui.util.BCommandBoundTable + * com.tridium.ui.theme.Theme + * com.tridium.workbench.shell.BScrollingWidgetPane + * com.tridium.workbench.shell.WbMain + * javax.baja.gx.BImage + * javax.baja.gx.BInsets + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.enums.BHalign + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.pane.BTabbedPane + * javax.baja.ui.table.BTable + * javax.baja.ui.util.BTitlePane + * javax.baja.util.Lexicon + * javax.baja.util.LexiconText + * javax.baja.workbench.tool.BWbTool + * javax.baja.workbench.view.BWbComponentView + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.CertUtils; +import com.tridium.crypto.core.io.ICoreCryptoManager; +import com.tridium.platcrypto.core.BCertManagerService; +import com.tridium.platcrypto.core.ICryptoManagerProvider; +import com.tridium.platcrypto.daemon.BPlatCryptoManager; +import com.tridium.platcrypto.ui.BCertsTable; +import com.tridium.platcrypto.ui.BExemptionTable; +import com.tridium.platcrypto.ui.BLocalCertsTable; +import com.tridium.platcrypto.ui.BTrustCertsTable; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.ui.util.BButtonPane; +import com.tridium.platform.ui.util.BCommandBoundTable; +import com.tridium.ui.theme.Theme; +import com.tridium.workbench.shell.BScrollingWidgetPane; +import com.tridium.workbench.shell.WbMain; +import javax.baja.gx.BImage; +import javax.baja.gx.BInsets; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.pane.BTabbedPane; +import javax.baja.ui.table.BTable; +import javax.baja.ui.util.BTitlePane; +import javax.baja.util.Lexicon; +import javax.baja.util.LexiconText; +import javax.baja.workbench.tool.BWbTool; +import javax.baja.workbench.view.BWbComponentView; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BCertManagerView +extends BWbComponentView { + public static final Type TYPE; + private static final int BUTTONS_PER_ROW = 4; + public static final Lexicon lex; + protected BLabel titleLabel; + protected BLabel caDescription; + protected BEdgePane caCertsPane; + protected BGridPane caCertsButtons; + protected BLabel serverCertsDescription; + protected BEdgePane serverCertsPane; + protected BGridPane serverCertsButtons; + protected BEdgePane exemptionsPane; + protected BLabel exemptionsDescription; + protected BGridPane exemptionsButtons; + protected BLabel clientKeysDescription; + protected BEdgePane clientKeysPane; + protected BGridPane clientKeysButtons; + protected BTabbedPane tabbedPane; + ICoreCryptoManager mgr; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BCertManagerView; + + public Type getType() { + return TYPE; + } + + protected void doLoadValue(BObject bObject, Context context) throws Exception { + int n; + Object object; + Object object2; + String string = ""; + if (bObject instanceof ICryptoManagerProvider) { + object2 = (ICryptoManagerProvider)bObject; + this.mgr = object2.getCoreCryptoManager(); + if (bObject instanceof BCertManagerService) { + ((BCertManagerService)bObject).poll(); + } + if (object2 instanceof BWbTool) { + string = lex.get("CertManagerView.longTitle") + ' ' + WbMain.brandTitle; + } else if (object2 instanceof BComponent) { + object = ((BComponent)object2).getSession(); + string = lex.get("CertManagerView.longTitle") + " \"" + object.getHost() + '\"'; + } else { + string = lex.get("CertManagerView.shortTitle"); + } + } else if (bObject instanceof BDaemonSession) { + this.mgr = new BPlatCryptoManager((BDaemonSession)bObject); + string = lex.get("CertManagerView.longTitle") + " \"" + ((BDaemonSession)bObject).getHost() + '\"'; + } + if (!this.mgr.isSecure() && (n = BDialog.open((BWidget)this, (String)lex.getText("nonsecure.warning.dialog.title"), (Object)lex.getText("nonsecure.warning.dialog.msg"), (int)12, (BImage)BDialog.WARNING_ICON, null)) == 8) { + throw new Exception("non-secure connection aborted"); + } + if (!CertUtils.hasUnrestrictedPolicyFiles()) { + BDialog.warning((BWidget)this, (String)lex.getText("unlimited.strength.title"), (Object)lex.getText("unlimited.strength.msg")); + } + this.titleLabel.setText(string); + object2 = new BLocalCertsTable(this.mgr.getKeyStore()); + this.loadPane(this.serverCertsPane, (BCommandBoundTable)object2, this.serverCertsButtons, this.tabbedPane, "cert.view.tab.title", context); + ((BCertsTable)((Object)object2)).load(); + object = new BTrustCertsTable(this.mgr.getTrustStore()); + this.loadPane(this.caCertsPane, (BCommandBoundTable)object, this.caCertsButtons, this.tabbedPane, "cacert.view.tab.title", context); + ((BCertsTable)((Object)object)).load(); + BExemptionTable bExemptionTable = new BExemptionTable(this.mgr.getExemptionStore()); + this.loadPane(this.exemptionsPane, bExemptionTable, this.exemptionsButtons, this.tabbedPane, "exempt.view.tab.title", context); + bExemptionTable.load(); + } + + private final void loadPane(BEdgePane bEdgePane, BCommandBoundTable bCommandBoundTable, BGridPane bGridPane, BTabbedPane bTabbedPane, String string, Context context) throws Exception { + BGridPane bGridPane2 = this.buildCommandPane(bGridPane, bCommandBoundTable.getCommands()); + BTitlePane bTitlePane = BTitlePane.makePane((String)lex.getText(string), (BTable)bCommandBoundTable); + this.makeButtonBorder(bTitlePane, bGridPane2); + bEdgePane.setCenter((BWidget)new BBorderPane((BWidget)bTitlePane, BInsets.make((double)0.0, (double)7.0, (double)7.0, (double)7.0))); + this.addTab(bTabbedPane, (BWidget)bEdgePane, string, context); + } + + private final void addTab(BTabbedPane bTabbedPane, BWidget bWidget, String string, Context context) { + bTabbedPane.addPane(new BLabel(LexiconText.make((Type)TYPE, (String)string).getText(context), Theme.widget().getBoldText()), bWidget); + } + + private final void makeButtonBorder(BTitlePane bTitlePane, BGridPane bGridPane) { + BBorderPane bBorderPane = new BBorderPane((BWidget)bGridPane); + bBorderPane.setPadding(BInsets.make((double)5, (double)0.0, (double)5, (double)0.0)); + bTitlePane.setBottom((BWidget)new BScrollingWidgetPane((BWidget)bBorderPane)); + } + + private final BGridPane buildCommandPane(BGridPane bGridPane, Command[] commandArray) { + bGridPane.removeAll(); + BButtonPane bButtonPane = new BButtonPane(); + bGridPane.setColumnAlign(BHalign.center); + bGridPane.add("buttons0", (BValue)bButtonPane); + int n = 0; + while (n < commandArray.length) { + if (n > 0 && n % 4 == 0) { + bButtonPane = new BButtonPane(); + bGridPane.add("buttons" + n, (BValue)bButtonPane); + } + bButtonPane.add(commandArray[n]); + ++n; + } + return bGridPane; + } + + private final BWidget left(BWidget bWidget) { + BGridPane bGridPane = new BGridPane(1); + bGridPane.setHalign(BHalign.left); + bGridPane.setColumnAlign(BHalign.left); + bGridPane.add(null, (BValue)bWidget); + return bGridPane; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.tabbedPane = null; + this.mgr = null; + } + + public BCertManagerView() { + this.this(); + this.tabbedPane = new BTabbedPane(); + this.caCertsButtons = new BGridPane(1); + this.serverCertsButtons = new BGridPane(1); + this.exemptionsButtons = new BGridPane(1); + this.caDescription = new BLabel(lex.getText("cacert.view.tab.description"), Theme.widget().getBoldText()); + this.caCertsPane = new BEdgePane(); + this.caCertsPane.setTop((BWidget)new BBorderPane(this.left((BWidget)this.caDescription))); + this.serverCertsDescription = new BLabel(lex.getText("cert.view.tab.description"), Theme.widget().getBoldText()); + this.serverCertsPane = new BEdgePane(); + this.serverCertsPane.setTop((BWidget)new BBorderPane(this.left((BWidget)this.serverCertsDescription))); + this.exemptionsDescription = new BLabel(lex.getText("exempt.view.tab.description"), Theme.widget().getBoldText()); + this.exemptionsPane = new BEdgePane(); + this.exemptionsPane.setTop((BWidget)new BBorderPane(this.left((BWidget)this.exemptionsDescription))); + BEdgePane bEdgePane = new BEdgePane(); + this.titleLabel = new BLabel("", BHalign.left); + bEdgePane.setTop((BWidget)new BBorderPane((BWidget)this.titleLabel, 0.0, 0.0, 10.0, 0.0)); + this.titleLabel.setFont(Theme.label().getLargeBoldFont()); + bEdgePane.setCenter((BWidget)this.tabbedPane); + this.setContent((BWidget)new BBorderPane((BWidget)bEdgePane)); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BCertManagerView; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BCertManagerView = BCertManagerView.class("[Lcom.tridium.platcrypto.ui.BCertManagerView;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"platCrypto"); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BCertRequestDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BCertRequestDialog.java new file mode 100644 index 0000000..5d25c47 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BCertRequestDialog.java @@ -0,0 +1,201 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.ui.theme.custom.nss.StyleUtils + * javax.baja.gx.BImage + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BWidgetEvent + * javax.baja.ui.event.BWindowEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.style.IStylable + * javax.baja.ui.util.UiLexicon + * javax.baja.ui.wizard.BWizardHeader + * javax.baja.util.Lexicon + * org.bouncycastle.asn1.x500.X500Name + * org.bouncycastle.asn1.x500.style.BCStyle + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.platcrypto.ui.BCertViewDialog; +import com.tridium.ui.theme.custom.nss.StyleUtils; +import java.security.cert.CertificateEncodingException; +import javax.baja.gx.BImage; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BWidgetEvent; +import javax.baja.ui.event.BWindowEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.style.IStylable; +import javax.baja.ui.util.UiLexicon; +import javax.baja.ui.wizard.BWizardHeader; +import javax.baja.util.Lexicon; +import org.bouncycastle.asn1.x500.X500Name; +import org.bouncycastle.asn1.x500.style.BCStyle; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BCertRequestDialog +extends BCertViewDialog { + public static final Action cancelButtonPressed = BCertRequestDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Type TYPE; + static Lexicon lex; + static final BImage logo; + private BButton okButton; + protected BButton cancelButton; + protected boolean closeResult; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BCertRequestDialog; + + public void cancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.invoke(cancelButtonPressed, (BValue)bWidgetEvent, null); + } + + public Type getType() { + return TYPE; + } + + public static boolean request(BWidget bWidget, NX509Certificate nX509Certificate) throws Exception { + BCertRequestDialog bCertRequestDialog = new BCertRequestDialog(bWidget, nX509Certificate); + bCertRequestDialog.setBoundsCenteredOnOwner(); + bCertRequestDialog.setResizable(false); + bCertRequestDialog.open(); + return bCertRequestDialog.getResult(); + } + + protected BWidget buildHeader() { + return new BWizardHeader(logo, this.cert.getSubject(), lex.getText("csr.view.dialog.info", new Object[]{this.cert.getSubject()})); + } + + protected BWidget buildContent() throws Exception { + BEdgePane bEdgePane = new BEdgePane(); + String string = this.certCheck(); + if (string != null && string.trim().length() > 0) { + bEdgePane.setTop(this.buildInfo(this.certCheck())); + } + bEdgePane.setCenter(super.buildContent()); + return bEdgePane; + } + + private final BWidget buildInfo(String string) { + BLabel bLabel = new BLabel(lex.getText("cert.request.dialog.warnings") + System.getProperty("line.separator") + string, BHalign.left); + StyleUtils.addStyleClass((IStylable)bLabel, (String)"warning"); + return new BBorderPane((BWidget)bLabel, 0.0, 0.0, (double)5, 0.0); + } + + private final String certCheck() throws CertificateEncodingException { + StringBuffer stringBuffer = new StringBuffer(); + X500Name x500Name = this.cert.getSubjectDN(); + if (x500Name.getRDNs(BCStyle.CN).length <= 0) { + stringBuffer.append(lex.getText("cert.request.dialog.common.name.warning")).append(System.getProperty("line.separator")); + } + if (x500Name.getRDNs(BCStyle.O).length <= 0) { + stringBuffer.append(lex.getText("cert.request.dialog.organisation.warning")).append(System.getProperty("line.separator")); + } + if (x500Name.getRDNs(BCStyle.L).length <= 0) { + stringBuffer.append(lex.getText("cert.request.dialog.city.warning")).append(System.getProperty("line.separator")); + } + if (x500Name.getRDNs(BCStyle.ST).length <= 0) { + stringBuffer.append(lex.getText("cert.request.dialog.state.warning")).append(System.getProperty("line.separator")); + } + if (x500Name.getRDNs(BCStyle.C).length <= 0) { + stringBuffer.append(lex.getText("cert.request.dialog.country.warning")).append(System.getProperty("line.separator")); + } + if (this.cert.getKeySize() < 2048) { + stringBuffer.append(lex.getText("cert.request.dialog.keysize.warning")).append(System.getProperty("line.separator")); + } + return stringBuffer.toString(); + } + + protected BWidget buildButtons() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + this.okButton = new BButton(UiLexicon.bajaui().getText("dialog.ok")); + bGridPane.add(null, (BValue)this.okButton); + this.linkTo("linkA", (BComponent)this.okButton, (Slot)BButton.actionPerformed, (Slot)okButtonPressed); + this.okButton.setEnabled(true); + this.cancelButton = new BButton(UiLexicon.bajaui().getText("dialog.cancel")); + bGridPane.add(null, (BValue)this.cancelButton); + this.linkTo("linkB", (BComponent)this.cancelButton, (Slot)BButton.actionPerformed, (Slot)cancelButtonPressed); + this.cancelButton.setEnabled(true); + return new BBorderPane((BWidget)bGridPane, 7.0, 0.0, 0.0, 0.0); + } + + public void windowClosing(BWindowEvent bWindowEvent) { + this.close(); + } + + public void doOkButtonPressed(BWidgetEvent bWidgetEvent) { + this.closeResult = true; + this.close(); + } + + public void doCancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.closeResult = false; + this.close(); + } + + public boolean getResult() { + return this.closeResult; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.closeResult = false; + } + + private BCertRequestDialog(BWidget bWidget, NX509Certificate nX509Certificate) throws Exception { + super(bWidget, lex.getText("csr.view.dialog.title")); + this.this(); + this.cert = nX509Certificate; + this.setContent(this.buildDialog()); + this.setDefaultButton(this.okButton); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BCertRequestDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BCertRequestDialog = BCertRequestDialog.class("[Lcom.tridium.platcrypto.ui.BCertRequestDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"platCrypto"); + logo = BImage.make((String)lex.get("cert.x32.icon", "module://icons/x32/lock.png")); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BCertViewDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BCertViewDialog.java new file mode 100644 index 0000000..8ad8f4f --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BCertViewDialog.java @@ -0,0 +1,168 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.crypto.core.cert.NX509Extension + * javax.baja.gx.BImage + * javax.baja.gx.Size + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BWidgetEvent + * javax.baja.ui.event.BWindowEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BConstrainedPane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.pane.BScrollPane + * javax.baja.ui.util.UiLexicon + * javax.baja.ui.wizard.BWizardHeader + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.crypto.core.cert.NX509Extension; +import com.tridium.platcrypto.ui.BCryptoDialog; +import com.tridium.platcrypto.ui.BX509CertificatePane; +import com.tridium.platcrypto.ui.BX509ExtensionPane; +import javax.baja.gx.BImage; +import javax.baja.gx.Size; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BWidgetEvent; +import javax.baja.ui.event.BWindowEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BConstrainedPane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.pane.BScrollPane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.ui.wizard.BWizardHeader; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BCertViewDialog +extends BCryptoDialog { + public static final Type TYPE; + protected static Lexicon lex; + protected static BImage logo; + protected NX509Certificate cert; + protected BButton okButton; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BCertViewDialog; + + public Type getType() { + return TYPE; + } + + public static void show(BWidget bWidget, NX509Certificate nX509Certificate) throws Exception { + BCertViewDialog bCertViewDialog = new BCertViewDialog(bWidget, nX509Certificate); + bCertViewDialog.setBoundsCenteredOnOwner(); + bCertViewDialog.setResizable(false); + bCertViewDialog.open(); + } + + protected BWidget buildHeader() { + return new BWizardHeader(logo, this.cert.getSubject(), lex.getText("cert.view.dialog.info", new Object[]{this.cert.getSubject()})); + } + + protected BWidget buildBody() throws Exception { + BGridPane bGridPane = new BGridPane(1); + bGridPane.setStyleClasses("scrolled"); + bGridPane.setStretchColumn(0); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.add(null, (BValue)new BBorderPane(this.createHeaderLabel(lex.getText("cert.dialog.properties") + ':'))); + bGridPane.add(null, (BValue)new BBorderPane(this.buildProperties(), 0.0, 0.0, 0.0, 0.0)); + NX509Extension[] nX509ExtensionArray = this.cert.getExtensions(); + if (nX509ExtensionArray.length > 0) { + bGridPane.add(null, (BValue)new BBorderPane(this.createHeaderLabel(lex.getText("cert.dialog.extensions") + ':'))); + bGridPane.add(null, (BValue)new BBorderPane(this.buildExtensions(), 0.0, 0.0, 0.0, 0.0)); + } + BScrollPane bScrollPane = new BScrollPane((BWidget)bGridPane); + Size size = this.getCertViewSize(); + BConstrainedPane bConstrainedPane = new BConstrainedPane((BWidget)bScrollPane, size.width, size.height); + bConstrainedPane.setMinWidth(500.0); + return bConstrainedPane; + } + + protected Size getCertViewSize() { + return new Size(600.0, 400.0); + } + + protected BWidget buildProperties() { + BX509CertificatePane bX509CertificatePane = new BX509CertificatePane(this.cert); + return bX509CertificatePane; + } + + protected BWidget buildExtensions() throws Exception { + BX509ExtensionPane bX509ExtensionPane = new BX509ExtensionPane(); + bX509ExtensionPane.setExtensions(this.cert.getExtensions(), false); + return bX509ExtensionPane; + } + + protected BWidget buildButtons() { + BGridPane bGridPane = new BGridPane(1); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + this.okButton = new BButton(UiLexicon.bajaui().getText("dialog.ok")); + bGridPane.add(null, (BValue)this.okButton); + this.linkTo("linkA", (BComponent)this.okButton, (Slot)BButton.actionPerformed, (Slot)okButtonPressed); + this.okButton.setEnabled(true); + return new BBorderPane((BWidget)bGridPane, 7.0, 0.0, 0.0, 0.0); + } + + public void windowClosing(BWindowEvent bWindowEvent) { + this.close(); + } + + public void doOkButtonPressed(BWidgetEvent bWidgetEvent) { + this.close(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + protected BCertViewDialog(BWidget bWidget, String string) throws Exception { + super(bWidget, string); + } + + protected BCertViewDialog(BWidget bWidget, NX509Certificate nX509Certificate) throws Exception { + this(bWidget, lex.getText("cert.view.dialog.title")); + this.cert = nX509Certificate; + this.setContent(this.buildDialog()); + this.setDefaultButton(this.okButton); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BCertViewDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BCertViewDialog = BCertViewDialog.class("[Lcom.tridium.platcrypto.ui.BCertViewDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"platCrypto"); + logo = BImage.make((String)lex.get("cert.x32.icon", "module://icons/x32/lock.png")); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BCertificateSignerDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BCertificateSignerDialog.java new file mode 100644 index 0000000..065fa7d --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BCertificateSignerDialog.java @@ -0,0 +1,513 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.CertUtils + * com.tridium.crypto.core.cert.NPKCS10CertificationRequest + * com.tridium.crypto.core.cert.NSigningParameters + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.crypto.core.cert.NX509CertificateEntry + * com.tridium.crypto.core.cert.NX509Extension + * com.tridium.crypto.core.util.FriendlyPemReader + * com.tridium.platform.ui.util.CommandUtil + * com.tridium.ui.theme.custom.nss.StyleUtils + * com.tridium.workbench.fieldeditors.BAbsTimeFE + * javax.baja.file.BAbstractFile + * javax.baja.file.FileUtil + * javax.baja.file.IFileFilter + * javax.baja.gx.BImage + * javax.baja.naming.BOrd + * javax.baja.security.crypto.CertManagerFactory + * javax.baja.security.crypto.ICryptoManagerEx + * javax.baja.security.crypto.IKeyStore + * javax.baja.sys.Action + * javax.baja.sys.BAbsTime + * javax.baja.sys.BComponent + * javax.baja.sys.BIcon + * javax.baja.sys.BValue + * javax.baja.sys.Clock + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BTextDropDown + * javax.baja.ui.BTextField + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.enums.BButtonStyle + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BWidgetEvent + * javax.baja.ui.event.BWindowEvent + * javax.baja.ui.file.BFileChooser + * javax.baja.ui.file.ExtFileFilter + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BConstrainedPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.pane.BScrollPane + * javax.baja.ui.style.IStylable + * javax.baja.ui.util.UiLexicon + * javax.baja.ui.wizard.BWizardHeader + * javax.baja.util.Lexicon + * org.bouncycastle.openssl.PEMParser + * org.bouncycastle.openssl.PEMWriter + * org.bouncycastle.pkcs.PKCS10CertificationRequest + * org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.CertUtils; +import com.tridium.crypto.core.cert.NPKCS10CertificationRequest; +import com.tridium.crypto.core.cert.NSigningParameters; +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.crypto.core.cert.NX509CertificateEntry; +import com.tridium.crypto.core.cert.NX509Extension; +import com.tridium.crypto.core.util.FriendlyPemReader; +import com.tridium.platcrypto.ui.BCertsTable; +import com.tridium.platcrypto.ui.BCryptoDialog; +import com.tridium.platcrypto.ui.BPasswordField; +import com.tridium.platcrypto.ui.BX509ExtensionPane; +import com.tridium.platform.ui.util.CommandUtil; +import com.tridium.ui.theme.custom.nss.StyleUtils; +import com.tridium.workbench.fieldeditors.BAbsTimeFE; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.Reader; +import java.io.Writer; +import java.security.PrivateKey; +import java.security.UnrecoverableKeyException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Date; +import java.util.Enumeration; +import java.util.List; +import javax.baja.file.BAbstractFile; +import javax.baja.file.FileUtil; +import javax.baja.file.IFileFilter; +import javax.baja.gx.BImage; +import javax.baja.naming.BOrd; +import javax.baja.security.crypto.CertManagerFactory; +import javax.baja.security.crypto.ICryptoManagerEx; +import javax.baja.security.crypto.IKeyStore; +import javax.baja.sys.Action; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BComponent; +import javax.baja.sys.BIcon; +import javax.baja.sys.BValue; +import javax.baja.sys.Clock; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BTextDropDown; +import javax.baja.ui.BTextField; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.enums.BButtonStyle; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BWidgetEvent; +import javax.baja.ui.event.BWindowEvent; +import javax.baja.ui.file.BFileChooser; +import javax.baja.ui.file.ExtFileFilter; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BConstrainedPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.pane.BScrollPane; +import javax.baja.ui.style.IStylable; +import javax.baja.ui.util.UiLexicon; +import javax.baja.ui.wizard.BWizardHeader; +import javax.baja.util.Lexicon; +import org.bouncycastle.openssl.PEMParser; +import org.bouncycastle.openssl.PEMWriter; +import org.bouncycastle.pkcs.PKCS10CertificationRequest; +import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BCertificateSignerDialog +extends BCryptoDialog { + public static final Action cancelButtonPressed = BCertificateSignerDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Type TYPE; + static Lexicon lex; + static final BImage logo; + private static final BImage open; + ICryptoManagerEx mgr; + IKeyStore store; + private BTextField csrFileText; + BButton openBtn; + private BLabel subject; + private BLabel subjectDN; + private BLabel keyAlg; + private BLabel keySize; + private BLabel sigAlg; + private BLabel sigSize; + private BLabel verified; + BGridPane csrPane; + BEdgePane csrPropPane; + BEdgePane extensionsPane; + private BAbsTimeFE notBeforeFE; + private BAbsTimeFE notAfterFE; + private BX509ExtensionPane extensionPane; + private BTextDropDown ca; + private BPasswordField caPassword; + NPKCS10CertificationRequest csr; + String baseFileName; + private BAbsTime notBefore; + private BAbsTime notAfter; + private BButton okButton; + protected BButton cancelButton; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BCertificateSignerDialog; + + public void cancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.invoke(cancelButtonPressed, (BValue)bWidgetEvent, null); + } + + public Type getType() { + return TYPE; + } + + public static void show(BWidget bWidget) throws Exception { + BCertificateSignerDialog bCertificateSignerDialog = new BCertificateSignerDialog(bWidget); + bCertificateSignerDialog.setBoundsCenteredOnOwner(); + bCertificateSignerDialog.setResizable(false); + bCertificateSignerDialog.open(); + } + + protected BWidget buildHeader() { + return new BWizardHeader(logo, lex.getText("cert.signer.dialog.title"), lex.getText("cert.signer.dialog.info")); + } + + protected BWidget buildBody() { + BGridPane bGridPane = new BGridPane(1); + bGridPane.setStretchColumn(0); + bGridPane.setColumnAlign(BHalign.fill); + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop((BWidget)new BLabel(lex.getText("cert.signer.dialog.selectcsr") + ':', BHalign.left)); + BGridPane bGridPane2 = new BGridPane(2); + this.csrFileText = new BTextField("", 60, false); + bGridPane2.add(null, (BValue)this.csrFileText); + this.openBtn = new BButton((Command)new OpenCsrCommand()); + this.openBtn.setButtonStyle(BButtonStyle.toolBar); + bGridPane2.add(null, (BValue)this.openBtn); + bEdgePane.setCenter((BWidget)bGridPane2); + bGridPane.add(null, (BValue)bEdgePane); + this.csrPane = new BGridPane(1); + this.csrPane.setVisible(false); + this.csrPane.setStretchColumn(0); + this.csrPane.setColumnAlign(BHalign.fill); + this.csrPane.setRowGap(7.0); + this.csrPropPane = new BEdgePane(); + BEdgePane bEdgePane2 = new BEdgePane(); + bEdgePane2.setLeft((BWidget)new BLabel(lex.getText("cert.dialog.properties") + ':')); + this.csrPropPane.setTop((BWidget)bEdgePane2); + BGridPane bGridPane3 = new BGridPane(2); + bGridPane3.setStretchColumn(1); + bGridPane3.setColorRows(true); + StyleUtils.addStyleClass((IStylable)bGridPane3, (String)"scrolled"); + bGridPane3.setColumnAlign(BHalign.left); + BCertificateSignerDialog.addPaddedLabelRow(bGridPane3, "cert.field.subject", this.subject); + BCertificateSignerDialog.addPaddedLabelRow(bGridPane3, "cert.field.subjectDn", this.subjectDN); + BCertificateSignerDialog.addPaddedLabelRow(bGridPane3, "cert.field.keyAlgorithm", this.keyAlg); + BCertificateSignerDialog.addPaddedLabelRow(bGridPane3, "cert.field.keySize", this.keySize); + BCertificateSignerDialog.addPaddedLabelRow(bGridPane3, "cert.field.signatureAlgorithm", this.sigAlg); + BCertificateSignerDialog.addPaddedLabelRow(bGridPane3, "cert.field.signatureSize", this.sigSize); + BCertificateSignerDialog.addPaddedLabelRow(bGridPane3, "cert.field.verify", this.verified); + BScrollPane bScrollPane = new BScrollPane((BWidget)bGridPane3); + BConstrainedPane bConstrainedPane = new BConstrainedPane((BWidget)bScrollPane, 500.0, 150.0); + this.csrPropPane.setCenter((BWidget)bConstrainedPane); + this.csrPane.add(null, (BValue)this.csrPropPane); + this.extensionsPane = new BEdgePane(); + this.extensionsPane.setVisible(false); + BEdgePane bEdgePane3 = new BEdgePane(); + bEdgePane3.setLeft((BWidget)new BLabel(lex.getText("cert.dialog.extensions") + ':')); + this.extensionsPane.setTop((BWidget)bEdgePane3); + this.extensionPane = new BX509ExtensionPane(); + bScrollPane = new BScrollPane((BWidget)this.extensionPane); + BConstrainedPane bConstrainedPane2 = new BConstrainedPane((BWidget)bScrollPane, 500.0, 150.0); + this.extensionsPane.setCenter((BWidget)bConstrainedPane2); + this.csrPane.add(null, (BValue)this.extensionsPane); + bGridPane.add(null, (BValue)this.csrPane); + BEdgePane bEdgePane4 = new BEdgePane(); + BGridPane bGridPane4 = new BGridPane(2); + bGridPane4.setRowGap(7.0); + this.notBeforeFE = new BAbsTimeFE(this.notBefore); + BCertificateSignerDialog.addLabelRow(bGridPane4, "cert.field.notBefore", (BValue)this.notBeforeFE); + this.notAfterFE = new BAbsTimeFE(this.notAfter); + BCertificateSignerDialog.addLabelRow(bGridPane4, "cert.field.notAfter", (BValue)this.notAfterFE); + this.ca = new BTextDropDown(this.getCaAliases(), 30, false); + BCertificateSignerDialog.addLabelRow(bGridPane4, "cert.signer.dialog.caalias", (BValue)this.ca); + this.caPassword = new BPasswordField("", 20); + BCertificateSignerDialog.addLabelRow(bGridPane4, "cert.signer.dialog.capassword", (BValue)this.caPassword); + bEdgePane4.setLeft((BWidget)bGridPane4); + bGridPane.add(null, (BValue)bEdgePane4); + bGridPane.setRowGap(7.0); + return bGridPane; + } + + private static final void addLabelRow(BGridPane bGridPane, String string, BValue bValue) { + BCertificateSignerDialog.addRow(bGridPane, (BWidget)new BLabel(lex.getText(string) + ':'), bValue); + } + + private static final void addPaddedLabelRow(BGridPane bGridPane, String string, BLabel bLabel) { + BCertificateSignerDialog.addRow(bGridPane, BCertificateSignerDialog.createPaddedLabel(lex.getText(string)), (BValue)BCertificateSignerDialog.createPaddedLabel(bLabel)); + } + + private static final void addRow(BGridPane bGridPane, BWidget bWidget, BValue bValue) { + bGridPane.add(null, (BValue)bWidget); + bGridPane.add(null, bValue); + } + + protected BWidget buildButtons() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + this.okButton = new BButton(UiLexicon.bajaui().getText("dialog.ok")); + bGridPane.add(null, (BValue)this.okButton); + this.linkTo("linkA", (BComponent)this.okButton, (Slot)BButton.actionPerformed, (Slot)okButtonPressed); + this.okButton.setEnabled(true); + this.cancelButton = new BButton(UiLexicon.bajaui().getText("dialog.cancel")); + bGridPane.add(null, (BValue)this.cancelButton); + this.linkTo("linkB", (BComponent)this.cancelButton, (Slot)BButton.actionPerformed, (Slot)cancelButtonPressed); + this.cancelButton.setEnabled(true); + return new BBorderPane((BWidget)bGridPane, 7.0, 0.0, 0.0, 0.0); + } + + private final List getCaAliases() { + ArrayList arrayList = new ArrayList(); + try { + Enumeration enumeration = this.store.aliases(); + while (enumeration.hasMoreElements()) { + String string = (String)enumeration.nextElement(); + if (!this.store.isKeyEntry(string)) continue; + X509Certificate x509Certificate = this.store.getCertificate(string); + if (x509Certificate != null && x509Certificate.getBasicConstraints() != -1) { + arrayList.add(string); + continue; + } + if (x509Certificate == null || x509Certificate.getKeyUsage() == null || !x509Certificate.getKeyUsage()[5]) continue; + arrayList.add(string); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + return arrayList; + } + + public void doOkButtonPressed(BWidgetEvent bWidgetEvent) { + try { + X509Certificate[] x509CertificateArray; + String string = this.ca.getText(); + String string2 = this.caPassword.getText(); + X509Certificate x509Certificate = this.store.getCertificate(string); + PrivateKey privateKey = (PrivateKey)this.store.getKey(string, string2.toCharArray()); + NX509CertificateEntry nX509CertificateEntry = NX509CertificateEntry.make(null, (X509Certificate[])new X509Certificate[]{x509Certificate}, (PrivateKey)privateKey); + Date date = new Date(((BAbsTime)this.notBeforeFE.saveValue()).getMillis()); + Date date2 = new Date(((BAbsTime)this.notAfterFE.saveValue()).getMillis()); + NSigningParameters nSigningParameters = NSigningParameters.make((Date)date, (Date)date2); + int n = 0; + while (n < this.extensionPane.getExtensionCount()) { + if (this.extensionPane.isSelected(n)) { + x509CertificateArray = this.extensionPane.getExtension(n); + nSigningParameters.addExtension((NX509Extension)x509CertificateArray); + } + ++n; + } + NX509Certificate nX509Certificate = CertUtils.signCertificate((NPKCS10CertificationRequest)this.csr, (NX509CertificateEntry)nX509CertificateEntry, (NSigningParameters)nSigningParameters); + x509CertificateArray = this.store.getCertificateChain(string); + NX509Certificate[] nX509CertificateArray = new NX509Certificate[x509CertificateArray.length + 1]; + nX509CertificateArray[0] = nX509Certificate; + int n2 = 0; + while (n2 < x509CertificateArray.length) { + nX509CertificateArray[n2 + 1] = NX509Certificate.make((X509Certificate)x509CertificateArray[n2]); + ++n2; + } + BFileChooser bFileChooser = BFileChooser.makeSave((BWidget)this.getOwner()); + bFileChooser.addFilter((IFileFilter)new ExtFileFilter(lex.getText("cert.extension.info"), "pem,p12,crt,cer,cert")); + bFileChooser.setTitle(lex.getText("cert.signer.save.title")); + bFileChooser.setDefaultFileName(this.baseFileName + ".pem"); + bFileChooser.setCurrentDirectory(BOrd.make((String)("file:/" + BCertsTable.getCertsDirectoryPath()))); + BOrd bOrd = bFileChooser.show(); + if (bOrd == null) { + return; + } + BAbstractFile bAbstractFile = (BAbstractFile)bOrd.get(); + if (bAbstractFile != null) { + PEMWriter pEMWriter = new PEMWriter((Writer)new OutputStreamWriter(bAbstractFile.getOutputStream())); + int n3 = 0; + while (n3 < nX509CertificateArray.length) { + pEMWriter.writeObject((Object)nX509CertificateArray[n3].getCertificate()); + ++n3; + } + pEMWriter.close(); + } + this.close(); + } + catch (UnrecoverableKeyException unrecoverableKeyException) { + this.badPassword(); + } + catch (Exception exception) { + exception.printStackTrace(); + this.close(); + } + } + + private final void badPassword() { + this.caPassword.getModel().setText(""); + BDialog.error((BWidget)this, (String)lex.getText("cert.signer.dialog.password.error.title"), (Object)lex.getText("cert.signer.dialog.password.error.message")); + } + + public void doCancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.close(); + } + + public void windowClosing(BWindowEvent bWindowEvent) { + this.close(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.subject = new BLabel(""); + this.subjectDN = new BLabel(""); + this.keyAlg = new BLabel(""); + this.keySize = new BLabel(""); + this.sigAlg = new BLabel(""); + this.sigSize = new BLabel(""); + this.verified = new BLabel(""); + this.baseFileName = null; + this.notBefore = BAbsTime.now(); + this.notAfter = BAbsTime.make((long)(Clock.millis() + 63072000000L)); + } + + public BCertificateSignerDialog() throws UnsupportedOperationException { + this.this(); + throw new UnsupportedOperationException(); + } + + public BCertificateSignerDialog(BWidget bWidget) throws Exception { + this(bWidget, lex.getText("cert.signer.dialog.title")); + } + + public BCertificateSignerDialog(BWidget bWidget, String string) throws Exception { + super(bWidget, string); + this.this(); + this.mgr = CertManagerFactory.getInstanceEx(); + this.store = this.mgr.getKeyStore(); + this.setContent(this.buildDialog()); + this.setDefaultButton(this.okButton); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BCertificateSignerDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BCertificateSignerDialog = BCertificateSignerDialog.class("[Lcom.tridium.platcrypto.ui.BCertificateSignerDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"platCrypto"); + logo = BImage.make((String)lex.get("cert.green.x32.icon", "module://icons/x32/lock.png")); + open = BImage.make((BIcon)BIcon.std((String)"open.png")); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class OpenCsrCommand + extends Command { + /* + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public CommandArtifact doInvoke() { + try { + BFileChooser bFileChooser = BFileChooser.makeOpen((BWidget)this.getOwner()); + bFileChooser.addFilter((IFileFilter)new ExtFileFilter(lex.getText("csr.extension.info"), "csr")); + bFileChooser.setTitle(lex.getText("cert.signer.csr.select")); + bFileChooser.setCurrentDirectory(BOrd.make((String)("file:/" + BCertsTable.getCertsDirectoryPath()))); + BOrd bOrd = bFileChooser.show(); + if (bOrd == null) { + return null; + } + BAbstractFile bAbstractFile = (BAbstractFile)bOrd.get(); + if (bAbstractFile == null) return null; + InputStreamReader inputStreamReader = new InputStreamReader(bAbstractFile.getInputStream()); + FriendlyPemReader friendlyPemReader = new FriendlyPemReader((Reader)inputStreamReader); + PEMParser pEMParser = new PEMParser((Reader)friendlyPemReader); + try { + Object object = pEMParser.readObject(); + if (object != null) { + if (object instanceof PKCS10CertificationRequest) { + PKCS10CertificationRequest pKCS10CertificationRequest = (PKCS10CertificationRequest)object; + JcaPKCS10CertificationRequest jcaPKCS10CertificationRequest = new JcaPKCS10CertificationRequest(pKCS10CertificationRequest.getEncoded()); + BCertificateSignerDialog.this.csr = NPKCS10CertificationRequest.make((JcaPKCS10CertificationRequest)jcaPKCS10CertificationRequest); + BCertificateSignerDialog.this.csrFileText.setText(bAbstractFile.toPathString()); + BCertificateSignerDialog.this.baseFileName = FileUtil.getBase((String)bAbstractFile.getFileName()); + BCertificateSignerDialog.this.subject.setText(BCertificateSignerDialog.this.csr.getSubject()); + BCertificateSignerDialog.this.subjectDN.setText(BCertificateSignerDialog.this.csr.getSubjectDN().toString()); + BCertificateSignerDialog.this.keyAlg.setText(BCertificateSignerDialog.this.csr.getKeyAlgorithm()); + BCertificateSignerDialog.this.keySize.setText("" + BCertificateSignerDialog.this.csr.getKeySize()); + BCertificateSignerDialog.this.sigAlg.setText(BCertificateSignerDialog.this.csr.getSignatureAlgorithm()); + BCertificateSignerDialog.this.sigSize.setText("" + BCertificateSignerDialog.this.csr.getSignatureSize()); + BCertificateSignerDialog.this.verified.setText("" + BCertificateSignerDialog.this.csr.verify()); + BCertificateSignerDialog.this.csrPane.setVisible(true); + BCertificateSignerDialog.this.extensionPane.setExtensions(BCertificateSignerDialog.this.csr.getExtensions(), true); + if (BCertificateSignerDialog.this.extensionPane.getExtensionCount() > 0) { + BCertificateSignerDialog.this.extensionsPane.setVisible(true); + } else { + BCertificateSignerDialog.this.extensionsPane.setVisible(false); + } + BCertificateSignerDialog.this.setBoundsCenteredOnOwner(); + } else { + BDialog.warning((BWidget)this.getOwner(), (String)lex.getText("csr.selection.error.title"), (Object)lex.getText("csr.selection.error.msg", new Object[]{bAbstractFile.getFileName()})); + } + } + Object var8_13 = null; + } + catch (Throwable throwable) { + Object var8_12 = null; + try { + pEMParser.close(); + throw throwable; + } + catch (Exception exception) {} + throw throwable; + } + try {} + catch (Exception exception) { + return null; + } + pEMParser.close(); + return null; + } + catch (Exception exception) { + CommandUtil.error((Command)this, (Throwable)exception); + } + return null; + } + + public OpenCsrCommand() { + super((BWidget)BCertificateSignerDialog.this, null, open, null, null); + } + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BCertificateSignerTool.java b/modules/cfr_output/com/tridium/platcrypto/ui/BCertificateSignerTool.java new file mode 100644 index 0000000..cd8ac70 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BCertificateSignerTool.java @@ -0,0 +1,60 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BWidget + * javax.baja.ui.CommandArtifact + * javax.baja.workbench.BWbShell + * javax.baja.workbench.tool.BWbTool + */ +package com.tridium.platcrypto.ui; + +import com.tridium.platcrypto.ui.BCertificateSignerDialog; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BWidget; +import javax.baja.ui.CommandArtifact; +import javax.baja.workbench.BWbShell; +import javax.baja.workbench.tool.BWbTool; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BCertificateSignerTool +extends BWbTool { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BCertificateSignerTool; + + public Type getType() { + return TYPE; + } + + public CommandArtifact invoke(BWbShell bWbShell) throws Exception { + BCertificateSignerDialog.show((BWidget)bWbShell); + return null; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BCertificateSignerTool; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BCertificateSignerTool = BCertificateSignerTool.class("[Lcom.tridium.platcrypto.ui.BCertificateSignerTool;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BCertsTable.java b/modules/cfr_output/com/tridium/platcrypto/ui/BCertsTable.java new file mode 100644 index 0000000..0943949 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BCertsTable.java @@ -0,0 +1,705 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509CertificateEntry + * com.tridium.crypto.core.io.ICoreKeyStore + * com.tridium.crypto.core.util.FriendlyPemReader + * com.tridium.nre.util.PlatformUtil + * com.tridium.platform.ui.util.BCommandBoundTable + * com.tridium.platform.ui.util.CommandBindings$Support + * com.tridium.platform.ui.util.CommandUtil + * com.tridium.ui.theme.Theme + * javax.baja.file.BIFile + * javax.baja.file.IFileFilter + * javax.baja.gx.BImage + * javax.baja.log.Log + * javax.baja.naming.BOrd + * javax.baja.net.NotConnectedException + * javax.baja.nre.util.Array + * javax.baja.nre.util.IntHashMap + * javax.baja.nre.util.IntHashMap$Iterator + * javax.baja.nre.util.SortUtil + * javax.baja.sys.BValue + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.file.BFileChooser + * javax.baja.ui.file.ExtFileFilter + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.table.DynamicTableModel + * javax.baja.ui.table.TableModel + * javax.baja.util.Lexicon + * javax.baja.workbench.util.BNotifyPane + * org.bouncycastle.cert.X509CertificateHolder + * org.bouncycastle.cert.jcajce.JcaX509CertificateConverter + * org.bouncycastle.jce.provider.BouncyCastleProvider + * org.bouncycastle.openssl.EncryptionException + * org.bouncycastle.openssl.PEMDecryptorProvider + * org.bouncycastle.openssl.PEMEncryptedKeyPair + * org.bouncycastle.openssl.PEMKeyPair + * org.bouncycastle.openssl.PEMParser + * org.bouncycastle.openssl.PasswordException + * org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter + * org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NX509CertificateEntry; +import com.tridium.crypto.core.io.ICoreKeyStore; +import com.tridium.crypto.core.util.FriendlyPemReader; +import com.tridium.nre.util.PlatformUtil; +import com.tridium.platcrypto.ui.BCertEntryViewDialog; +import com.tridium.platcrypto.ui.BTrustCertsTable; +import com.tridium.platcrypto.ui.PrivateKeyPasswordFinder; +import com.tridium.platform.ui.util.BCommandBoundTable; +import com.tridium.platform.ui.util.CommandBindings; +import com.tridium.platform.ui.util.CommandUtil; +import com.tridium.ui.theme.Theme; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.security.KeyPair; +import java.security.PrivateKey; +import java.security.Provider; +import java.security.cert.X509Certificate; +import java.util.Enumeration; +import javax.baja.file.BIFile; +import javax.baja.file.IFileFilter; +import javax.baja.gx.BImage; +import javax.baja.log.Log; +import javax.baja.naming.BOrd; +import javax.baja.net.NotConnectedException; +import javax.baja.nre.util.Array; +import javax.baja.nre.util.IntHashMap; +import javax.baja.nre.util.SortUtil; +import javax.baja.sys.BValue; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.file.BFileChooser; +import javax.baja.ui.file.ExtFileFilter; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.table.DynamicTableModel; +import javax.baja.ui.table.TableModel; +import javax.baja.util.Lexicon; +import javax.baja.workbench.util.BNotifyPane; +import org.bouncycastle.cert.X509CertificateHolder; +import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.bouncycastle.openssl.EncryptionException; +import org.bouncycastle.openssl.PEMDecryptorProvider; +import org.bouncycastle.openssl.PEMEncryptedKeyPair; +import org.bouncycastle.openssl.PEMKeyPair; +import org.bouncycastle.openssl.PEMParser; +import org.bouncycastle.openssl.PasswordException; +import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter; +import org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BCertsTable +extends BCommandBoundTable +implements CommandBindings.Support { + public static final Type TYPE; + public static final int COL_ALIAS = 0; + public static final int COL_ISSUER = 1; + public static final int COL_SUBJECT = 2; + public static final int COL_NOT_BEFORE = 3; + public static final int COL_NOT_AFTER = 4; + public static final int COL_KEY_ALG = 5; + public static final int COL_KEY_SIZE = 6; + public static final int COL_SIG_ALG = 7; + public static final int COL_SIG_SIZE = 8; + public static final int COL_VALID = 9; + public static final int COL_SELF_SIGNED = 10; + protected static Log log; + public static final Lexicon lex; + public static final ExtFileFilter PEM_FILTER; + private static String certsDirectoryPath; + static final BImage securityHigh; + static final BImage securityMedium; + static final BImage securityLow; + static final BImage jobIcon; + static final BImage successIcon; + static final BImage failedIcon; + static final BImage unknownIcon; + protected IntHashMap certGenRequests; + protected CertGenMonitor certGenMonitor; + protected ICoreKeyStore mgr; + protected boolean readonly; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BCertsTable; + static /* synthetic */ Class class$java$security$cert$X509Certificate; + + public Type getType() { + return TYPE; + } + + public void load() throws Exception { + this.certModel().load(); + } + + private static final void initCertDirectory() { + File file = Sys.getBajaHome(); + if (file.getPath().contains("wbapplet")) { + file = file.getParentFile().getParentFile(); + } + file = new File(file, "certManagement"); + file.mkdir(); + certsDirectoryPath = file.toString().replace("\\", "/"); + } + + protected static String getCertsDirectoryPath() { + if (certsDirectoryPath == null) { + BCertsTable.initCertDirectory(); + } + return certsDirectoryPath; + } + + protected abstract void initCommands(); + + protected CertModel certModel() { + DynamicTableModel dynamicTableModel = (DynamicTableModel)this.getModel(); + return (CertModel)dynamicTableModel.getRootModel(); + } + + public boolean isReadonly() { + return this.readonly; + } + + public void setReadonly(boolean bl) { + this.readonly = bl; + this.setCommandEnabledStates(); + } + + public void setBoundCommandEnabled(Command command, boolean bl) { + if (this.readonly && (command instanceof ImportCommand || command instanceof DeleteCommand)) { + command.setEnabled(false); + } else { + command.setEnabled(bl); + } + } + + protected synchronized void checkCertMonitorThread() { + if (this.certGenMonitor == null || !this.certGenMonitor.isAlive()) { + this.certGenMonitor = new CertGenMonitor(); + this.certGenMonitor.start(); + } + } + + protected void notify(String string, BImage bImage, String string2, String string3) { + BLabel bLabel = new BLabel(jobIcon, string); + bLabel.setFont(Theme.widget().getBoldText()); + BLabel bLabel2 = new BLabel(bImage, string2); + BLabel bLabel3 = new BLabel(string3); + bLabel3.setForeground(Theme.widget().getControlShadow()); + BGridPane bGridPane = new BGridPane(1); + bGridPane.add(null, (BValue)bLabel); + bGridPane.add(null, (BValue)bLabel2); + bGridPane.add(null, (BValue)bLabel3); + BNotifyPane bNotifyPane = new BNotifyPane(); + bNotifyPane.setCenter((BWidget)bGridPane); + bNotifyPane.open(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.certGenRequests = new IntHashMap(); + this.certGenMonitor = null; + this.mgr = null; + this.readonly = false; + } + + public BCertsTable() throws UnsupportedOperationException { + this.this(); + throw new UnsupportedOperationException(); + } + + public BCertsTable(ICoreKeyStore iCoreKeyStore) throws Exception { + int[] nArray = new int[6]; + nArray[1] = 2; + nArray[2] = 4; + nArray[3] = 5; + nArray[4] = 6; + nArray[5] = 9; + super((TableModel)new DynamicTableModel((TableModel)new CertModel(iCoreKeyStore), nArray)); + this.this(); + this.mgr = iCoreKeyStore; + this.initCommands(); + BCertsTable.initCertDirectory(); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BCertsTable; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BCertsTable = BCertsTable.class("[Lcom.tridium.platcrypto.ui.BCertsTable;", false); + } + TYPE = Sys.loadType((Class)clazz); + log = Log.getLog((String)"crypto"); + lex = Lexicon.make((String)"platCrypto"); + PEM_FILTER = new ExtFileFilter("", "pem,crt,cer"); + certsDirectoryPath = null; + securityHigh = BImage.make((String)lex.get("security.high.x16.icon", "module://icons/x16/security-high.png")); + securityMedium = BImage.make((String)lex.get("security.medium.x16.icon", "module://icons/x16/security-medium.png")); + securityLow = BImage.make((String)lex.get("security.low.x16.icon", "module://icons/x16/security-low.png")); + jobIcon = BImage.make((String)"module://icons/x16/doc.png"); + successIcon = BImage.make((String)"module://icons/x16/job/success.png"); + failedIcon = BImage.make((String)"module://icons/x16/job/failed.png"); + unknownIcon = BImage.make((String)"module://icons/x16/job/unknown.png"); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected static class CertModel + extends TableModel { + protected Array certs; + protected ICoreKeyStore mgr; + static /* synthetic */ Class class$com$tridium$crypto$core$cert$NX509CertificateEntry; + + public BImage getRowIcon(int n) { + if (this.getTable() instanceof BTrustCertsTable) { + return securityHigh; + } + try { + if (!this.cert(n).getCertificate(0).isSelfSigned()) { + return securityHigh; + } + return securityMedium; + } + catch (Exception exception) { + exception.printStackTrace(); + return securityLow; + } + } + + public void load() throws Exception { + Enumeration enumeration = this.mgr.getCertificates(); + Class clazz = class$com$tridium$crypto$core$cert$NX509CertificateEntry; + if (clazz == null) { + clazz = class$com$tridium$crypto$core$cert$NX509CertificateEntry = CertModel.class("[Lcom.tridium.crypto.core.cert.NX509CertificateEntry;", false); + } + this.certs = new Array(clazz); + while (enumeration.hasMoreElements()) { + this.certs.add(enumeration.nextElement()); + } + this.updateTable(true); + } + + public int getColumnCount() { + return 11; + } + + public String getColumnName(int n) { + switch (n) { + case 0: { + return lex.getText("cert.field.alias"); + } + case 1: { + return lex.getText("cert.field.issuedBy"); + } + case 2: { + return lex.getText("cert.field.subject"); + } + case 3: { + return lex.getText("cert.field.notBefore"); + } + case 4: { + return lex.getText("cert.field.notAfter"); + } + case 5: { + return lex.getText("cert.field.keyAlgorithm"); + } + case 6: { + return lex.getText("cert.field.keySize"); + } + case 7: { + return lex.getText("cert.field.signatureAlgorithm"); + } + case 8: { + return lex.getText("cert.field.signatureSize"); + } + case 10: { + return lex.getText("cert.field.selfSigned"); + } + case 9: { + return lex.getText("cert.field.valid"); + } + } + throw new IndexOutOfBoundsException(); + } + + public boolean isColumnSortable(int n) { + return true; + } + + public synchronized void sortByColumn(int n, boolean bl) { + Object[] objectArray = this.getColumnValues(n); + Object[] objectArray2 = this.certs.trim(); + SortUtil.sort((Object[])objectArray, (Object[])objectArray2, (boolean)bl); + this.certs.clear(); + this.certs.addAll(objectArray2); + } + + public int getRowCount() { + int n = 0; + if (this.certs != null) { + n = this.certs.size(); + } + return n; + } + + public NX509CertificateEntry cert(int n) { + return (NX509CertificateEntry)this.certs.get(n); + } + + public Object getValueAt(int n, int n2) { + switch (n2) { + case 0: { + return this.cert(n).getAlias(); + } + case 1: { + return this.cert(n).getCertificate(0).getIssuer(); + } + case 2: { + return this.cert(n).getCertificate(0).getSubject(); + } + case 3: { + return this.cert(n).getCertificate(0).getNotBefore(); + } + case 4: { + return this.cert(n).getCertificate(0).getNotAfter(); + } + case 5: { + return this.cert(n).getCertificate(0).getKeyAlgorithm(); + } + case 6: { + return "" + this.cert(n).getCertificate(0).getKeySize(); + } + case 7: { + return this.cert(n).getCertificate(0).getSignatureAlgorithm(); + } + case 8: { + return "" + this.cert(n).getCertificate(0).getSignatureSize(); + } + case 10: { + return this.cert(n).getCertificate(0).isSelfSigned() ? lex.getText("cert.field.valid.true") : lex.getText("cert.field.valid.false"); + } + case 9: { + return this.cert(n).getCertificate(0).checkValidity() ? lex.getText("cert.field.valid.true") : lex.getText("cert.field.valid.false"); + } + } + throw new IndexOutOfBoundsException(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public CertModel(ICoreKeyStore iCoreKeyStore) { + this.mgr = iCoreKeyStore; + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected abstract class ImportCommand + extends Command { + /* + * WARNING - Removed try catching itself - possible behaviour change. + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public CommandArtifact doInvoke() { + try { + BFileChooser bFileChooser = BFileChooser.makeOpen((BWidget)this.getOwner()); + bFileChooser.setTitle(lex.getText("cert.import.chooser.title")); + bFileChooser.addFilter((IFileFilter)new ExtFileFilter(lex.getText("cert.extension.info"), "pem,p12,crt,cer,cert")); + bFileChooser.setCurrentDirectory(BOrd.make((String)("file:/" + certsDirectoryPath))); + BOrd bOrd = bFileChooser.show(); + if (bOrd == null) { + return null; + } + BIFile bIFile = (BIFile)bOrd.get(); + if (bIFile == null) return null; + Class clazz = class$java$security$cert$X509Certificate; + if (clazz == null) { + clazz = class$java$security$cert$X509Certificate = BCertsTable.class("[Ljava.security.cert.X509Certificate;", false); + } + Array array = new Array(clazz); + PrivateKey privateKey = null; + InputStreamReader inputStreamReader = new InputStreamReader(bIFile.getInputStream()); + FriendlyPemReader friendlyPemReader = new FriendlyPemReader((Reader)inputStreamReader); + PEMParser pEMParser = new PEMParser((Reader)friendlyPemReader); + try { + try { + Object object = pEMParser.readObject(); + while (object != null) { + X509Certificate x509Certificate; + if (object instanceof X509Certificate) { + array.add(object); + } else if (object instanceof X509CertificateHolder) { + x509Certificate = new JcaX509CertificateConverter().getCertificate((X509CertificateHolder)object); + array.add((Object)x509Certificate); + } else if (object instanceof PrivateKey) { + if (privateKey != null) throw new IOException("can't import multiple private keys from one file"); + privateKey = (PrivateKey)object; + } else if (object instanceof KeyPair) { + if (privateKey != null) throw new IOException("can't import multiple private keys from one file"); + privateKey = ((KeyPair)object).getPrivate(); + } else if (object instanceof PEMKeyPair) { + if (privateKey != null) throw new IOException("can't import multiple private keys from one file"); + privateKey = new JcaPEMKeyConverter().setProvider((Provider)new BouncyCastleProvider()).getPrivateKey(((PEMKeyPair)object).getPrivateKeyInfo()); + } else { + if (!(object instanceof PEMEncryptedKeyPair)) throw new IOException("unsupported object type: " + object.getClass().getName()); + if (privateKey != null) throw new IOException("can't import multiple private keys from one file"); + x509Certificate = new JcePEMDecryptorProviderBuilder().setProvider((Provider)new BouncyCastleProvider()); + PEMDecryptorProvider pEMDecryptorProvider = x509Certificate.build(new PrivateKeyPasswordFinder(this.getOwner()).getPassword()); + JcaPEMKeyConverter jcaPEMKeyConverter = new JcaPEMKeyConverter().setProvider((Provider)new BouncyCastleProvider()); + privateKey = jcaPEMKeyConverter.getPrivateKey(((PEMEncryptedKeyPair)object).decryptKeyPair(pEMDecryptorProvider).getPrivateKeyInfo()); + } + object = pEMParser.readObject(); + } + } + catch (PasswordException passwordException) { + BDialog.error((BWidget)this.getOwner(), (Object)lex.get("cert.import.privatekey.badpassword")); + CommandArtifact commandArtifact = null; + Object var10_17 = null; + try { + pEMParser.close(); + return commandArtifact; + } + catch (Exception exception) {} + return commandArtifact; + } + } + catch (Throwable throwable) { + Object var10_18 = null; + try {} + catch (Exception exception) {} + pEMParser.close(); + throw throwable; + throw throwable; + } + { + Object var10_19 = null; + } + try {} + catch (Exception exception) {} + pEMParser.close(); + String string = bIFile.getFileName(); + string = string.substring(0, string.length() - bIFile.getExtension().length() - 1); + this.importCertData(array, privateKey, string); + BCertsTable.this.mgr.save(); + BCertsTable.this.certModel().load(); + return null; + } + catch (EncryptionException encryptionException) { + BDialog.error((BWidget)this.getOwner(), (Object)lex.get("cert.import.privatekey.badpassword")); + return null; + } + catch (Exception exception) { + CommandUtil.error((Command)this, (Throwable)exception); + } + return null; + } + + protected abstract void importCertData(Array var1, PrivateKey var2, String var3) throws Exception; + + public ImportCommand() { + super((BWidget)BCertsTable.this, lex, "cert.button.import"); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class DeleteCommand + extends Command { + public CommandArtifact doInvoke() { + try { + if (4 == BDialog.confirm((BWidget)BCertsTable.this, (String)lex.getText("cert.delete.dialog.title"), (Object)lex.getText("cert.delete.dialog.info"), (int)12)) { + int[] nArray = BCertsTable.this.getSelection().getRows(); + String[] stringArray = new String[nArray.length]; + int n = 0; + while (n < nArray.length) { + stringArray[n] = BCertsTable.this.certModel().cert(nArray[n]).getAlias(); + log.trace("request to delete alias " + stringArray[n]); + ++n; + } + BCertsTable.this.mgr.deleteEntries(stringArray); + BCertsTable.this.mgr.save(); + BCertsTable.this.certModel().load(); + } + } + catch (Exception exception) { + CommandUtil.error((Command)this, (Throwable)exception); + } + return null; + } + + public DeleteCommand() { + super((BWidget)BCertsTable.this, lex, "cert.button.delete"); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class CertGenMonitor + extends Thread { + public void run() { + do { + IntHashMap.Iterator iterator = BCertsTable.this.certGenRequests.iterator(); + while (iterator.hasNext()) { + try { + CertGenRequest certGenRequest = (CertGenRequest)iterator.next(); + int n = BCertsTable.this.mgr.getCertGenerationStatus(certGenRequest.requestId); + if (n == -1) { + BCertsTable.this.certGenRequests.remove(certGenRequest.requestId); + log.message("cert generation failed for " + certGenRequest.getAlias()); + BCertsTable.this.notify(lex.get("cert.generate.title"), failedIcon, lex.get("cert.generate.failed"), lex.getText("cert.generate.failed.msg", (Object[])new String[]{certGenRequest.getAlias()})); + continue; + } + if (n == 2) { + BCertsTable.this.certGenRequests.remove(certGenRequest.requestId); + log.message("cert generation succeeded for " + certGenRequest.getAlias()); + BCertsTable.this.notify(lex.get("cert.generate.title"), successIcon, lex.get("cert.generate.success"), lex.getText("cert.generate.success.msg", (Object[])new String[]{certGenRequest.getAlias()})); + BCertsTable.this.certModel().load(); + continue; + } + long l = PlatformUtil.ticks(); + if (l - certGenRequest.submitted <= 3600000L) continue; + BCertsTable.this.certModel().load(); + } + catch (NotConnectedException notConnectedException) { + break; + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + try { + Thread.sleep(2500L); + } + catch (Exception exception) {} + } while (!BCertsTable.this.certGenRequests.isEmpty()); + } + + public CertGenMonitor() { + super("tCertGenMonitor"); + } + } + + static class CertGenRequest { + private int requestId; + private String alias; + private long submitted; + + public int getRequestId() { + return this.requestId; + } + + public String getAlias() { + return this.alias; + } + + public CertGenRequest(int n, String string) { + this.requestId = n; + this.alias = string; + this.submitted = PlatformUtil.ticks(); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class ViewCommand + extends Command { + public CommandArtifact doInvoke() { + try { + int n = BCertsTable.this.certModel().getSelection().getRow(); + BCertEntryViewDialog.show((BWidget)BCertsTable.this, BCertsTable.this.certModel().cert(n)); + } + catch (Exception exception) { + CommandUtil.error((Command)this, (Throwable)exception); + } + return null; + } + + public ViewCommand() { + super((BWidget)BCertsTable.this, lex, "cert.button.view"); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class ExportCommand + extends Command { + /* + * Exception decompiling + */ + public CommandArtifact doInvoke() { + /* + * This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. + * + * org.benf.cfr.reader.util.ConfusedCFRException: Back jump on a try block [egrp 9[TRYBLOCK] [11 : 615->618)] java.lang.Throwable + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.insertExceptionBlocks(Op02WithProcessedDataAndRefs.java:2283) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:415) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201) + * at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94) + * at org.benf.cfr.reader.entities.Method.analyse(Method.java:531) + * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055) + * at org.benf.cfr.reader.entities.ClassFile.analyseInnerClassesPass1(ClassFile.java:923) + * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1035) + * at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942) + * at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257) + * at org.benf.cfr.reader.Driver.doJar(Driver.java:139) + * at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76) + * at org.benf.cfr.reader.Main.main(Main.java:54) + */ + throw new IllegalStateException("Decompilation failed"); + } + + public ExportCommand() { + super((BWidget)BCertsTable.this, lex, "cert.button.export"); + } + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BCryptoDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BCryptoDialog.java new file mode 100644 index 0000000..a52e562 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BCryptoDialog.java @@ -0,0 +1,133 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.ui.theme.Theme + * javax.baja.gx.BImage + * javax.baja.sys.Action + * javax.baja.sys.BValue + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BWidgetEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.style.IStylable + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.ui; + +import com.tridium.ui.theme.Theme; +import javax.baja.gx.BImage; +import javax.baja.sys.Action; +import javax.baja.sys.BValue; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BWidgetEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.style.IStylable; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BCryptoDialog +extends BDialog { + public static final Action okButtonPressed = BCryptoDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Type TYPE; + static Lexicon lex; + static final BImage logo; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BCryptoDialog; + + public void okButtonPressed(BWidgetEvent bWidgetEvent) { + this.invoke(okButtonPressed, (BValue)bWidgetEvent, null); + } + + public Type getType() { + return TYPE; + } + + protected static BWidget createPaddedLabel(String string) { + BLabel bLabel = new BLabel(string, BHalign.left); + BBorderPane bBorderPane = new BBorderPane((BWidget)bLabel, 0.0, (double)5, 0.0, 15.0); + return bBorderPane; + } + + protected static BWidget createPaddedLabel(BLabel bLabel) { + bLabel.setHalign(BHalign.left); + BBorderPane bBorderPane = new BBorderPane((BWidget)bLabel, 0.0, (double)5, 0.0, 15.0); + return bBorderPane; + } + + protected BWidget createHeaderLabel(String string) { + BLabel bLabel = new BLabel(string, BHalign.left); + bLabel.setFont(Theme.label().getLargeBoldFont((IStylable)bLabel)); + return bLabel; + } + + protected BWidget buildDialog() throws Exception { + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop(this.buildHeader()); + bEdgePane.setCenter(this.buildContent()); + return bEdgePane; + } + + protected abstract BWidget buildHeader(); + + protected BWidget buildContent() throws Exception { + BGridPane bGridPane = new BGridPane(1); + bGridPane.setHalign(BHalign.left); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.add(null, (BValue)this.buildBody()); + bGridPane.add(null, (BValue)this.buildButtons()); + return new BBorderPane((BWidget)bGridPane, 7.0, 7.0, 7.0, 7.0); + } + + protected abstract BWidget buildBody() throws Exception; + + protected abstract BWidget buildButtons(); + + public abstract void doOkButtonPressed(BWidgetEvent var1); + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BCryptoDialog() throws UnsupportedOperationException { + throw new UnsupportedOperationException(); + } + + protected BCryptoDialog(BWidget bWidget, String string) throws Exception { + super(bWidget, string, true); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BCryptoDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BCryptoDialog = BCryptoDialog.class("[Lcom.tridium.platcrypto.ui.BCryptoDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"platCrypto"); + logo = BImage.make((String)lex.get("cert.x32.icon", "module://icons/x32/lock.png")); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BExemptionChangedDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BExemptionChangedDialog.java new file mode 100644 index 0000000..f63ab52 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BExemptionChangedDialog.java @@ -0,0 +1,192 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.CertValidationResult + * com.tridium.crypto.core.cert.NHostExemption + * com.tridium.crypto.core.cert.NX509Certificate + * javax.baja.gx.BImage + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BWidgetEvent + * javax.baja.ui.event.BWindowEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.wizard.BWizardHeader + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.CertValidationResult; +import com.tridium.crypto.core.cert.NHostExemption; +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.platcrypto.ui.BCertViewDialog; +import com.tridium.platcrypto.ui.BX509CertificateChangedPane; +import com.tridium.platcrypto.ui.BX509ExtensionChangedPane; +import javax.baja.gx.BImage; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BWidgetEvent; +import javax.baja.ui.event.BWindowEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.wizard.BWizardHeader; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BExemptionChangedDialog +extends BCertViewDialog { + public static final Action cancelButtonPressed = BExemptionChangedDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Type TYPE; + protected static BImage logo; + protected boolean hostNameMismatch; + protected boolean unknownIdentity; + protected NX509Certificate oldCert; + protected BButton cancelButton; + protected boolean closeResult; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BExemptionChangedDialog; + + public void cancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.invoke(cancelButtonPressed, (BValue)bWidgetEvent, null); + } + + public Type getType() { + return TYPE; + } + + public static boolean show(BWidget bWidget, CertValidationResult certValidationResult) throws Exception { + BExemptionChangedDialog bExemptionChangedDialog = new BExemptionChangedDialog(bWidget, certValidationResult); + bExemptionChangedDialog.setBoundsCenteredOnOwner(); + bExemptionChangedDialog.setResizable(false); + bExemptionChangedDialog.open(); + return bExemptionChangedDialog.getResult(); + } + + public static boolean show(BWidget bWidget, NHostExemption nHostExemption) throws Exception { + BExemptionChangedDialog bExemptionChangedDialog = new BExemptionChangedDialog(bWidget, nHostExemption); + bExemptionChangedDialog.setBoundsCenteredOnOwner(); + bExemptionChangedDialog.setResizable(false); + bExemptionChangedDialog.open(); + return bExemptionChangedDialog.getResult(); + } + + protected BWidget buildHeader() { + return new BWizardHeader(logo, this.oldCert.getSubject() + " / " + this.cert.getSubject(), lex.getText("exempt.changed.dialog.info", new Object[]{this.cert.getSubject()})); + } + + protected BWidget buildContent() throws Exception { + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setCenter(super.buildContent()); + return bEdgePane; + } + + protected BWidget buildProperties() { + BX509CertificateChangedPane bX509CertificateChangedPane = new BX509CertificateChangedPane(this.oldCert, this.cert); + return bX509CertificateChangedPane; + } + + protected BWidget buildExtensions() throws Exception { + BX509ExtensionChangedPane bX509ExtensionChangedPane = new BX509ExtensionChangedPane(this.oldCert.getExtensions(), this.cert.getExtensions()); + return bX509ExtensionChangedPane; + } + + protected BWidget buildButtons() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + this.okButton = new BButton(lex.getText("exempt.prompt.dialog.accept")); + bGridPane.add(null, (BValue)this.okButton); + this.linkTo("linkA", (BComponent)this.okButton, (Slot)BButton.actionPerformed, (Slot)okButtonPressed); + this.okButton.setEnabled(true); + this.cancelButton = new BButton(lex.getText("exempt.prompt.dialog.reject")); + bGridPane.add(null, (BValue)this.cancelButton); + this.linkTo("linkB", (BComponent)this.cancelButton, (Slot)BButton.actionPerformed, (Slot)cancelButtonPressed); + this.cancelButton.setEnabled(true); + return new BBorderPane((BWidget)bGridPane, 7.0, 0.0, 0.0, 0.0); + } + + public void windowClosing(BWindowEvent bWindowEvent) { + this.close(); + } + + public void doOkButtonPressed(BWidgetEvent bWidgetEvent) { + this.closeResult = true; + this.close(); + } + + public void doCancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.closeResult = false; + this.close(); + } + + public boolean getResult() { + return this.closeResult; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.hostNameMismatch = false; + this.unknownIdentity = false; + this.closeResult = false; + } + + private BExemptionChangedDialog(BWidget bWidget, CertValidationResult certValidationResult) throws Exception { + super(bWidget, lex.getText("exempt.changed.dialog.title")); + this.this(); + this.oldCert = certValidationResult.getOrigCert(); + this.cert = certValidationResult.getNewCert(); + this.hostNameMismatch = certValidationResult.isHostnameVerified() ^ true; + this.unknownIdentity = certValidationResult.isValidCertChain() ^ true; + this.setContent(this.buildDialog()); + this.setDefaultButton(this.okButton); + } + + private BExemptionChangedDialog(BWidget bWidget, NHostExemption nHostExemption) throws Exception { + super(bWidget, lex.getText("exempt.changed.dialog.title")); + this.this(); + this.oldCert = nHostExemption.getCertificate(); + this.cert = nHostExemption.getChanged(); + this.hostNameMismatch = false; + this.unknownIdentity = false; + this.setContent(this.buildDialog()); + this.setDefaultButton(this.okButton); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BExemptionChangedDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BExemptionChangedDialog = BExemptionChangedDialog.class("[Lcom.tridium.platcrypto.ui.BExemptionChangedDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + logo = BImage.make((String)lex.get("cert.warning.x32.icon", "module://icons/x32/warning.png")); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BExemptionPromptDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BExemptionPromptDialog.java new file mode 100644 index 0000000..5ce605b --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BExemptionPromptDialog.java @@ -0,0 +1,182 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.CertValidationResult + * com.tridium.ui.theme.custom.nss.StyleUtils + * javax.baja.gx.BImage + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BWidgetEvent + * javax.baja.ui.event.BWindowEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.style.IStylable + * javax.baja.ui.wizard.BWizardHeader + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.CertValidationResult; +import com.tridium.platcrypto.ui.BCertViewDialog; +import com.tridium.ui.theme.custom.nss.StyleUtils; +import javax.baja.gx.BImage; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BWidgetEvent; +import javax.baja.ui.event.BWindowEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.style.IStylable; +import javax.baja.ui.wizard.BWizardHeader; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BExemptionPromptDialog +extends BCertViewDialog { + public static final Action cancelButtonPressed = BExemptionPromptDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Type TYPE; + protected static BImage logo; + protected boolean hostNameMismatch; + protected boolean unknownIdentity; + protected boolean certExpired; + protected BButton cancelButton; + protected boolean closeResult; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BExemptionPromptDialog; + + public void cancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.invoke(cancelButtonPressed, (BValue)bWidgetEvent, null); + } + + public Type getType() { + return TYPE; + } + + public static boolean show(BWidget bWidget, CertValidationResult certValidationResult) throws Exception { + BExemptionPromptDialog bExemptionPromptDialog = new BExemptionPromptDialog(bWidget, certValidationResult); + bExemptionPromptDialog.setBoundsCenteredOnOwner(); + bExemptionPromptDialog.setResizable(false); + bExemptionPromptDialog.open(); + return bExemptionPromptDialog.getResult(); + } + + protected BWidget buildHeader() { + return new BWizardHeader(logo, this.cert.getSubject(), lex.getText("exempt.prompt.dialog.info", new Object[]{this.cert.getSubject()})); + } + + protected BWidget buildContent() throws Exception { + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop(this.buildInfo()); + bEdgePane.setCenter(super.buildContent()); + return bEdgePane; + } + + private final BWidget buildInfo() { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(lex.getText("exempt.prompt.dialog.msg.untrusted")).append(":").append("\n"); + if (this.hostNameMismatch) { + stringBuffer.append("\n - ").append(lex.getText("exempt.prompt.dialog.msg.mismatch")); + } + if (this.unknownIdentity) { + stringBuffer.append("\n - ").append(lex.getText("exempt.prompt.dialog.msg.identity")); + } + if (this.certExpired) { + stringBuffer.append("\n - ").append(lex.getText("exempt.prompt.dialog.msg.expired")); + } + BLabel bLabel = new BLabel(stringBuffer.toString(), BHalign.left); + StyleUtils.addStyleClass((IStylable)bLabel, (String)"strong"); + return new BBorderPane((BWidget)bLabel, 10.0, 10.0, (double)5, 10.0); + } + + protected BWidget buildButtons() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + this.okButton = new BButton(lex.getText("exempt.prompt.dialog.accept")); + bGridPane.add(null, (BValue)this.okButton); + this.linkTo("linkA", (BComponent)this.okButton, (Slot)BButton.actionPerformed, (Slot)okButtonPressed); + this.okButton.setEnabled(true); + this.cancelButton = new BButton(lex.getText("exempt.prompt.dialog.reject")); + bGridPane.add(null, (BValue)this.cancelButton); + this.linkTo("linkB", (BComponent)this.cancelButton, (Slot)BButton.actionPerformed, (Slot)cancelButtonPressed); + this.cancelButton.setEnabled(true); + return new BBorderPane((BWidget)bGridPane, 7.0, 0.0, 0.0, 0.0); + } + + public void windowClosing(BWindowEvent bWindowEvent) { + this.close(); + } + + public void doOkButtonPressed(BWidgetEvent bWidgetEvent) { + this.closeResult = true; + this.close(); + } + + public void doCancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.closeResult = false; + this.close(); + } + + public boolean getResult() { + return this.closeResult; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.hostNameMismatch = false; + this.unknownIdentity = false; + this.certExpired = false; + this.closeResult = false; + } + + private BExemptionPromptDialog(BWidget bWidget, CertValidationResult certValidationResult) throws Exception { + super(bWidget, lex.getText("exempt.prompt.dialog.title")); + this.this(); + this.cert = certValidationResult.getNewCert(); + this.hostNameMismatch = certValidationResult.isHostnameVerified() ^ true; + this.unknownIdentity = certValidationResult.isValidCertChain() ^ true; + this.certExpired = certValidationResult.isCertExpired(); + this.setContent(this.buildDialog()); + this.setDefaultButton(this.okButton); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BExemptionPromptDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BExemptionPromptDialog = BExemptionPromptDialog.class("[Lcom.tridium.platcrypto.ui.BExemptionPromptDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + logo = BImage.make((String)lex.get("cert.warning.x32.icon", "module://icons/x32/warning.png")); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BExemptionTable.java b/modules/cfr_output/com/tridium/platcrypto/ui/BExemptionTable.java new file mode 100644 index 0000000..48d1576 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BExemptionTable.java @@ -0,0 +1,503 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NHostExemption + * com.tridium.crypto.core.io.ICoreExemptionStore + * com.tridium.platform.ui.util.BCommandBoundTable + * com.tridium.platform.ui.util.BCommandEnablePolicy + * com.tridium.platform.ui.util.CommandBindings$Support + * com.tridium.platform.ui.util.CommandBindings$TableSelection + * com.tridium.platform.ui.util.CommandUtil + * javax.baja.gx.BImage + * javax.baja.log.Log + * javax.baja.nre.util.Array + * javax.baja.nre.util.SortUtil + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BDialog + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.table.DynamicTableModel + * javax.baja.ui.table.TableModel + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NHostExemption; +import com.tridium.crypto.core.io.ICoreExemptionStore; +import com.tridium.platcrypto.ui.BExemptionChangedDialog; +import com.tridium.platcrypto.ui.BExemptionViewDialog; +import com.tridium.platform.ui.util.BCommandBoundTable; +import com.tridium.platform.ui.util.BCommandEnablePolicy; +import com.tridium.platform.ui.util.CommandBindings; +import com.tridium.platform.ui.util.CommandUtil; +import java.util.Enumeration; +import javax.baja.gx.BImage; +import javax.baja.log.Log; +import javax.baja.nre.util.Array; +import javax.baja.nre.util.SortUtil; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BDialog; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.table.DynamicTableModel; +import javax.baja.ui.table.TableModel; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BExemptionTable +extends BCommandBoundTable +implements CommandBindings.Support { + public static final Type TYPE; + public static final int COL_HOST = 0; + public static final int COL_SUBJECT = 1; + public static final int COL_STATUS = 2; + public static final int COL_CREATED = 3; + public static final int COL_ISSUER = 4; + public static final int COL_NOT_BEFORE = 5; + public static final int COL_NOT_AFTER = 6; + public static final int COL_KEY_ALG = 7; + public static final int COL_KEY_SIZE = 8; + public static final int COL_SIG_ALG = 9; + public static final int COL_SIG_SIZE = 10; + public static final int COL_VALID = 11; + protected static Log log; + public static final Lexicon lex; + static final BImage securityHigh; + static final BImage securityMedium; + static final BImage securityLow; + protected ICoreExemptionStore mgr; + protected boolean readonly; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BExemptionTable; + + public Type getType() { + return TYPE; + } + + public void load() throws Exception { + this.exemptModel().load(); + } + + protected void initCommands() { + this.getCommandBindings().setSupport((CommandBindings.Support)this); + ViewCommand viewCommand = new ViewCommand(); + this.addCommand(viewCommand, BCommandEnablePolicy.singleSelection); + this.setDoubleClickCommand(viewCommand); + this.addCommand(new ApproveCommand(), BCommandEnablePolicy.anySelection); + this.addCommand(new UnapproveCommand(), BCommandEnablePolicy.anySelection); + this.addCommand(new DeleteCommand(), BCommandEnablePolicy.anySelection); + } + + protected ExemptionModel exemptModel() { + DynamicTableModel dynamicTableModel = (DynamicTableModel)this.getModel(); + return (ExemptionModel)dynamicTableModel.getRootModel(); + } + + public boolean isReadonly() { + return this.readonly; + } + + public void setReadonly(boolean bl) { + this.readonly = bl; + this.setCommandEnabledStates(); + } + + public void setBoundCommandEnabled(Command command, boolean bl) { + if (this.readonly && (command instanceof ApproveCommand || command instanceof UnapproveCommand || command instanceof DeleteCommand)) { + command.setEnabled(false); + } else { + CommandBindings.TableSelection tableSelection = (CommandBindings.TableSelection)this.getSelection(); + int[] nArray = tableSelection.getRows(); + if (nArray.length > 0 && command instanceof ApprovalCommand) { + ApprovalCommand approvalCommand = (ApprovalCommand)command; + DynamicTableModel dynamicTableModel = (DynamicTableModel)this.getModel(); + ExemptionModel exemptionModel = (ExemptionModel)dynamicTableModel.getRootModel(); + boolean bl2 = true; + int n = 0; + while (n < nArray.length) { + NHostExemption nHostExemption = (NHostExemption)exemptionModel.exemptions.get(nArray[n]); + bl2 &= nHostExemption.getApproved(); + ++n; + } + command.setEnabled(approvalCommand.isApproved() ? bl2 ^ true : bl2); + } else { + command.setEnabled(bl); + } + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.mgr = null; + this.readonly = false; + } + + public BExemptionTable() throws UnsupportedOperationException { + this.this(); + throw new UnsupportedOperationException(); + } + + public BExemptionTable(ICoreExemptionStore iCoreExemptionStore) throws Exception { + int[] nArray = new int[7]; + nArray[1] = 1; + nArray[2] = 2; + nArray[3] = 3; + nArray[4] = 4; + nArray[5] = 5; + nArray[6] = 6; + super((TableModel)new DynamicTableModel((TableModel)new ExemptionModel(iCoreExemptionStore), nArray)); + this.this(); + this.mgr = iCoreExemptionStore; + this.initCommands(); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BExemptionTable; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BExemptionTable = BExemptionTable.class("[Lcom.tridium.platcrypto.ui.BExemptionTable;", false); + } + TYPE = Sys.loadType((Class)clazz); + log = Log.getLog((String)"crypto"); + lex = Lexicon.make((String)"platCrypto"); + securityHigh = BImage.make((String)lex.get("security.high.x16.icon", "module://icons/x16/security-high.png")); + securityMedium = BImage.make((String)lex.get("security.medium.x16.icon", "module://icons/x16/security-medium.png")); + securityLow = BImage.make((String)lex.get("security.low.x16.icon", "module://icons/x16/security-low.png")); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + static class ExemptionModel + extends TableModel { + private Array exemptions; + private ICoreExemptionStore mgr; + static /* synthetic */ Class class$com$tridium$crypto$core$cert$NHostExemption; + + public BImage getRowIcon(int n) { + if (!this.exemption(n).getApproved()) { + return securityLow; + } + if (this.exemption(n).getChanged() != null) { + return securityMedium; + } + return securityHigh; + } + + public void load() throws Exception { + Enumeration enumeration = this.mgr.exemptions(); + Class clazz = class$com$tridium$crypto$core$cert$NHostExemption; + if (clazz == null) { + clazz = class$com$tridium$crypto$core$cert$NHostExemption = ExemptionModel.class("[Lcom.tridium.crypto.core.cert.NHostExemption;", false); + } + this.exemptions = new Array(clazz); + while (enumeration.hasMoreElements()) { + this.exemptions.add(enumeration.nextElement()); + } + this.updateTable(true); + this.getSelection().deselectAll(); + } + + public int getColumnCount() { + return 12; + } + + public String getColumnName(int n) { + switch (n) { + case 0: { + return lex.getText("exempt.field.host"); + } + case 2: { + return lex.getText("exempt.field.approved"); + } + case 3: { + return lex.getText("exempt.field.created"); + } + case 4: { + return lex.getText("cert.field.issuedBy"); + } + case 1: { + return lex.getText("cert.field.subject"); + } + case 5: { + return lex.getText("cert.field.notBefore"); + } + case 6: { + return lex.getText("cert.field.notAfter"); + } + case 7: { + return lex.getText("cert.field.keyAlgorithm"); + } + case 8: { + return lex.getText("cert.field.keySize"); + } + case 9: { + return lex.getText("cert.field.signatureAlgorithm"); + } + case 10: { + return lex.getText("cert.field.signatureSize"); + } + case 11: { + return lex.getText("cert.field.valid"); + } + } + throw new IndexOutOfBoundsException(); + } + + public boolean isColumnSortable(int n) { + return true; + } + + public void sortByColumn(int n, boolean bl) { + Object[] objectArray = this.getColumnValues(n); + Object[] objectArray2 = this.exemptions.trim(); + SortUtil.sort((Object[])objectArray, (Object[])objectArray2, (boolean)bl); + this.exemptions.clear(); + this.exemptions.addAll(objectArray2); + this.updateTable(false); + } + + public int getRowCount() { + int n = 0; + if (this.exemptions != null) { + n = this.exemptions.size(); + } + return n; + } + + public NHostExemption exemption(int n) { + return (NHostExemption)this.exemptions.get(n); + } + + public Object getValueAt(int n, int n2) { + switch (n2) { + case 0: { + return this.exemption(n).getHost(); + } + case 2: { + return this.exemption(n).getApproved() ? lex.getText("exempt.field.approved.true") : lex.getText("exempt.field.approved.false"); + } + case 3: { + return this.exemption(n).getCreated(); + } + case 4: { + return this.exemption(n).getCertificate().getIssuer(); + } + case 1: { + return this.exemption(n).getCertificate().getSubject(); + } + case 5: { + return this.exemption(n).getCertificate().getNotBefore(); + } + case 6: { + return this.exemption(n).getCertificate().getNotAfter(); + } + case 7: { + return this.exemption(n).getCertificate().getKeyAlgorithm(); + } + case 8: { + return "" + this.exemption(n).getCertificate().getKeySize(); + } + case 9: { + return this.exemption(n).getCertificate().getSignatureAlgorithm(); + } + case 10: { + return "" + this.exemption(n).getCertificate().getSignatureSize(); + } + case 11: { + return this.exemption(n).getCertificate().checkValidity() ? lex.getText("cert.field.valid.true") : lex.getText("cert.field.valid.false"); + } + } + throw new IndexOutOfBoundsException(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.exemptions = null; + this.mgr = null; + } + + public ExemptionModel(ICoreExemptionStore iCoreExemptionStore) { + this.this(); + this.mgr = iCoreExemptionStore; + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class ViewCommand + extends Command { + public CommandArtifact doInvoke() { + try { + int n = BExemptionTable.this.exemptModel().getSelection().getRow(); + NHostExemption nHostExemption = BExemptionTable.this.exemptModel().exemption(n); + if (nHostExemption.getChanged() != null) { + if (BExemptionChangedDialog.show((BWidget)BExemptionTable.this, nHostExemption)) { + nHostExemption.approveChanged(); + BExemptionTable.this.mgr.setExemption(nHostExemption); + BExemptionTable.this.mgr.save(); + } + } else { + BExemptionViewDialog.show((BWidget)BExemptionTable.this, nHostExemption); + } + } + catch (Exception exception) { + CommandUtil.error((Command)this, (Throwable)exception); + } + return null; + } + + public ViewCommand() { + super((BWidget)BExemptionTable.this, lex, "exemption.button.view"); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class ApproveCommand + extends ApprovalCommand { + public String getTitle() { + return "exempt.approve.dialog.title"; + } + + public String getInfo() { + return "exempt.approve.dialog.info"; + } + + public boolean isApproved() { + return true; + } + + public ApproveCommand() { + super((BWidget)BExemptionTable.this, lex, "exemption.button.approve"); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class UnapproveCommand + extends ApprovalCommand { + public String getTitle() { + return "exempt.unapprove.dialog.title"; + } + + public String getInfo() { + return "exempt.unapprove.dialog.info"; + } + + public boolean isApproved() { + return false; + } + + public UnapproveCommand() { + super((BWidget)BExemptionTable.this, lex, "exemption.button.unapprove"); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class DeleteCommand + extends Command { + public CommandArtifact doInvoke() { + try { + if (4 == BDialog.confirm((BWidget)BExemptionTable.this, (String)lex.getText("exempt.delete.dialog.title"), (Object)lex.getText("exempt.delete.dialog.info"), (int)12)) { + int[] nArray = BExemptionTable.this.getSelection().getRows(); + int n = 0; + while (n < nArray.length) { + String string = BExemptionTable.this.exemptModel().exemption(nArray[n]).getHost(); + BExemptionTable.this.mgr.deleteExemption(string); + ++n; + } + BExemptionTable.this.mgr.save(); + BExemptionTable.this.exemptModel().load(); + } + } + catch (Exception exception) { + CommandUtil.error((Command)this, (Throwable)exception); + } + return null; + } + + public DeleteCommand() { + super((BWidget)BExemptionTable.this, lex, "exemption.button.delete"); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected abstract class ApprovalCommand + extends Command { + public abstract String getTitle(); + + public abstract String getInfo(); + + public abstract boolean isApproved(); + + public CommandArtifact doInvoke() { + try { + if (4 == BDialog.confirm((BWidget)BExemptionTable.this, (String)lex.getText(this.getTitle()), (Object)lex.getText(this.getInfo()), (int)12)) { + int[] nArray = BExemptionTable.this.getSelection().getRows(); + boolean bl = false; + int n = 0; + while (n < nArray.length) { + NHostExemption nHostExemption = BExemptionTable.this.exemptModel().exemption(nArray[n]); + boolean bl2 = this.isApproved(); + if (bl2 != nHostExemption.getApproved()) { + nHostExemption.setApproved(bl2); + BExemptionTable.this.mgr.setExemption(nHostExemption); + bl = true; + } + ++n; + } + if (bl) { + BExemptionTable.this.mgr.save(); + } + BExemptionTable.this.exemptModel().load(); + } + } + catch (Exception exception) { + CommandUtil.error((Command)this, (Throwable)exception); + } + return null; + } + + public ApprovalCommand(BWidget bWidget, Lexicon lexicon, String string) { + super(bWidget, lexicon, string); + } + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BExemptionViewDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BExemptionViewDialog.java new file mode 100644 index 0000000..8e8a95b --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BExemptionViewDialog.java @@ -0,0 +1,89 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NHostExemption + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BWidget + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.wizard.BWizardHeader + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NHostExemption; +import com.tridium.platcrypto.ui.BCertViewDialog; +import com.tridium.platcrypto.ui.BX509CertificatePane; +import java.util.Properties; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BWidget; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.wizard.BWizardHeader; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BExemptionViewDialog +extends BCertViewDialog { + public static final Type TYPE; + private NHostExemption hostExemption; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BExemptionViewDialog; + + public Type getType() { + return TYPE; + } + + public static void show(BWidget bWidget, NHostExemption nHostExemption) throws Exception { + BExemptionViewDialog bExemptionViewDialog = new BExemptionViewDialog(bWidget, nHostExemption); + bExemptionViewDialog.setBoundsCenteredOnOwner(); + bExemptionViewDialog.setResizable(false); + bExemptionViewDialog.open(); + } + + protected BWidget buildHeader() { + return new BWizardHeader(logo, this.cert.getSubject(), lex.getText("exempt.view.dialog.info", new Object[]{this.cert.getSubject()})); + } + + protected BWidget buildProperties() { + Properties properties = new Properties(); + properties.setProperty("exempt.field.host", this.hostExemption.getHost()); + properties.setProperty("exempt.field.approved", this.hostExemption.getApproved() ? lex.getText("exempt.field.approved.true") : lex.getText("exempt.field.approved.false")); + properties.setProperty("exempt.field.created", this.hostExemption.getCreated().toString()); + BX509CertificatePane bX509CertificatePane = new BX509CertificatePane(this.cert, properties, null); + return bX509CertificatePane; + } + + protected void appendProperties(BGridPane bGridPane) { + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + protected BExemptionViewDialog(BWidget bWidget, NHostExemption nHostExemption) throws Exception { + super(bWidget, lex.getText("exempt.view.dialog.title")); + this.hostExemption = nHostExemption; + this.cert = nHostExemption.getCertificate(); + this.setContent(this.buildDialog()); + this.setDefaultButton(this.okButton); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BExemptionViewDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BExemptionViewDialog = BExemptionViewDialog.class("[Lcom.tridium.platcrypto.ui.BExemptionViewDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BExportResponse.java b/modules/cfr_output/com/tridium/platcrypto/ui/BExportResponse.java new file mode 100644 index 0000000..4266cdb --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BExportResponse.java @@ -0,0 +1,124 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.security.BPassword + * javax.baja.sys.BStruct + * javax.baja.sys.BValue + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platcrypto.ui; + +import javax.baja.security.BPassword; +import javax.baja.sys.BStruct; +import javax.baja.sys.BValue; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BExportResponse +extends BStruct { + public static final Property exportCert = BExportResponse.newProperty((int)0, (boolean)true, null); + public static final Property exportPrivateKey = BExportResponse.newProperty((int)0, (boolean)false, null); + public static final Property privateKeyPassword = BExportResponse.newProperty((int)0, (BValue)BPassword.DEFAULT, null); + public static final Property encryptPrivateKey = BExportResponse.newProperty((int)0, (boolean)true, null); + public static final Property reusePassword = BExportResponse.newProperty((int)0, (boolean)true, null); + public static final Property privateKeySavedPassword = BExportResponse.newProperty((int)0, (BValue)BPassword.DEFAULT, null); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BExportResponse; + + public boolean getExportCert() { + return this.getBoolean(exportCert); + } + + public void setExportCert(boolean bl) { + this.setBoolean(exportCert, bl, null); + } + + public boolean getExportPrivateKey() { + return this.getBoolean(exportPrivateKey); + } + + public void setExportPrivateKey(boolean bl) { + this.setBoolean(exportPrivateKey, bl, null); + } + + public BPassword getPrivateKeyPassword() { + return (BPassword)this.get(privateKeyPassword); + } + + public void setPrivateKeyPassword(BPassword bPassword) { + this.set(privateKeyPassword, (BValue)bPassword, null); + } + + public boolean getEncryptPrivateKey() { + return this.getBoolean(encryptPrivateKey); + } + + public void setEncryptPrivateKey(boolean bl) { + this.setBoolean(encryptPrivateKey, bl, null); + } + + public boolean getReusePassword() { + return this.getBoolean(reusePassword); + } + + public void setReusePassword(boolean bl) { + this.setBoolean(reusePassword, bl, null); + } + + public BPassword getPrivateKeySavedPassword() { + return (BPassword)this.get(privateKeySavedPassword); + } + + public void setPrivateKeySavedPassword(BPassword bPassword) { + this.set(privateKeySavedPassword, (BValue)bPassword, null); + } + + public Type getType() { + return TYPE; + } + + public static BExportResponse make(boolean bl, boolean bl2, BPassword bPassword, boolean bl3, boolean bl4, BPassword bPassword2) { + return new BExportResponse(bl, bl2, bPassword, bl3, bl4, bPassword2); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BExportResponse() { + } + + private BExportResponse(boolean bl, boolean bl2, BPassword bPassword, boolean bl3, boolean bl4, BPassword bPassword2) { + this.setExportCert(bl); + this.setExportPrivateKey(bl2); + this.setPrivateKeyPassword(bPassword); + this.setEncryptPrivateKey(bl3); + this.setReusePassword(bl4); + this.setPrivateKeySavedPassword(bPassword2); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BExportResponse; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BExportResponse = BExportResponse.class("[Lcom.tridium.platcrypto.ui.BExportResponse;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BLocalCertsTable.java b/modules/cfr_output/com/tridium/platcrypto/ui/BLocalCertsTable.java new file mode 100644 index 0000000..7b1bd92 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BLocalCertsTable.java @@ -0,0 +1,337 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.crypto.core.io.ICoreKeyStore + * com.tridium.platform.ui.util.BCommandEnablePolicy + * com.tridium.platform.ui.util.CommandBindings$Support + * com.tridium.platform.ui.util.CommandUtil + * javax.baja.file.BIFile + * javax.baja.file.IFileFilter + * javax.baja.gx.BImage + * javax.baja.naming.BOrd + * javax.baja.nre.util.Array + * javax.baja.security.BPassword + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.file.BFileChooser + * javax.baja.ui.file.ExtFileFilter + * javax.baja.ui.pane.BConstrainedPane + * org.bouncycastle.jce.PKCS10CertificationRequest + * org.bouncycastle.openssl.PEMWriter + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.crypto.core.io.ICoreKeyStore; +import com.tridium.platcrypto.ui.BCertImportDialog; +import com.tridium.platcrypto.ui.BCertRequestDialog; +import com.tridium.platcrypto.ui.BCertsTable; +import com.tridium.platcrypto.ui.BPasswordPromptDialog; +import com.tridium.platcrypto.ui.BPrivateKeyPasswordDialog; +import com.tridium.platcrypto.ui.BSelfSignedDialog; +import com.tridium.platform.ui.util.BCommandEnablePolicy; +import com.tridium.platform.ui.util.CommandBindings; +import com.tridium.platform.ui.util.CommandUtil; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.security.Key; +import java.security.PrivateKey; +import java.security.UnrecoverableKeyException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Enumeration; +import javax.baja.file.BIFile; +import javax.baja.file.IFileFilter; +import javax.baja.gx.BImage; +import javax.baja.naming.BOrd; +import javax.baja.nre.util.Array; +import javax.baja.security.BPassword; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.file.BFileChooser; +import javax.baja.ui.file.ExtFileFilter; +import javax.baja.ui.pane.BConstrainedPane; +import org.bouncycastle.jce.PKCS10CertificationRequest; +import org.bouncycastle.openssl.PEMWriter; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BLocalCertsTable +extends BCertsTable { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BLocalCertsTable; + + public Type getType() { + return TYPE; + } + + protected void initCommands() { + this.getCommandBindings().setSupport((CommandBindings.Support)this); + BCertsTable.ViewCommand viewCommand = new BCertsTable.ViewCommand(); + this.addCommand(viewCommand, BCommandEnablePolicy.singleSelection); + this.setDoubleClickCommand(viewCommand); + this.addCommand(new NewCommand(), BCommandEnablePolicy.always); + this.addCommand(new CsrCommand(), BCommandEnablePolicy.singleSelection); + this.addCommand(new BCertsTable.DeleteCommand(), BCommandEnablePolicy.anySelection); + this.addCommand(new LocalImportCommand(), BCommandEnablePolicy.always); + this.addCommand(new BCertsTable.ExportCommand(), BCommandEnablePolicy.singleSelection); + this.addCommand(new ResetCommand(), BCommandEnablePolicy.always); + this.setCommandEnabledStates(); + } + + private final void certGenRequest(BWidget bWidget) { + BCertsTable.CertGenRequest certGenRequest = BSelfSignedDialog.show(bWidget, this.mgr); + if (certGenRequest != null) { + this.certGenRequests.put(certGenRequest.getRequestId(), (Object)certGenRequest); + this.checkCertMonitorThread(); + BDialog.info((BWidget)bWidget, (Object)lex.get("cert.generate.notify.msg")); + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BLocalCertsTable() throws UnsupportedOperationException { + throw new UnsupportedOperationException(); + } + + public BLocalCertsTable(ICoreKeyStore iCoreKeyStore) throws Exception { + super(iCoreKeyStore); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BLocalCertsTable; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BLocalCertsTable = BLocalCertsTable.class("[Lcom.tridium.platcrypto.ui.BLocalCertsTable;", false); + } + TYPE = Sys.loadType((Class)clazz); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class NewCommand + extends Command { + public CommandArtifact doInvoke() { + if (!BLocalCertsTable.this.mgr.canGenerateCertificate()) { + BDialog.open((BWidget)BLocalCertsTable.this.getParentWidget(), (String)lex.getText("station.running.dialog.title"), (Object)lex.getText("station.running.dialog.message"), (int)1, (BImage)BDialog.WARNING_ICON, null); + } else { + BLocalCertsTable.this.certGenRequest(this.getOwner()); + } + return null; + } + + public NewCommand() { + super((BWidget)BLocalCertsTable.this, lex, "cert.button.new"); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class CsrCommand + extends Command { + public CommandArtifact doInvoke() { + block7: { + try { + BPassword bPassword; + PrivateKey privateKey; + int n = BLocalCertsTable.this.certModel().getSelection().getRow(); + if (!BCertRequestDialog.request(this.getOwner(), BLocalCertsTable.this.certModel().cert(n).getCertificate(0))) break block7; + String string = BLocalCertsTable.this.certModel().cert(n).getAlias(); + String string2 = null; + try { + privateKey = (PrivateKey)BLocalCertsTable.this.mgr.getKey(string, null); + } + catch (UnrecoverableKeyException unrecoverableKeyException) { + bPassword = BPasswordPromptDialog.open(this.getOwner(), lex.getText("cert.pkey.dialog.title"), lex.getText("cert.pkey.dialog.info")); + if (bPassword == null) { + return null; + } + string2 = bPassword.getValue(); + } + privateKey = BLocalCertsTable.this.mgr.generateCSR(string, string2); + if (privateKey != null) { + bPassword = BFileChooser.makeSave((BWidget)this.getOwner()); + bPassword.addFilter((IFileFilter)new ExtFileFilter(lex.getText("csr.extension.info"), "csr")); + bPassword.setTitle(lex.getText(lex.getText("csr.filechooser.dialog.title"))); + bPassword.setDefaultFileName(string + ".csr"); + bPassword.setCurrentDirectory(BOrd.make((String)("file:/" + BLocalCertsTable.getCertsDirectoryPath()))); + BOrd bOrd = bPassword.show(); + if (bOrd == null) { + return null; + } + BIFile bIFile = (BIFile)bOrd.get(); + PEMWriter pEMWriter = new PEMWriter((Writer)new OutputStreamWriter(bIFile.getOutputStream())); + pEMWriter.writeObject((Object)new PKCS10CertificationRequest(privateKey.getRequest().getEncoded())); + pEMWriter.close(); + BConstrainedPane bConstrainedPane = new BConstrainedPane((BWidget)new BLabel(lex.getText("csr.generate.complete"))); + bConstrainedPane.setMinWidth(200.0); + BDialog.info((BWidget)this.getOwner(), (String)lex.getText("csr.extension.info"), (Object)bConstrainedPane); + } + } + catch (Exception exception) { + CommandUtil.error((Command)this, (Throwable)exception); + } + } + return null; + } + + public CsrCommand() { + super((BWidget)BLocalCertsTable.this, lex, "cert.button.csr"); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class LocalImportCommand + extends BCertsTable.ImportCommand { + protected void importCertData(Array array, PrivateKey privateKey, String string) throws Exception { + X509Certificate[] x509CertificateArray = (X509Certificate[])array.trim(); + if (x509CertificateArray.length <= 0) { + BDialog.warning((BWidget)this.getOwner(), (String)lex.get("cert.import.certificate.missing.title"), (Object)lex.get("cert.import.certificate.missing.msg")); + return; + } + NX509Certificate nX509Certificate = NX509Certificate.make((X509Certificate)x509CertificateArray[0]); + String string2 = BLocalCertsTable.this.mgr.findCertificate((X509Certificate)array.get(0)); + if (string2 != null) { + string2 = BCertImportDialog.prompt(this.getOwner(), nX509Certificate, string2, true); + if (string2 == null) { + return; + } + if (nX509Certificate.getCertificate().getBasicConstraints() >= 0) { + BPassword bPassword = BPrivateKeyPasswordDialog.open(this.getOwner()); + if (bPassword == null) { + return; + } + if (privateKey == null && (privateKey = (PrivateKey)BLocalCertsTable.this.mgr.getKey(string2, bPassword.getValue().toCharArray())) == null) { + BDialog.warning((BWidget)this.getOwner(), (String)lex.get("cert.import.privatekey.missing.title"), (Object)lex.get("cert.import.privatekey.missing.msg")); + return; + } + BLocalCertsTable.this.mgr.setKeyEntry(string2, (Key)privateKey, bPassword.getValue().toCharArray(), x509CertificateArray); + } else { + if (privateKey == null && (privateKey = (PrivateKey)BLocalCertsTable.this.mgr.getKey(string2, null)) == null) { + BDialog.warning((BWidget)this.getOwner(), (String)lex.get("cert.import.privatekey.missing.title"), (Object)lex.get("cert.import.privatekey.missing.msg")); + return; + } + BLocalCertsTable.this.mgr.setKeyEntry(string2, (Key)privateKey, null, x509CertificateArray); + } + } else { + string2 = BCertImportDialog.prompt(this.getOwner(), nX509Certificate, string, false); + if (string2 == null) { + return; + } + if (string2.trim().length() <= 0) { + BDialog.warning((BWidget)this.getOwner(), (String)lex.get("cert.import.alias.missing.title"), (Object)lex.get("cert.import.alias.missing.msg")); + return; + } + X509Certificate x509Certificate = BLocalCertsTable.this.mgr.getCertificate(string2); + if (x509Certificate != null && !x509Certificate.getPublicKey().equals(nX509Certificate.getPublicKey())) { + BDialog.warning((BWidget)this.getOwner(), (String)lex.get("cert.import.privatekey.mismatch.title"), (Object)lex.get("cert.import.privatekey.mismatch.msg")); + return; + } + if (nX509Certificate.getCertificate().getBasicConstraints() >= 0) { + BPassword bPassword = BPrivateKeyPasswordDialog.open(this.getOwner()); + if (bPassword == null) { + return; + } + if (privateKey == null && (privateKey = (PrivateKey)BLocalCertsTable.this.mgr.getKey(string2, bPassword.getValue().toCharArray())) == null) { + BDialog.warning((BWidget)this.getOwner(), (String)lex.get("cert.import.privatekey.missing.title"), (Object)lex.get("cert.import.privatekey.missing.msg")); + return; + } + BLocalCertsTable.this.mgr.setKeyEntry(string2, (Key)privateKey, bPassword.getValue().toCharArray(), x509CertificateArray); + } else { + if (privateKey == null) { + try { + privateKey = (PrivateKey)BLocalCertsTable.this.mgr.getKey(string2, null); + } + catch (Exception exception) {} + if (privateKey == null) { + BDialog.warning((BWidget)this.getOwner(), (String)lex.get("cert.import.privatekey.missing.title"), (Object)lex.get("cert.import.privatekey.missing.msg")); + return; + } + } + BLocalCertsTable.this.mgr.setKeyEntry(string2, (Key)privateKey, null, x509CertificateArray); + } + } + } + + protected LocalImportCommand() { + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class ResetCommand + extends Command { + public CommandArtifact doInvoke() { + try { + if (4 == BDialog.confirm((BWidget)BLocalCertsTable.this, (String)lex.getText("cert.reset.dialog.title"), (Object)lex.getText("cert.reset.dialog.info"), (int)12)) { + Enumeration enumeration = BLocalCertsTable.this.mgr.aliases(); + ArrayList arrayList = new ArrayList(); + while (enumeration.hasMoreElements()) { + arrayList.add((String)enumeration.nextElement()); + } + BLocalCertsTable.this.mgr.deleteEntries(arrayList.toArray(new String[0])); + BLocalCertsTable.this.mgr.save(); + BLocalCertsTable.this.certModel().load(); + Calendar calendar = Calendar.getInstance(); + Date date = calendar.getTime(); + calendar.set(1, calendar.get(1) + 1); + Date date2 = calendar.getTime(); + if (!BLocalCertsTable.this.mgr.canGenerateCertificate()) { + BDialog.open((BWidget)BLocalCertsTable.this.getParentWidget(), (String)lex.getText("station.running.dialog.title"), (Object)lex.getText("station.running.dialog.message"), (int)1, (BImage)BDialog.WARNING_ICON, null); + } else { + String string = "tridium"; + int n = BLocalCertsTable.this.mgr.generateSelfSignedCert(string, "CN=NiagaraAX,O=Tridium,C=US", date, date2, 1024, 160, null, null); + if (n != -1) { + BCertsTable.CertGenRequest certGenRequest = new BCertsTable.CertGenRequest(n, string); + BLocalCertsTable.this.certGenRequests.put(n, (Object)certGenRequest); + BLocalCertsTable.this.checkCertMonitorThread(); + BDialog.info((BWidget)this.getOwner(), (Object)lex.get("cert.generate.notify.msg")); + } else { + log.message("cert generation failed for " + string); + BLocalCertsTable.this.notify(lex.get("cert.generate.title"), failedIcon, lex.get("cert.generate.failed"), lex.getText("cert.generate.failed.msg", (Object[])new String[]{string})); + } + } + } + } + catch (Exception exception) { + CommandUtil.error((Command)this, (Throwable)exception); + } + return null; + } + + public ResetCommand() { + super((BWidget)BLocalCertsTable.this, lex, "cert.button.reset"); + } + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BPasswordField.java b/modules/cfr_output/com/tridium/platcrypto/ui/BPasswordField.java new file mode 100644 index 0000000..fb30fd8 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BPasswordField.java @@ -0,0 +1,87 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.security.BPassword + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BTextField + * javax.baja.ui.text.PasswordRenderer + * javax.baja.ui.text.PasswordTextController + * javax.baja.ui.text.TextController + * javax.baja.ui.text.TextRenderer + */ +package com.tridium.platcrypto.ui; + +import javax.baja.security.BPassword; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BTextField; +import javax.baja.ui.text.PasswordRenderer; +import javax.baja.ui.text.PasswordTextController; +import javax.baja.ui.text.TextController; +import javax.baja.ui.text.TextRenderer; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPasswordField +extends BTextField { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BPasswordField; + + public Type getType() { + return TYPE; + } + + public BPassword getPassword() { + return BPassword.make((String)this.getText()); + } + + private final void initPasswordField() { + this.setRenderer((TextRenderer)new PasswordRenderer()); + this.setController((TextController)new PasswordTextController()); + this.setAllowCopying(false); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BPasswordField(String string, int n, boolean bl) { + super(string, n, bl); + this.initPasswordField(); + } + + public BPasswordField(String string, int n) { + super(string, n); + this.initPasswordField(); + } + + public BPasswordField(String string) { + super(string); + this.initPasswordField(); + } + + public BPasswordField() { + this.initPasswordField(); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BPasswordField; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BPasswordField = BPasswordField.class("[Lcom.tridium.platcrypto.ui.BPasswordField;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BPasswordPromptDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BPasswordPromptDialog.java new file mode 100644 index 0000000..d9de63e --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BPasswordPromptDialog.java @@ -0,0 +1,189 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.gx.BImage + * javax.baja.security.BPassword + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BWidgetEvent + * javax.baja.ui.event.BWindowEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.util.UiLexicon + * javax.baja.ui.wizard.BWizardHeader + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.ui; + +import com.tridium.platcrypto.ui.BPasswordField; +import javax.baja.gx.BImage; +import javax.baja.security.BPassword; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BWidgetEvent; +import javax.baja.ui.event.BWindowEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.ui.wizard.BWizardHeader; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPasswordPromptDialog +extends BDialog { + public static final Action okButtonPressed = BPasswordPromptDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Action cancelButtonPressed = BPasswordPromptDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Type TYPE; + private static Lexicon lex; + private static final BImage logo; + protected BButton okButton; + protected BButton cancelButton; + private BPasswordField passwordField; + private BPassword response; + private String msg; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BPasswordPromptDialog; + + public void okButtonPressed(BWidgetEvent bWidgetEvent) { + this.invoke(okButtonPressed, (BValue)bWidgetEvent, null); + } + + public void cancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.invoke(cancelButtonPressed, (BValue)bWidgetEvent, null); + } + + public Type getType() { + return TYPE; + } + + public static BPassword open(BWidget bWidget, String string, String string2) { + BPasswordPromptDialog bPasswordPromptDialog = new BPasswordPromptDialog(bWidget, string, string2); + bPasswordPromptDialog.setBoundsCenteredOnOwner(); + bPasswordPromptDialog.setResizable(false); + bPasswordPromptDialog.open(); + return bPasswordPromptDialog.getPassword(); + } + + private final BWidget buildDialog() { + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop(this.buildHeader()); + bEdgePane.setCenter(this.buildContent()); + return bEdgePane; + } + + private final BWidget buildHeader() { + return new BWizardHeader(logo, this.getTitle(), this.msg); + } + + private final BWidget buildContent() { + BGridPane bGridPane = new BGridPane(1); + bGridPane.setHalign(BHalign.center); + bGridPane.setColumnAlign(BHalign.center); + bGridPane.add(null, (BValue)this.buildBody()); + bGridPane.add(null, (BValue)this.buildButtons()); + return new BBorderPane((BWidget)bGridPane, 17.0, 7.0, 7.0, 7.0); + } + + private final BWidget buildBody() { + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setLeft((BWidget)new BLabel(lex.get("password.field.password"))); + this.passwordField = new BPasswordField(); + bEdgePane.setCenter((BWidget)new BBorderPane((BWidget)this.passwordField, (double)4, (double)4, (double)4, (double)4)); + return bEdgePane; + } + + private final BWidget buildButtons() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + this.okButton = new BButton(UiLexicon.bajaui().getText("dialog.ok")); + bGridPane.add(null, (BValue)this.okButton); + this.okButton.setPreferredSize(50.0, this.okButton.getPreferredHeight()); + this.linkTo("linkA", (BComponent)this.okButton, (Slot)BButton.actionPerformed, (Slot)okButtonPressed); + this.okButton.setEnabled(false); + this.cancelButton = new BButton(UiLexicon.bajaui().getText("dialog.cancel")); + bGridPane.add(null, (BValue)this.cancelButton); + this.cancelButton.setPreferredSize(50.0, this.cancelButton.getPreferredHeight()); + this.linkTo("linkC", (BComponent)this.cancelButton, (Slot)BButton.actionPerformed, (Slot)cancelButtonPressed); + return new BBorderPane((BWidget)bGridPane, 7.0, 0.0, 0.0, 0.0); + } + + public void windowClosing(BWindowEvent bWindowEvent) { + this.close(); + } + + public BPassword getPassword() { + return this.response; + } + + public void doOkButtonPressed(BWidgetEvent bWidgetEvent) throws Exception { + this.response = this.passwordField.getPassword(); + this.close(); + } + + public void doCancelButtonPressed(BWidgetEvent bWidgetEvent) throws Exception { + this.response = null; + this.close(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.passwordField = null; + this.response = null; + this.msg = null; + } + + private BPasswordPromptDialog(BWidget bWidget, String string, String string2) { + super(bWidget, string, true); + this.this(); + this.msg = string2; + this.setContent(this.buildDialog()); + this.setDefaultButton(this.okButton); + this.okButton.setEnabled(true); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BPasswordPromptDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BPasswordPromptDialog = BPasswordPromptDialog.class("[Lcom.tridium.platcrypto.ui.BPasswordPromptDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"platCrypto"); + logo = BImage.make((String)lex.get("cert.x32.icon", "module://icons/x32/lock.png")); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BPemFileView.java b/modules/cfr_output/com/tridium/platcrypto/ui/BPemFileView.java new file mode 100644 index 0000000..22e8b28 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BPemFileView.java @@ -0,0 +1,194 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NKey + * com.tridium.crypto.core.cert.NPKCS10CertificationRequest + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.crypto.core.util.FriendlyPemReader + * javax.baja.gx.BImage + * javax.baja.sys.BObject + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BWidget + * javax.baja.ui.pane.BTextEditorPane + * javax.baja.ui.text.BTextEditor + * javax.baja.ui.wizard.BWizardHeader + * javax.baja.util.Lexicon + * javax.baja.workbench.CannotSaveException + * javax.baja.workbench.view.BWbView + * org.bouncycastle.cert.X509CertificateHolder + * org.bouncycastle.cert.jcajce.JcaX509CertificateConverter + * org.bouncycastle.jce.provider.BouncyCastleProvider + * org.bouncycastle.openssl.PEMDecryptorProvider + * org.bouncycastle.openssl.PEMEncryptedKeyPair + * org.bouncycastle.openssl.PEMKeyPair + * org.bouncycastle.openssl.PEMParser + * org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter + * org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder + * org.bouncycastle.pkcs.PKCS10CertificationRequest + * org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NKey; +import com.tridium.crypto.core.cert.NPKCS10CertificationRequest; +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.crypto.core.util.FriendlyPemReader; +import com.tridium.platcrypto.ui.PrivateKeyPasswordFinder; +import com.tridium.platcrypto.util.BPemFile; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.security.Key; +import java.security.KeyPair; +import java.security.Provider; +import java.security.cert.Certificate; +import java.security.cert.X509Certificate; +import javax.baja.gx.BImage; +import javax.baja.sys.BObject; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BWidget; +import javax.baja.ui.pane.BTextEditorPane; +import javax.baja.ui.text.BTextEditor; +import javax.baja.ui.wizard.BWizardHeader; +import javax.baja.util.Lexicon; +import javax.baja.workbench.CannotSaveException; +import javax.baja.workbench.view.BWbView; +import org.bouncycastle.cert.X509CertificateHolder; +import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.bouncycastle.openssl.PEMDecryptorProvider; +import org.bouncycastle.openssl.PEMEncryptedKeyPair; +import org.bouncycastle.openssl.PEMKeyPair; +import org.bouncycastle.openssl.PEMParser; +import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter; +import org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder; +import org.bouncycastle.pkcs.PKCS10CertificationRequest; +import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPemFileView +extends BWbView { + public static final Type TYPE; + protected static Lexicon lex; + protected static BImage logo; + public BTextEditorPane pane; + public BTextEditor editor; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BPemFileView; + + public Type getType() { + return TYPE; + } + + protected BWidget buildHeader() { + return new BWizardHeader(logo, lex.getText("pem.file.viewer.title")); + } + + protected void doLoadValue(BObject bObject, Context context) throws Exception { + super.doLoadValue(bObject, context); + StringBuffer stringBuffer = new StringBuffer(); + BPemFile bPemFile = (BPemFile)bObject; + InputStream inputStream = bPemFile.getInputStream(); + InputStreamReader inputStreamReader = new InputStreamReader(inputStream); + FriendlyPemReader friendlyPemReader = new FriendlyPemReader((Reader)inputStreamReader); + PEMParser pEMParser = new PEMParser((Reader)friendlyPemReader); + int n = 0; + while (n < 50) { + try { + NPKCS10CertificationRequest nPKCS10CertificationRequest; + Object object; + Object object2 = pEMParser.readObject(); + if (object2 == null) break; + if (object2 instanceof X509Certificate) { + object = NX509Certificate.make((X509Certificate)((X509Certificate)object2)); + stringBuffer.append(object.toString()); + } else if (object2 instanceof X509CertificateHolder) { + object = new JcaX509CertificateConverter().getCertificate((X509CertificateHolder)object2); + stringBuffer.append(((Certificate)object).toString()); + } else if (object2 instanceof PKCS10CertificationRequest) { + object = new JcaPKCS10CertificationRequest(((PKCS10CertificationRequest)object2).getEncoded()); + nPKCS10CertificationRequest = NPKCS10CertificationRequest.make((JcaPKCS10CertificationRequest)object); + stringBuffer.append(nPKCS10CertificationRequest.toString()); + } else if (object2 instanceof Key) { + stringBuffer.append(NKey.toString((Key)((Key)object2))); + } else if (object2 instanceof KeyPair) { + object = (KeyPair)object2; + stringBuffer.append(NKey.toString((Key)((KeyPair)object).getPrivate())); + stringBuffer.append(NKey.toString((Key)((KeyPair)object).getPublic())); + } else if (object2 instanceof PEMKeyPair) { + object = (PEMKeyPair)object2; + nPKCS10CertificationRequest = new JcaPEMKeyConverter().setProvider((Provider)new BouncyCastleProvider()); + stringBuffer.append(NKey.toString((Key)nPKCS10CertificationRequest.getPrivateKey(object.getPrivateKeyInfo()))); + stringBuffer.append(NKey.toString((Key)nPKCS10CertificationRequest.getPublicKey(object.getPublicKeyInfo()))); + } else if (object2 instanceof PEMEncryptedKeyPair) { + object = new JcePEMDecryptorProviderBuilder().setProvider((Provider)new BouncyCastleProvider()); + nPKCS10CertificationRequest = object.build(new PrivateKeyPasswordFinder((BWidget)this).getPassword()); + JcaPEMKeyConverter jcaPEMKeyConverter = new JcaPEMKeyConverter().setProvider((Provider)new BouncyCastleProvider()); + PEMKeyPair pEMKeyPair = ((PEMEncryptedKeyPair)object2).decryptKeyPair((PEMDecryptorProvider)nPKCS10CertificationRequest); + stringBuffer.append(NKey.toString((Key)jcaPEMKeyConverter.getPrivateKey(pEMKeyPair.getPrivateKeyInfo()))); + stringBuffer.append(NKey.toString((Key)jcaPEMKeyConverter.getPublicKey(pEMKeyPair.getPublicKeyInfo()))); + } else { + stringBuffer.append("unrecognized object: " + object2.getClass().getName() + '\n'); + stringBuffer.append(object2.toString()); + } + stringBuffer.append("\n"); + } + catch (Exception exception) { + ++n; + stringBuffer.append("error parsing object: " + exception.getLocalizedMessage()).append("\n"); + } + } + try { + if (pEMParser != null) { + pEMParser.close(); + } + } + catch (Exception exception) {} + this.editor.setEditable(false); + this.editor.setText(stringBuffer.toString()); + } + + protected BObject doSaveValue(BObject bObject, Context context) throws CannotSaveException, Exception { + return super.doSaveValue(bObject, context); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.pane = new BTextEditorPane("", 80, 40, true); + this.editor = this.pane.getEditor(); + } + + public BPemFileView() { + this.this(); + this.setContent((BWidget)this.pane); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BPemFileView; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BPemFileView = BPemFileView.class("[Lcom.tridium.platcrypto.ui.BPemFileView;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"platCrypto"); + logo = BImage.make((String)lex.get("cert.x32.icon", "module://crypto/icons/x32/cert.png")); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BPrivateKeyPasswordDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BPrivateKeyPasswordDialog.java new file mode 100644 index 0000000..a11f456 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BPrivateKeyPasswordDialog.java @@ -0,0 +1,213 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.gx.BImage + * javax.baja.security.BPassword + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BWidgetEvent + * javax.baja.ui.event.BWindowEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.util.UiLexicon + * javax.baja.ui.wizard.BWizardHeader + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.ui; + +import com.tridium.platcrypto.ui.BPasswordField; +import javax.baja.gx.BImage; +import javax.baja.security.BPassword; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BWidgetEvent; +import javax.baja.ui.event.BWindowEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.ui.wizard.BWizardHeader; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPrivateKeyPasswordDialog +extends BDialog { + public static final Action okButtonPressed = BPrivateKeyPasswordDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Action cancelButtonPressed = BPrivateKeyPasswordDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Action setModified = BPrivateKeyPasswordDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Type TYPE; + private static Lexicon lex; + private static final BImage logo; + protected BButton okButton; + protected BButton cancelButton; + private BPassword password; + private BPasswordField passwordField; + private BPasswordField confirmField; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BPrivateKeyPasswordDialog; + + public void okButtonPressed(BWidgetEvent bWidgetEvent) { + this.invoke(okButtonPressed, (BValue)bWidgetEvent, null); + } + + public void cancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.invoke(cancelButtonPressed, (BValue)bWidgetEvent, null); + } + + public void setModified(BWidgetEvent bWidgetEvent) { + this.invoke(setModified, (BValue)bWidgetEvent, null); + } + + public Type getType() { + return TYPE; + } + + public static BPassword open(BWidget bWidget) { + BPrivateKeyPasswordDialog bPrivateKeyPasswordDialog = new BPrivateKeyPasswordDialog(bWidget); + bPrivateKeyPasswordDialog.setBoundsCenteredOnOwner(); + bPrivateKeyPasswordDialog.setResizable(false); + bPrivateKeyPasswordDialog.open(); + return bPrivateKeyPasswordDialog.getPassword(); + } + + private final BWidget buildDialog() { + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop(this.buildHeader()); + bEdgePane.setCenter(this.buildContent()); + return bEdgePane; + } + + private final BWidget buildHeader() { + return new BWizardHeader(logo, this.getTitle(), lex.get("cert.export.privatekey.title")); + } + + private final BWidget buildContent() { + BGridPane bGridPane = new BGridPane(1); + bGridPane.setHalign(BHalign.center); + bGridPane.setColumnAlign(BHalign.center); + bGridPane.add(null, (BValue)new BLabel(lex.get("cert.export.password.prompt"), BHalign.left)); + bGridPane.add(null, (BValue)this.buildBody()); + bGridPane.add(null, (BValue)this.buildButtons()); + return new BBorderPane((BWidget)bGridPane, 7.0, 7.0, 7.0, 7.0); + } + + private final BWidget buildBody() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.setRowGap((double)5); + bGridPane.setColumnGap((double)5); + bGridPane.setColumnAlign(BHalign.left); + bGridPane.setStretchColumn(1); + bGridPane.add(null, (BValue)new BLabel(lex.get("password.field.password"))); + this.passwordField = new BPasswordField(); + bGridPane.add(null, (BValue)this.passwordField); + bGridPane.add(null, (BValue)new BLabel(lex.get("password.field.confirm"))); + this.confirmField = new BPasswordField(); + bGridPane.add(null, (BValue)this.confirmField); + this.linkTo(null, (BComponent)this.passwordField, (Slot)BPasswordField.textModified, (Slot)setModified); + this.linkTo(null, (BComponent)this.confirmField, (Slot)BPasswordField.textModified, (Slot)setModified); + return bGridPane; + } + + private final BWidget buildButtons() { + BGridPane bGridPane = new BGridPane(3); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + this.okButton = new BButton(UiLexicon.bajaui().getText("dialog.ok")); + bGridPane.add(null, (BValue)this.okButton); + this.linkTo("linkA", (BComponent)this.okButton, (Slot)BButton.actionPerformed, (Slot)okButtonPressed); + this.okButton.setEnabled(false); + this.cancelButton = new BButton(UiLexicon.bajaui().getText("dialog.cancel")); + bGridPane.add(null, (BValue)this.cancelButton); + this.linkTo("linkC", (BComponent)this.cancelButton, (Slot)BButton.actionPerformed, (Slot)cancelButtonPressed); + return new BBorderPane((BWidget)bGridPane, 7.0, 0.0, 0.0, 0.0); + } + + public void windowClosing(BWindowEvent bWindowEvent) { + this.close(); + } + + public BPassword getPassword() { + return this.password; + } + + public void doOkButtonPressed(BWidgetEvent bWidgetEvent) throws Exception { + this.password = BPassword.make((String)this.confirmField.getText()); + this.close(); + } + + public void doCancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.close(); + } + + public void doSetModified(BWidgetEvent bWidgetEvent) { + try { + if (this.passwordField.getText().equals(this.confirmField.getText())) { + this.okButton.setEnabled(true); + } else { + this.okButton.setEnabled(false); + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.password = null; + this.passwordField = null; + this.confirmField = null; + } + + private BPrivateKeyPasswordDialog(BWidget bWidget) { + super(bWidget, "Private Key Password", true); + this.this(); + this.setContent(this.buildDialog()); + this.setDefaultButton(this.okButton); + this.okButton.setEnabled(true); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BPrivateKeyPasswordDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BPrivateKeyPasswordDialog = BPrivateKeyPasswordDialog.class("[Lcom.tridium.platcrypto.ui.BPrivateKeyPasswordDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"platCrypto"); + logo = BImage.make((String)lex.get("cert.x32.icon", "module://icons/x32/lock.png")); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BSelfSignedDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BSelfSignedDialog.java new file mode 100644 index 0000000..22c4d97 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BSelfSignedDialog.java @@ -0,0 +1,440 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.io.ICoreKeyStore + * com.tridium.workbench.fieldeditors.BAbsTimeFE + * javax.baja.gx.BImage + * javax.baja.security.BPassword + * javax.baja.sys.Action + * javax.baja.sys.BAbsTime + * javax.baja.sys.BComponent + * javax.baja.sys.BObject + * javax.baja.sys.BRelTime + * javax.baja.sys.BValue + * javax.baja.sys.Clock + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BDialog + * javax.baja.ui.BLabel + * javax.baja.ui.BRadioButton + * javax.baja.ui.BTextField + * javax.baja.ui.BWidget + * javax.baja.ui.ToggleCommandGroup + * javax.baja.ui.enums.BHalign + * javax.baja.ui.event.BWidgetEvent + * javax.baja.ui.event.BWindowEvent + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.util.UiLexicon + * javax.baja.ui.wizard.BWizardHeader + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.io.ICoreKeyStore; +import com.tridium.platcrypto.ui.BCertsTable; +import com.tridium.platcrypto.ui.BPrivateKeyPasswordDialog; +import com.tridium.workbench.fieldeditors.BAbsTimeFE; +import java.security.cert.X509Certificate; +import java.util.Date; +import java.util.Locale; +import javax.baja.gx.BImage; +import javax.baja.security.BPassword; +import javax.baja.sys.Action; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BComponent; +import javax.baja.sys.BObject; +import javax.baja.sys.BRelTime; +import javax.baja.sys.BValue; +import javax.baja.sys.Clock; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BDialog; +import javax.baja.ui.BLabel; +import javax.baja.ui.BRadioButton; +import javax.baja.ui.BTextField; +import javax.baja.ui.BWidget; +import javax.baja.ui.ToggleCommandGroup; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.event.BWidgetEvent; +import javax.baja.ui.event.BWindowEvent; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.util.UiLexicon; +import javax.baja.ui.wizard.BWizardHeader; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BSelfSignedDialog +extends BDialog { + public static final Action okButtonPressed = BSelfSignedDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Action cancelButtonPressed = BSelfSignedDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Action setModified = BSelfSignedDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); + public static final Type TYPE; + private static Lexicon lex; + private static final BImage logo; + private BTextField alias; + private BTextField cn; + private BTextField ou; + private BTextField o; + private BTextField l; + private BTextField st; + private BTextField c; + private BAbsTimeFE starts; + private BAbsTimeFE ends; + private BRadioButton keySize1024; + private BRadioButton keySize2048; + private BRadioButton keySize3072; + private BRadioButton keySize4096; + private BRadioButton serverCert; + private BRadioButton caCert; + private BTextField emailAltName; + private BPassword pkPassword; + private BButton okButton; + private BButton cancelButton; + private ICoreKeyStore mgr; + private int keySize; + private int keyUsage; + private boolean canceled; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BSelfSignedDialog; + + public void okButtonPressed(BWidgetEvent bWidgetEvent) { + this.invoke(okButtonPressed, (BValue)bWidgetEvent, null); + } + + public void cancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.invoke(cancelButtonPressed, (BValue)bWidgetEvent, null); + } + + public void setModified(BWidgetEvent bWidgetEvent) { + this.invoke(setModified, (BValue)bWidgetEvent, null); + } + + public Type getType() { + return TYPE; + } + + public static BCertsTable.CertGenRequest show(BWidget bWidget, ICoreKeyStore iCoreKeyStore) { + BSelfSignedDialog bSelfSignedDialog = new BSelfSignedDialog(bWidget, iCoreKeyStore); + bSelfSignedDialog.setBoundsCenteredOnOwner(); + bSelfSignedDialog.setResizable(false); + bSelfSignedDialog.open(); + return bSelfSignedDialog.getResult(); + } + + private final BWidget buildDialog() { + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop(this.buildHeader()); + bEdgePane.setCenter(this.buildContent()); + return bEdgePane; + } + + private final BWidget buildHeader() { + return new BWizardHeader(logo, this.getTitle(), lex.getText("cert.generate.dialog.info")); + } + + private final BWidget buildContent() { + BGridPane bGridPane = new BGridPane(1); + bGridPane.setHalign(BHalign.center); + bGridPane.setColumnAlign(BHalign.center); + bGridPane.add(null, (BValue)this.buildBody()); + bGridPane.add(null, (BValue)this.buildButtons()); + return new BBorderPane((BWidget)bGridPane, 7.0, 7.0, 7.0, 7.0); + } + + private final BWidget buildDnTextField(BTextField bTextField, boolean bl) { + BGridPane bGridPane = new BGridPane(2); + bGridPane.setStretchColumn(0); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.add(null, (BValue)bTextField); + if (bl) { + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.required"))); + } else { + bGridPane.add(null, (BValue)new BLabel()); + } + return bGridPane; + } + + private final BWidget buildBody() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.setRowGap((double)5); + bGridPane.setColumnGap((double)5); + bGridPane.setColumnAlign(BHalign.left); + bGridPane.setStretchColumn(1); + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.alias"))); + this.alias = new BTextField("", 40); + bGridPane.add(null, (BValue)this.buildDnTextField(this.alias, true)); + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.commonName"))); + this.cn = new BTextField("", 40); + bGridPane.add(null, (BValue)this.buildDnTextField(this.cn, true)); + bGridPane.add(null, (BValue)new BLabel("")); + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.commonName.desc"))); + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.organizationalUnit"))); + this.ou = new BTextField("", 40); + bGridPane.add(null, (BValue)this.buildDnTextField(this.ou, false)); + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.organization"))); + this.o = new BTextField("", 40); + bGridPane.add(null, (BValue)this.buildDnTextField(this.o, true)); + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.locality"))); + this.l = new BTextField("", 40); + bGridPane.add(null, (BValue)this.buildDnTextField(this.l, false)); + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.stateProvince"))); + this.st = new BTextField("", 40); + bGridPane.add(null, (BValue)this.buildDnTextField(this.st, false)); + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.countryCode"))); + this.c = new BTextField("", 3); + bGridPane.add(null, (BValue)this.buildDnTextField(this.c, true)); + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.notBefore"))); + this.starts = new BAbsTimeFE(); + bGridPane.add(null, (BValue)this.starts); + this.starts.loadValue((BObject)BAbsTime.now()); + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.notAfter"))); + this.ends = new BAbsTimeFE(); + bGridPane.add(null, (BValue)this.ends); + this.ends.loadValue((BObject)BAbsTime.make((long)(Clock.millis() + BRelTime.makeHours((int)8760).getMillis()))); + BGridPane bGridPane2 = new BGridPane(4); + bGridPane2.setColumnGap(7.0); + ToggleCommandGroup toggleCommandGroup = new ToggleCommandGroup(); + this.keySize1024 = new BRadioButton(toggleCommandGroup, lex.getText("cert.field.1024bits"), false); + bGridPane2.add(null, (BValue)this.keySize1024); + this.keySize2048 = new BRadioButton(toggleCommandGroup, lex.getText("cert.field.2048bits"), true); + bGridPane2.add(null, (BValue)this.keySize2048); + this.keySize3072 = new BRadioButton(toggleCommandGroup, lex.getText("cert.field.3072bits"), true); + bGridPane2.add(null, (BValue)this.keySize3072); + this.keySize4096 = new BRadioButton(toggleCommandGroup, lex.getText("cert.field.4096bits"), false); + bGridPane2.add(null, (BValue)this.keySize4096); + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.keySize"))); + bGridPane.add(null, (BValue)bGridPane2); + this.keySize2048.setSelected(true); + BGridPane bGridPane3 = new BGridPane(2); + toggleCommandGroup = new ToggleCommandGroup(); + this.serverCert = new BRadioButton(toggleCommandGroup, lex.getText("cert.field.serverCert"), true); + bGridPane3.add(null, (BValue)this.serverCert); + this.caCert = new BRadioButton(toggleCommandGroup, lex.getText("cert.field.caCert"), false); + bGridPane3.add(null, (BValue)this.caCert); + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.certUsage"))); + bGridPane.add(null, (BValue)bGridPane3); + bGridPane.add(null, (BValue)new BLabel(lex.getText("cert.field.emailAddress"))); + this.emailAltName = new BTextField("", 40); + bGridPane.add(null, (BValue)this.emailAltName); + BGridPane bGridPane4 = new BGridPane(1); + bGridPane4.add(null, (BValue)bGridPane); + this.linkTo(null, (BComponent)this.alias, (Slot)BTextField.textModified, (Slot)setModified); + this.linkTo(null, (BComponent)this.cn, (Slot)BTextField.textModified, (Slot)setModified); + this.linkTo(null, (BComponent)this.o, (Slot)BTextField.textModified, (Slot)setModified); + this.linkTo(null, (BComponent)this.c, (Slot)BTextField.textModified, (Slot)setModified); + this.linkTo(null, (BComponent)this.starts, (Slot)BAbsTimeFE.pluginModified, (Slot)setModified); + this.linkTo(null, (BComponent)this.ends, (Slot)BAbsTimeFE.pluginModified, (Slot)setModified); + return bGridPane4; + } + + private final BWidget buildButtons() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setUniformColumnWidth(true); + this.okButton = new BButton(UiLexicon.bajaui().getText("dialog.ok")); + bGridPane.add(null, (BValue)this.okButton); + this.linkTo("linkA", (BComponent)this.okButton, (Slot)BButton.actionPerformed, (Slot)okButtonPressed); + this.okButton.setEnabled(false); + this.cancelButton = new BButton(UiLexicon.bajaui().getText("dialog.cancel")); + bGridPane.add(null, (BValue)this.cancelButton); + this.linkTo("linkB", (BComponent)this.cancelButton, (Slot)BButton.actionPerformed, (Slot)cancelButtonPressed); + return new BBorderPane((BWidget)bGridPane, 7.0, 0.0, 0.0, 0.0); + } + + public void windowClosing(BWindowEvent bWindowEvent) { + this.close(); + } + + public void doOkButtonPressed(BWidgetEvent bWidgetEvent) throws Exception { + String string; + StringBuffer stringBuffer = new StringBuffer(); + if (this.alias.getText().length() <= 0) { + stringBuffer.append("- " + lex.getText("cert.generate.error.requiredAlias") + '\n'); + } + if (this.cn.getText().length() <= 0) { + stringBuffer.append("- " + lex.getText("cert.generate.error.requiredCommonName") + '\n'); + } + if (this.o.getText().length() <= 0) { + stringBuffer.append("- " + lex.getText("cert.generate.error.requiredOrganization") + '\n'); + } + if (!BSelfSignedDialog.isValidCountryCode(string = this.c.getText())) { + stringBuffer.append("- " + lex.getText("cert.generate.error.requiredCountryCode") + '\n'); + } + if (stringBuffer.length() > 0) { + BDialog.error((BWidget)this, (String)lex.getText("cert.generate.error.failure"), (Object)lex.getText("cert.generate.error.failure.description"), (String)stringBuffer.toString()); + return; + } + if (this.keySize1024.getSelected()) { + if (BDialog.open((BWidget)this, (String)lex.getText("cert.generate.warning.weakKeySize"), (Object)lex.getText("cert.generate.warning.weakKeySize.description"), (int)12, (BImage)BDialog.WARNING_ICON, null) == 8) { + return; + } + this.keySize = 1024; + } else if (this.keySize2048.getSelected()) { + this.keySize = 2048; + } else if (this.keySize3072.getSelected()) { + this.keySize = 3072; + } else if (this.keySize4096.getSelected()) { + this.keySize = 4096; + } + this.keyUsage = 0; + if (this.serverCert.getSelected()) { + this.keyUsage = 160; + } else if (this.caCert.getSelected()) { + this.keyUsage = 6; + } + try { + X509Certificate x509Certificate = this.mgr.getCertificate(this.alias.getText()); + if (x509Certificate != null) { + if (BDialog.open((BWidget)this, (String)lex.getText("cert.generate.warning.matchingAlias"), (Object)lex.getText("cert.generate.warning.matchingAlias.description", new Object[]{this.alias.getText()}), (int)12, (BImage)BDialog.WARNING_ICON) == 8) { + return; + } + this.mgr.deleteEntry(this.alias.getText()); + } + } + catch (Exception exception) {} + if ((this.keyUsage & 4) != 0) { + this.pkPassword = BPrivateKeyPasswordDialog.open((BWidget)this); + if (this.pkPassword == null) { + this.close(); + return; + } + } + this.canceled = false; + this.close(); + } + + public void doCancelButtonPressed(BWidgetEvent bWidgetEvent) { + this.close(); + } + + public void doSetModified(BWidgetEvent bWidgetEvent) { + boolean bl = true; + try { + if (this.alias.getText().trim().length() == 0) { + bl = false; + } + if (this.cn.getText().trim().length() == 0) { + bl = false; + } + if (this.o.getText().trim().length() == 0) { + bl = false; + } + if (!BSelfSignedDialog.isValidCountryCode(this.c.getText())) { + bl = false; + } + if (((BAbsTime)this.ends.saveValue()).getMillis() <= ((BAbsTime)this.starts.saveValue()).getMillis()) { + bl = false; + } + } + catch (Exception exception) { + bl = false; + } + this.okButton.setEnabled(bl); + } + + private static final boolean isValidCountryCode(String string) { + boolean bl = true; + if (string.trim().length() <= 0) { + bl = false; + } else if (string.trim().length() != 2) { + bl = false; + } else { + String[] stringArray = Locale.getISOCountries(); + int n = 0; + n = 0; + while (n < stringArray.length) { + if (string.equalsIgnoreCase(stringArray[n])) break; + ++n; + } + if (n == stringArray.length) { + bl = false; + } + } + return bl; + } + + public BCertsTable.CertGenRequest getResult() { + if (this.canceled) { + return null; + } + try { + int n = this.mgr.generateSelfSignedCert(this.alias.getText(), this.cn.getText().trim().length() > 0 ? this.cn.getText() : null, this.ou.getText().trim().length() > 0 ? this.ou.getText() : null, this.o.getText().trim().length() > 0 ? this.o.getText() : null, this.l.getText().trim().length() > 0 ? this.l.getText() : null, this.st.getText().trim().length() > 0 ? this.st.getText() : null, this.c.getText().length() > 0 ? this.c.getText() : null, new Date(((BAbsTime)this.starts.saveValue()).getMillis()), new Date(((BAbsTime)this.ends.saveValue()).getMillis()), this.keySize, this.keyUsage, this.emailAltName.getText().length() > 0 ? this.emailAltName.getText() : null, this.pkPassword != null ? this.pkPassword.getValue() : null); + if (n == -1) { + return null; + } + return new BCertsTable.CertGenRequest(n, this.alias.getText()); + } + catch (Exception exception) { + exception.printStackTrace(); + return null; + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.alias = null; + this.cn = null; + this.ou = null; + this.o = null; + this.l = null; + this.st = null; + this.c = null; + this.starts = null; + this.ends = null; + this.keySize1024 = null; + this.keySize2048 = null; + this.keySize3072 = null; + this.keySize4096 = null; + this.serverCert = null; + this.caCert = null; + this.emailAltName = null; + this.pkPassword = null; + this.okButton = null; + this.cancelButton = null; + this.mgr = null; + this.keySize = 2048; + this.keyUsage = 0; + this.canceled = true; + } + + protected BSelfSignedDialog(BWidget bWidget, ICoreKeyStore iCoreKeyStore) { + super(bWidget, lex.getText("cert.generate.dialog.title"), true); + this.this(); + this.mgr = iCoreKeyStore; + this.setContent(this.buildDialog()); + this.setDefaultButton(this.okButton); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BSelfSignedDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BSelfSignedDialog = BSelfSignedDialog.class("[Lcom.tridium.platcrypto.ui.BSelfSignedDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"platCrypto"); + logo = BImage.make((String)lex.get("cert.x32.icon", "module://icons/x32/lock.png")); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BSslSessionInfoDialog.java b/modules/cfr_output/com/tridium/platcrypto/ui/BSslSessionInfoDialog.java new file mode 100644 index 0000000..a42ca6f --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BSslSessionInfoDialog.java @@ -0,0 +1,131 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.platform.ui.util.CommandUtil + * com.tridium.workbench.util.BSessionInfoDialog + * javax.baja.gx.BImage + * javax.baja.sys.BIcon + * javax.baja.sys.BValue + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BButton + * javax.baja.ui.BSeparator + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.enums.BButtonStyle + * javax.baja.ui.enums.BHalign + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.ui; + +import com.tridium.platcrypto.ui.BCertViewDialog; +import com.tridium.platcrypto.util.BSslSessionInfo; +import com.tridium.platform.ui.util.CommandUtil; +import com.tridium.workbench.util.BSessionInfoDialog; +import javax.baja.gx.BImage; +import javax.baja.sys.BIcon; +import javax.baja.sys.BValue; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BButton; +import javax.baja.ui.BSeparator; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.enums.BButtonStyle; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BSslSessionInfoDialog +extends BSessionInfoDialog { + public static final Type TYPE; + private static Lexicon lex; + BSslSessionInfo sslInfo; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BSslSessionInfoDialog; + + public Type getType() { + return TYPE; + } + + protected BWidget buildBody() { + this.sslInfo = (BSslSessionInfo)this.info; + BGridPane bGridPane = new BGridPane(1); + bGridPane.setStretchColumn(0); + bGridPane.setHalign(BHalign.fill); + bGridPane.setColumnAlign(BHalign.fill); + String string = this.info.getUsername(); + if (string != null) { + bGridPane.add(null, (BValue)this.buildRow(BImage.make((BIcon)userIcon), this.wordWrappedLabel(this.info.getConnectedAsMessage(string), BHalign.left, 250.0))); + bGridPane.add(null, (BValue)new BSeparator()); + } + bGridPane.add(null, (BValue)this.buildRow(BImage.make((BIcon)this.info.getIdentityVerifiedIcon()), this.createCertLinkRow())); + bGridPane.add(null, (BValue)new BSeparator()); + bGridPane.add(null, (BValue)this.buildRow(BImage.make((BIcon)this.info.getSessionEncryptedIcon()), this.wordWrappedLabel(this.info.getSessionEncryptedMessage(), BHalign.left, 300.0))); + bGridPane.add(null, (BValue)new BSeparator()); + bGridPane.add(null, (BValue)this.buildRow(BImage.make((BIcon)this.info.getLastConnectedIcon()), this.wordWrappedLabel(this.info.getLastConnectedMessage(), BHalign.left, 300.0))); + bGridPane.add(null, (BValue)new BSeparator()); + return bGridPane; + } + + private final BWidget createCertLinkRow() { + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setCenter(this.wordWrappedLabel(this.info.getIdentityVerifiedMessage(), BHalign.left, 300.0)); + BButton bButton = new BButton((Command)new CertificateCommand()); + bButton.setButtonStyle(BButtonStyle.hyperlink); + bButton.setHalign(BHalign.left); + bEdgePane.setBottom((BWidget)bButton); + return bEdgePane; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BSslSessionInfoDialog; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BSslSessionInfoDialog = BSslSessionInfoDialog.class("[Lcom.tridium.platcrypto.ui.BSslSessionInfoDialog;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"workbench"); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + class CertificateCommand + extends Command { + public CommandArtifact doInvoke() { + try { + BCertViewDialog.show((BWidget)BSslSessionInfoDialog.this, BSslSessionInfoDialog.this.sslInfo.getCertificate()); + } + catch (Exception exception) { + CommandUtil.error((Command)this, (Throwable)exception); + } + return null; + } + + public CertificateCommand() { + super((BWidget)BSslSessionInfoDialog.this, lex.get("sessionInfoDialog.certificateInfo.label", "Certificate Information")); + } + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BTrustCertsTable.java b/modules/cfr_output/com/tridium/platcrypto/ui/BTrustCertsTable.java new file mode 100644 index 0000000..76c20b6 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BTrustCertsTable.java @@ -0,0 +1,228 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.crypto.core.io.ICoreKeyStore + * com.tridium.crypto.core.util.FriendlyPemReader + * com.tridium.platform.ui.util.BCommandEnablePolicy + * com.tridium.platform.ui.util.CommandBindings$Support + * com.tridium.platform.ui.util.CommandUtil + * javax.baja.file.BIFile + * javax.baja.file.IFileFilter + * javax.baja.naming.BOrd + * javax.baja.nre.util.Array + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BDialog + * javax.baja.ui.BWidget + * javax.baja.ui.Command + * javax.baja.ui.CommandArtifact + * javax.baja.ui.file.BFileChooser + * javax.baja.ui.file.ExtFileFilter + * org.bouncycastle.cert.X509CertificateHolder + * org.bouncycastle.cert.jcajce.JcaX509CertificateConverter + * org.bouncycastle.openssl.EncryptionException + * org.bouncycastle.openssl.PEMEncryptedKeyPair + * org.bouncycastle.openssl.PEMKeyPair + * org.bouncycastle.openssl.PEMParser + * org.bouncycastle.openssl.PasswordException + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.crypto.core.io.ICoreKeyStore; +import com.tridium.crypto.core.util.FriendlyPemReader; +import com.tridium.platcrypto.ui.BCertImportDialog; +import com.tridium.platcrypto.ui.BCertsTable; +import com.tridium.platform.ui.util.BCommandEnablePolicy; +import com.tridium.platform.ui.util.CommandBindings; +import com.tridium.platform.ui.util.CommandUtil; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.security.PrivateKey; +import java.security.cert.X509Certificate; +import java.util.ListIterator; +import javax.baja.file.BIFile; +import javax.baja.file.IFileFilter; +import javax.baja.naming.BOrd; +import javax.baja.nre.util.Array; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BDialog; +import javax.baja.ui.BWidget; +import javax.baja.ui.Command; +import javax.baja.ui.CommandArtifact; +import javax.baja.ui.file.BFileChooser; +import javax.baja.ui.file.ExtFileFilter; +import org.bouncycastle.cert.X509CertificateHolder; +import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; +import org.bouncycastle.openssl.EncryptionException; +import org.bouncycastle.openssl.PEMEncryptedKeyPair; +import org.bouncycastle.openssl.PEMKeyPair; +import org.bouncycastle.openssl.PEMParser; +import org.bouncycastle.openssl.PasswordException; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BTrustCertsTable +extends BCertsTable { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BTrustCertsTable; + static /* synthetic */ Class class$java$security$cert$X509Certificate; + + public Type getType() { + return TYPE; + } + + protected void initCommands() { + this.getCommandBindings().setSupport((CommandBindings.Support)this); + BCertsTable.ViewCommand viewCommand = new BCertsTable.ViewCommand(); + this.addCommand(viewCommand, BCommandEnablePolicy.singleSelection); + this.setDoubleClickCommand(viewCommand); + this.addCommand(new BCertsTable.DeleteCommand(), BCommandEnablePolicy.anySelection); + this.addCommand(new TrustImportCommand(), BCommandEnablePolicy.always); + this.addCommand(new BCertsTable.ExportCommand(), BCommandEnablePolicy.singleSelection); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BTrustCertsTable() throws UnsupportedOperationException { + throw new UnsupportedOperationException(); + } + + public BTrustCertsTable(ICoreKeyStore iCoreKeyStore) throws Exception { + super(iCoreKeyStore); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BTrustCertsTable; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BTrustCertsTable = BTrustCertsTable.class("[Lcom.tridium.platcrypto.ui.BTrustCertsTable;", false); + } + TYPE = Sys.loadType((Class)clazz); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + protected class TrustImportCommand + extends BCertsTable.ImportCommand { + /* + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public CommandArtifact doInvoke() { + try { + BFileChooser bFileChooser = BFileChooser.makeOpen((BWidget)this.getOwner()); + bFileChooser.setTitle(lex.getText("cert.import.chooser.title")); + bFileChooser.addFilter((IFileFilter)new ExtFileFilter(lex.getText("cert.extension.info"), "pem,p12,crt,cer,cert")); + bFileChooser.setCurrentDirectory(BOrd.make((String)("file:/" + BTrustCertsTable.getCertsDirectoryPath()))); + BOrd bOrd = bFileChooser.show(); + if (bOrd == null) { + return null; + } + BIFile bIFile = (BIFile)bOrd.get(); + if (bIFile == null) return null; + Class clazz = class$java$security$cert$X509Certificate; + if (clazz == null) { + clazz = class$java$security$cert$X509Certificate = BTrustCertsTable.class("[Ljava.security.cert.X509Certificate;", false); + } + Array array = new Array(clazz); + InputStreamReader inputStreamReader = new InputStreamReader(bIFile.getInputStream()); + FriendlyPemReader friendlyPemReader = new FriendlyPemReader((Reader)inputStreamReader); + PEMParser pEMParser = new PEMParser((Reader)friendlyPemReader); + try { + Object object = null; + do { + try { + object = pEMParser.readObject(); + if (object == null) continue; + if (object instanceof X509Certificate) { + array.add(object); + continue; + } + if (object instanceof X509CertificateHolder) { + X509Certificate x509Certificate = new JcaX509CertificateConverter().getCertificate((X509CertificateHolder)object); + array.add((Object)x509Certificate); + continue; + } + if (object instanceof PEMKeyPair || object instanceof PEMEncryptedKeyPair) continue; + throw new IOException("unsupported object type: " + object.getClass().getName()); + } + catch (PasswordException passwordException) { + log.trace("skipping private key during trust store import"); + object = new Object(); + } + } while (object != null); + } + catch (Throwable throwable) { + Object var9_14 = null; + try { + pEMParser.close(); + throw throwable; + } + catch (Exception exception) {} + throw throwable; + } + { + Object var9_15 = null; + } + try {} + catch (Exception exception) {} + pEMParser.close(); + String string = bIFile.getFileName(); + string = string.substring(0, string.length() - bIFile.getExtension().length() - 1); + this.importCertData(array, null, string); + BTrustCertsTable.this.mgr.save(); + BTrustCertsTable.this.certModel().load(); + return null; + } + catch (EncryptionException encryptionException) { + BDialog.error((BWidget)this.getOwner(), (Object)lex.get("cert.import.privatekey.badpassword")); + return null; + } + catch (Exception exception) { + CommandUtil.error((Command)this, (Throwable)exception); + } + return null; + } + + protected void importCertData(Array array, PrivateKey privateKey, String string) throws Exception { + ListIterator listIterator = array.iterator(); + while (listIterator.hasNext()) { + X509Certificate x509Certificate = (X509Certificate)listIterator.next(); + if (!NX509Certificate.isSelfSigned((X509Certificate)x509Certificate)) { + throw new IOException("certificate in the trust store must be root certificates"); + } + String string2 = BTrustCertsTable.this.mgr.findCertificate(x509Certificate); + if (string2 == null) { + string2 = string; + } + NX509Certificate nX509Certificate = NX509Certificate.make((X509Certificate)x509Certificate); + string2 = BCertImportDialog.prompt(this.getOwner(), nX509Certificate, string2, false); + if (string2 == null) continue; + BTrustCertsTable.this.mgr.setCertificateEntry(string2, x509Certificate); + } + } + + protected TrustImportCommand() { + } + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BX509CertificateChangedPane.java b/modules/cfr_output/com/tridium/platcrypto/ui/BX509CertificateChangedPane.java new file mode 100644 index 0000000..f3d01e6 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BX509CertificateChangedPane.java @@ -0,0 +1,194 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.ui.theme.Theme + * com.tridium.ui.theme.custom.nss.StyleUtils + * javax.baja.nre.util.ByteArrayUtil + * javax.baja.sys.BValue + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.style.IStylable + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.ui.theme.Theme; +import com.tridium.ui.theme.custom.nss.StyleUtils; +import java.util.Enumeration; +import java.util.Properties; +import javax.baja.nre.util.ByteArrayUtil; +import javax.baja.sys.BValue; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.style.IStylable; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BX509CertificateChangedPane +extends BEdgePane { + public static final Type TYPE; + static Lexicon lex; + private NX509Certificate oldCert; + private NX509Certificate cert; + private Properties before; + private Properties after; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BX509CertificateChangedPane; + + public Type getType() { + return TYPE; + } + + public void set(NX509Certificate nX509Certificate, NX509Certificate nX509Certificate2) { + this.set(nX509Certificate, nX509Certificate2, null, null); + } + + public void set(NX509Certificate nX509Certificate, NX509Certificate nX509Certificate2, Properties properties, Properties properties2) { + this.oldCert = nX509Certificate; + this.cert = nX509Certificate2; + this.before = properties; + this.after = properties2; + this.buildCertPane(); + } + + private final void buildCertPane() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.setStretchColumn(1); + bGridPane.setColorRows(true); + StyleUtils.addStyleClass((IStylable)bGridPane, (String)"scrolled"); + bGridPane.setColumnAlign(BHalign.fill); + this.appendProperties(bGridPane, this.before); + this.appendCertProperties(bGridPane); + this.appendProperties(bGridPane, this.after); + this.setCenter((BWidget)bGridPane); + } + + protected void appendProperties(BGridPane bGridPane, Properties properties) { + if (properties == null) { + return; + } + Enumeration enumeration = properties.keys(); + while (enumeration.hasMoreElements()) { + String string = (String)enumeration.nextElement(); + String string2 = properties.getProperty(string, null); + if (string2 == null) continue; + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText(string), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(string2, true)); + } + } + + protected void appendCertProperty(BGridPane bGridPane, String string, String string2, String string3) { + if (string2.equals(string3)) { + bGridPane.add(null, (BValue)this.createPaddedLabel(string, false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(string3, true)); + } else { + bGridPane.add(null, (BValue)this.createPaddedLabel(string, false)); + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop(this.createPaddedLabel("(-) " + string2, true)); + bEdgePane.setBottom(this.createChangedLabel("(+) " + string3)); + bGridPane.add(null, (BValue)bEdgePane); + } + } + + protected void appendCertProperties(BGridPane bGridPane) { + if (this.cert == null || this.oldCert == null) { + return; + } + this.appendCertProperty(bGridPane, lex.getText("cert.field.version"), "v" + this.oldCert.getVersion(), "v" + this.cert.getVersion()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.serialNum"), ByteArrayUtil.toHexString((byte[])this.oldCert.getSerialNumber().toByteArray(), (String)" "), ByteArrayUtil.toHexString((byte[])this.cert.getSerialNumber().toByteArray(), (String)" ")); + this.appendCertProperty(bGridPane, lex.getText("cert.field.issuedBy"), this.oldCert.getIssuer(), this.cert.getIssuer()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.issuerDn"), this.oldCert.getIssuerDN().toString(), this.cert.getIssuerDN().toString()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.subject"), this.oldCert.getSubject(), this.cert.getSubject()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.subjectDn"), this.oldCert.getSubjectDN().toString(), this.cert.getSubjectDN().toString()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.notBefore"), this.oldCert.getNotBefore().toString(), this.cert.getNotBefore().toString()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.notAfter"), this.oldCert.getNotAfter().toString(), this.cert.getNotAfter().toString()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.keyAlgorithm"), this.oldCert.getKeyAlgorithm(), this.cert.getKeyAlgorithm()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.keySize"), "" + this.oldCert.getKeySize(), "" + this.cert.getKeySize()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.signatureAlgorithm"), this.oldCert.getSignatureAlgorithm(), this.cert.getSignatureAlgorithm()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.signatureSize"), "" + this.oldCert.getSignatureSize(), "" + this.cert.getSignatureSize()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.basicConstraints"), this.oldCert.getBasicConstraints(), this.cert.getBasicConstraints()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.keyUsage"), this.oldCert.getKeyUsage(), this.cert.getKeyUsage()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.extendedKeyUsage"), this.oldCert.getExtendedKeyUsage(), this.cert.getExtendedKeyUsage()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.md5Fingerprint"), this.oldCert.getMD5Fingerprint(), this.cert.getMD5Fingerprint()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.sha1Fingerprint"), this.oldCert.getSHA1Fingerprint(), this.cert.getSHA1Fingerprint()); + this.appendCertProperty(bGridPane, lex.getText("cert.field.valid"), this.oldCert.checkValidity() ? lex.getText("cert.field.valid.true") : lex.getText("cert.field.valid.false"), this.cert.checkValidity() ? lex.getText("cert.field.valid.true") : lex.getText("cert.field.valid.false")); + } + + private final BWidget createPaddedLabel(String string, boolean bl) { + BLabel bLabel = new BLabel(string, BHalign.left); + if (bl) { + bLabel.setFont(Theme.label().getFixedWidthFont((IStylable)bLabel)); + } + BBorderPane bBorderPane = new BBorderPane((BWidget)bLabel, 0.0, (double)5, 0.0, 15.0); + return bBorderPane; + } + + private final BWidget createChangedLabel(String string) { + BLabel bLabel = new BLabel(string, BHalign.left); + bLabel.setFont(Theme.label().getFixedWidthFont((IStylable)bLabel)); + StyleUtils.addStyleClass((IStylable)bLabel, (String)"warning emphasized"); + BBorderPane bBorderPane = new BBorderPane((BWidget)bLabel, 0.0, (double)5, 0.0, 15.0); + return bBorderPane; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BX509CertificateChangedPane() { + this.cert = null; + this.before = null; + this.after = null; + } + + public BX509CertificateChangedPane(NX509Certificate nX509Certificate, NX509Certificate nX509Certificate2) { + this.oldCert = nX509Certificate; + this.cert = nX509Certificate2; + this.before = null; + this.after = null; + this.buildCertPane(); + } + + public BX509CertificateChangedPane(NX509Certificate nX509Certificate, NX509Certificate nX509Certificate2, Properties properties, Properties properties2) { + this.oldCert = nX509Certificate; + this.cert = nX509Certificate2; + this.before = properties; + this.after = properties2; + this.buildCertPane(); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BX509CertificateChangedPane; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BX509CertificateChangedPane = BX509CertificateChangedPane.class("[Lcom.tridium.platcrypto.ui.BX509CertificateChangedPane;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"platCrypto"); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BX509CertificatePane.java b/modules/cfr_output/com/tridium/platcrypto/ui/BX509CertificatePane.java new file mode 100644 index 0000000..6a3bfb2 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BX509CertificatePane.java @@ -0,0 +1,187 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.ui.theme.Theme + * com.tridium.ui.theme.custom.nss.StyleUtils + * javax.baja.nre.util.ByteArrayUtil + * javax.baja.sys.BValue + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.style.IStylable + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.ui.theme.Theme; +import com.tridium.ui.theme.custom.nss.StyleUtils; +import java.util.Enumeration; +import java.util.Properties; +import javax.baja.nre.util.ByteArrayUtil; +import javax.baja.sys.BValue; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.style.IStylable; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BX509CertificatePane +extends BEdgePane { + public static final Type TYPE; + static Lexicon lex; + private NX509Certificate cert; + private Properties before; + private Properties after; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BX509CertificatePane; + + public Type getType() { + return TYPE; + } + + public void set(NX509Certificate nX509Certificate) { + this.set(nX509Certificate, null, null); + } + + public void set(NX509Certificate nX509Certificate, Properties properties, Properties properties2) { + this.cert = nX509Certificate; + this.before = properties; + this.after = properties2; + this.buildCertPane(); + } + + private final void buildCertPane() { + BGridPane bGridPane = new BGridPane(2); + bGridPane.setStretchColumn(1); + bGridPane.setColorRows(true); + StyleUtils.addStyleClass((IStylable)bGridPane, (String)"scrolled"); + bGridPane.setColumnAlign(BHalign.fill); + this.appendProperties(bGridPane, this.before); + this.appendCertProperties(bGridPane); + this.appendProperties(bGridPane, this.after); + this.setCenter((BWidget)bGridPane); + } + + protected void appendProperties(BGridPane bGridPane, Properties properties) { + if (properties == null) { + return; + } + Enumeration enumeration = properties.keys(); + while (enumeration.hasMoreElements()) { + String string = (String)enumeration.nextElement(); + String string2 = properties.getProperty(string, null); + if (string2 == null) continue; + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText(string), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(string2, true)); + } + } + + protected void appendCertProperties(BGridPane bGridPane) { + if (this.cert == null) { + return; + } + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.version"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel("v" + this.cert.getVersion(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.serialNum"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(ByteArrayUtil.toHexString((byte[])this.cert.getSerialNumber().toByteArray(), (String)" "), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.issuedBy"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.getIssuer(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.issuerDn"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.getIssuerDN().toString(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.subject"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.getSubject(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.subjectDn"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.getSubjectDN().toString(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.notBefore"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.getNotBefore().toString(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.notAfter"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.getNotAfter().toString(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.keyAlgorithm"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.getKeyAlgorithm(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.keySize"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel("" + this.cert.getKeySize(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.signatureAlgorithm"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.getSignatureAlgorithm(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.signatureSize"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel("" + this.cert.getSignatureSize(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.basicConstraints"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.getBasicConstraints(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.keyUsage"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.getKeyUsage(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.extendedKeyUsage"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.getExtendedKeyUsage(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.md5Fingerprint"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.getMD5Fingerprint(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.sha1Fingerprint"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.getSHA1Fingerprint(), true)); + bGridPane.add(null, (BValue)this.createPaddedLabel(lex.getText("cert.field.valid"), false)); + bGridPane.add(null, (BValue)this.createPaddedLabel(this.cert.checkValidity() ? lex.getText("cert.field.valid.true") : lex.getText("cert.field.valid.false"), true)); + } + + private final BWidget createPaddedLabel(String string, boolean bl) { + BLabel bLabel = new BLabel(string, BHalign.left); + if (bl) { + bLabel.setFont(Theme.label().getFixedWidthFont((IStylable)bLabel)); + } + BBorderPane bBorderPane = new BBorderPane((BWidget)bLabel, 0.0, (double)5, 0.0, 15.0); + return bBorderPane; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BX509CertificatePane() { + this.cert = null; + this.before = null; + this.after = null; + } + + public BX509CertificatePane(NX509Certificate nX509Certificate) { + this.cert = nX509Certificate; + this.before = null; + this.after = null; + this.buildCertPane(); + } + + public BX509CertificatePane(NX509Certificate nX509Certificate, Properties properties, Properties properties2) { + this.cert = nX509Certificate; + this.before = properties; + this.after = properties2; + this.buildCertPane(); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BX509CertificatePane; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BX509CertificatePane = BX509CertificatePane.class("[Lcom.tridium.platcrypto.ui.BX509CertificatePane;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"platCrypto"); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BX509ExtensionChangedPane.java b/modules/cfr_output/com/tridium/platcrypto/ui/BX509ExtensionChangedPane.java new file mode 100644 index 0000000..557745f --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BX509ExtensionChangedPane.java @@ -0,0 +1,168 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509Extension + * com.tridium.ui.theme.Theme + * com.tridium.ui.theme.custom.nss.StyleUtils + * javax.baja.sys.BValue + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BConstrainedPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.style.IStylable + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NX509Extension; +import com.tridium.ui.theme.Theme; +import com.tridium.ui.theme.custom.nss.StyleUtils; +import javax.baja.sys.BValue; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BConstrainedPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.style.IStylable; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BX509ExtensionChangedPane +extends BEdgePane { + public static final Type TYPE; + private NX509Extension[] oldExtensions; + private NX509Extension[] extensions; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BX509ExtensionChangedPane; + + public Type getType() { + return TYPE; + } + + protected BWidget createPaddedLabel(String string, boolean bl) { + BLabel bLabel = new BLabel(string, BHalign.left); + bLabel.setFont(Theme.label().getFixedWidthFont((IStylable)bLabel)); + if (bl) { + StyleUtils.addStyleClass((IStylable)bLabel, (String)"warning emphasized"); + } + BBorderPane bBorderPane = new BBorderPane((BWidget)bLabel, 0.0, (double)5, 0.0, (double)5); + return bBorderPane; + } + + private final void buildExtensions() { + int n; + boolean bl; + BGridPane bGridPane = new BGridPane(1); + bGridPane.setStretchColumn(0); + bGridPane.setColorRows(true); + StyleUtils.addStyleClass((IStylable)bGridPane, (String)"scrolled"); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setHalign(BHalign.left); + int n2 = 0; + while (n2 < this.oldExtensions.length) { + bl = false; + n = 0; + while (n < this.extensions.length) { + if (this.oldExtensions[n2].getOid().equals((Object)this.extensions[n].getOid())) { + bl = true; + if (this.oldExtensions[n2].equals((Object)this.extensions[n])) { + bGridPane.add(null, (BValue)this.getExtensionWidget(this.oldExtensions[n2], "", false)); + break; + } + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop(this.getExtensionWidget(this.oldExtensions[n2], "(-) ", false)); + bEdgePane.setBottom(this.getExtensionWidget(this.extensions[n], "(+) ", true)); + bGridPane.add(null, (BValue)bEdgePane); + break; + } + ++n; + } + if (!bl) { + bGridPane.add(null, (BValue)this.getExtensionWidget(this.oldExtensions[n2], "(-) ", false)); + } + ++n2; + } + n2 = 0; + while (n2 < this.extensions.length) { + bl = false; + n = 0; + while (n < this.oldExtensions.length) { + if (this.extensions[n2].getOid().equals((Object)this.oldExtensions[n].getOid())) { + bl = true; + break; + } + ++n; + } + if (!bl) { + bGridPane.add(null, (BValue)this.getExtensionWidget(this.extensions[n2], "(+) ", true)); + } + ++n2; + } + this.setCenter((BWidget)bGridPane); + } + + private final BWidget getExtensionWidget(NX509Extension nX509Extension, String string, boolean bl) { + BEdgePane bEdgePane = new BEdgePane(); + bEdgePane.setTop(this.createPaddedLabel(string + "Identifier: " + nX509Extension.getIdentifier(), bl)); + String[] stringArray = nX509Extension.getExtensionText(); + StringBuffer stringBuffer = new StringBuffer("isCritical: " + (nX509Extension.isCritical() ? "true" : "false")); + int n = 0; + while (n < stringArray.length) { + stringBuffer.append("\n"); + stringBuffer.append(stringArray[n]); + ++n; + } + bEdgePane.setCenter(this.createPaddedLabel(stringBuffer.toString(), bl)); + BConstrainedPane bConstrainedPane = new BConstrainedPane(); + bConstrainedPane.setMinWidth(15.0); + bEdgePane.setLeft((BWidget)bConstrainedPane); + return bEdgePane; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.oldExtensions = null; + this.extensions = null; + } + + public BX509ExtensionChangedPane() { + this.this(); + } + + public BX509ExtensionChangedPane(NX509Extension[] nX509ExtensionArray, NX509Extension[] nX509ExtensionArray2) { + this.this(); + this.oldExtensions = nX509ExtensionArray; + this.extensions = nX509ExtensionArray2; + this.buildExtensions(); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BX509ExtensionChangedPane; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BX509ExtensionChangedPane = BX509ExtensionChangedPane.class("[Lcom.tridium.platcrypto.ui.BX509ExtensionChangedPane;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/BX509ExtensionPane.java b/modules/cfr_output/com/tridium/platcrypto/ui/BX509ExtensionPane.java new file mode 100644 index 0000000..715b545 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/BX509ExtensionPane.java @@ -0,0 +1,236 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.NX509Extension + * com.tridium.crypto.core.cert.NX509Extension$NASN1Primitive + * com.tridium.ui.theme.Theme + * com.tridium.ui.theme.custom.nss.StyleUtils + * javax.baja.sys.BValue + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.ui.BCheckBox + * javax.baja.ui.BLabel + * javax.baja.ui.BWidget + * javax.baja.ui.enums.BHalign + * javax.baja.ui.pane.BBorderPane + * javax.baja.ui.pane.BConstrainedPane + * javax.baja.ui.pane.BEdgePane + * javax.baja.ui.pane.BGridPane + * javax.baja.ui.style.IStylable + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.NX509Extension; +import com.tridium.ui.theme.Theme; +import com.tridium.ui.theme.custom.nss.StyleUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.baja.sys.BValue; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.ui.BCheckBox; +import javax.baja.ui.BLabel; +import javax.baja.ui.BWidget; +import javax.baja.ui.enums.BHalign; +import javax.baja.ui.pane.BBorderPane; +import javax.baja.ui.pane.BConstrainedPane; +import javax.baja.ui.pane.BEdgePane; +import javax.baja.ui.pane.BGridPane; +import javax.baja.ui.style.IStylable; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BX509ExtensionPane +extends BEdgePane { + public static final Type TYPE; + private static final List OID_READONLY_LIST; + private BCheckBox[] selected; + private NX509Extension[] extensions; + private boolean selectable; + static /* synthetic */ Class class$com$tridium$platcrypto$ui$BX509ExtensionPane; + static /* synthetic */ Class class$org$bouncycastle$asn1$DERObjectIdentifier; + + public Type getType() { + return TYPE; + } + + public boolean isSelectable() { + return this.selectable; + } + + public int getExtensionCount() { + if (this.extensions == null) { + return 0; + } + return this.extensions.length; + } + + public boolean isSelected(int n) { + if (this.extensions == null) { + return false; + } + if (n > this.extensions.length - 1) { + return false; + } + if (this.selected == null) { + return false; + } + if (n > this.selected.length - 1) { + return false; + } + return this.selected[n].getSelected(); + } + + public NX509Extension getExtension(int n) { + return this.extensions[n]; + } + + public void setExtensions(NX509Extension[] nX509ExtensionArray, boolean bl) { + this.extensions = nX509ExtensionArray; + this.selectable = bl; + this.buildExtensions(); + } + + protected BWidget createPaddedLabel(String string) { + BLabel bLabel = new BLabel(string, BHalign.left); + bLabel.setFont(Theme.label().getFixedWidthFont((IStylable)bLabel)); + BBorderPane bBorderPane = new BBorderPane((BWidget)bLabel, 0.0, (double)5, 0.0, (double)5); + return bBorderPane; + } + + private final void buildExtensions() { + BGridPane bGridPane; + if (this.selectable) { + bGridPane = new BGridPane(2); + bGridPane.setStretchColumn(1); + } else { + bGridPane = new BGridPane(1); + bGridPane.setStretchColumn(0); + } + bGridPane.setColorRows(true); + StyleUtils.addStyleClass((IStylable)bGridPane, (String)"scrolled"); + bGridPane.setColumnAlign(BHalign.fill); + bGridPane.setHalign(BHalign.left); + ArrayList arrayList = new ArrayList(); + int n = 0; + while (n < this.extensions.length) { + BBorderPane bBorderPane; + BEdgePane bEdgePane; + if (this.selectable) { + bEdgePane = new BCheckBox("", true); + if (this.checkReadOnlyExtension(this.extensions[n])) { + bEdgePane.setEnabled(false); + } + arrayList.add(bEdgePane); + bBorderPane = new BBorderPane((BWidget)bEdgePane, 0.0, 10.0, 0.0, 10.0); + bGridPane.add(null, (BValue)bBorderPane); + } + bEdgePane = new BEdgePane(); + bEdgePane.setTop(this.createPaddedLabel("Identifier: " + this.extensions[n].getIdentifier())); + bBorderPane = this.extensions[n].getExtensionText(); + StringBuffer stringBuffer = new StringBuffer("isCritical: " + (this.extensions[n].isCritical() ? "true" : "false")); + int n2 = 0; + while (n2 < ((BBorderPane)bBorderPane).length) { + stringBuffer.append("\n"); + stringBuffer.append((String)bBorderPane[n2]); + ++n2; + } + bEdgePane.setCenter(this.createPaddedLabel(stringBuffer.toString())); + BConstrainedPane bConstrainedPane = new BConstrainedPane(); + bConstrainedPane.setMinWidth(15.0); + bEdgePane.setLeft((BWidget)bConstrainedPane); + bGridPane.add(null, (BValue)bEdgePane); + ++n; + } + this.selected = arrayList.toArray(new BCheckBox[0]); + this.setCenter((BWidget)bGridPane); + } + + private final boolean checkReadOnlyExtension(NX509Extension nX509Extension) { + if (OID_READONLY_LIST.contains(nX509Extension.getOid())) { + return true; + } + try { + if (nX509Extension.getOid().getId().equals("2.5.29.18")) { + Class clazz = nX509Extension.getObject().getType(); + Class clazz2 = class$org$bouncycastle$asn1$DERObjectIdentifier; + if (clazz2 == null) { + clazz2 = class$org$bouncycastle$asn1$DERObjectIdentifier = BX509ExtensionPane.class("[Lorg.bouncycastle.asn1.DERObjectIdentifier;", false); + } + if (clazz == clazz2 && nX509Extension.getObject().getValue() == "tridiumHostId") { + return true; + } + if (this.checkForTridiumHostId(nX509Extension.getObject())) { + return true; + } + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + return false; + } + + private final boolean checkForTridiumHostId(NX509Extension.NASN1Primitive nASN1Primitive) { + if ("tridiumHostId".equals(nASN1Primitive.getValue())) { + return true; + } + NX509Extension.NASN1Primitive[] nASN1PrimitiveArray = nASN1Primitive.getChildren(); + int n = 0; + while (n < nASN1PrimitiveArray.length) { + if (this.checkForTridiumHostId(nASN1PrimitiveArray[n])) { + return true; + } + ++n; + } + return false; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.extensions = null; + this.selectable = false; + } + + public BX509ExtensionPane() { + this.this(); + } + + public BX509ExtensionPane(NX509Extension[] nX509ExtensionArray) { + this.this(); + this.extensions = nX509ExtensionArray; + this.buildExtensions(); + } + + public BX509ExtensionPane(NX509Extension[] nX509ExtensionArray, boolean bl) { + this.this(); + this.extensions = nX509ExtensionArray; + this.selectable = bl; + this.buildExtensions(); + } + + static { + Class clazz = class$com$tridium$platcrypto$ui$BX509ExtensionPane; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$ui$BX509ExtensionPane = BX509ExtensionPane.class("[Lcom.tridium.platcrypto.ui.BX509ExtensionPane;", false); + } + TYPE = Sys.loadType((Class)clazz); + OID_READONLY_LIST = Arrays.asList("2.5.29.19", "2.5.29.37", "2.5.29.15", "2.5.29.14", "1.3.6.1.4.1.4131.2"); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/PrivateKeyPasswordFinder.java b/modules/cfr_output/com/tridium/platcrypto/ui/PrivateKeyPasswordFinder.java new file mode 100644 index 0000000..0efd4f7 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/PrivateKeyPasswordFinder.java @@ -0,0 +1,35 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.security.BPassword + * javax.baja.ui.BWidget + * javax.baja.util.Lexicon + * org.bouncycastle.openssl.PasswordFinder + */ +package com.tridium.platcrypto.ui; + +import com.tridium.platcrypto.ui.BPasswordPromptDialog; +import javax.baja.security.BPassword; +import javax.baja.ui.BWidget; +import javax.baja.util.Lexicon; +import org.bouncycastle.openssl.PasswordFinder; + +public class PrivateKeyPasswordFinder +implements PasswordFinder { + protected static Lexicon lex = Lexicon.make((String)"platCrypto"); + private BWidget owner; + + public char[] getPassword() { + BPassword bPassword = BPasswordPromptDialog.open(this.owner, lex.get("pem.prompt.password.title"), lex.get("pem.prompt.password.description")); + if (bPassword == null) { + return null; + } + return bPassword.getValue().toCharArray(); + } + + public PrivateKeyPasswordFinder(BWidget bWidget) { + this.owner = bWidget; + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/ui/TridiumUIX509TrustManager.java b/modules/cfr_output/com/tridium/platcrypto/ui/TridiumUIX509TrustManager.java new file mode 100644 index 0000000..b4d6b53 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/ui/TridiumUIX509TrustManager.java @@ -0,0 +1,58 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.CertValidationResult + * com.tridium.crypto.core.cert.NHostExemption + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.crypto.core.cert.TridiumX509TrustManager + * com.tridium.crypto.core.io.CoreCryptoManager + * com.tridium.crypto.core.util.ILogger + * com.tridium.nre.security.ISecurityInfoProvider + * javax.baja.log.Log + */ +package com.tridium.platcrypto.ui; + +import com.tridium.crypto.core.cert.CertValidationResult; +import com.tridium.crypto.core.cert.NHostExemption; +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.crypto.core.cert.TridiumX509TrustManager; +import com.tridium.crypto.core.io.CoreCryptoManager; +import com.tridium.crypto.core.util.ILogger; +import com.tridium.nre.security.ISecurityInfoProvider; +import com.tridium.platcrypto.ui.BExemptionChangedDialog; +import com.tridium.platcrypto.ui.BExemptionPromptDialog; +import com.tridium.platcrypto.util.Logger; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import javax.baja.log.Log; + +public class TridiumUIX509TrustManager +extends TridiumX509TrustManager { + /* + * Enabled aggressive block sorting + */ + protected void handleRejectedCertificate(X509Certificate[] x509CertificateArray, CoreCryptoManager coreCryptoManager, CertValidationResult certValidationResult) throws Exception { + this.log.error("No trusted certificate found"); + if (!certValidationResult.certChanged()) { + boolean bl = BExemptionPromptDialog.show(null, certValidationResult); + this.addExemption(x509CertificateArray[0], coreCryptoManager, bl); + if (bl) return; + this.certificateException(certValidationResult.isValidCertChain(), certValidationResult.isHostnameVerified(), certValidationResult.isCertExpired()); + return; + } + if (BExemptionChangedDialog.show(null, certValidationResult)) { + this.addExemption(x509CertificateArray[0], coreCryptoManager, true); + return; + } + NHostExemption nHostExemption = coreCryptoManager.getExemptionStore().getExemption(this.host); + nHostExemption.setChanged(NX509Certificate.make((X509Certificate)x509CertificateArray[0])); + coreCryptoManager.getExemptionStore().setExemption(nHostExemption); + throw new CertificateException("certificate private key has changed"); + } + + public TridiumUIX509TrustManager(ISecurityInfoProvider iSecurityInfoProvider) throws Exception { + super(iSecurityInfoProvider, (ILogger)new Logger(Log.getLog((String)"crypto"))); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/util/BPemFile.java b/modules/cfr_output/com/tridium/platcrypto/util/BPemFile.java new file mode 100644 index 0000000..a171718 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/util/BPemFile.java @@ -0,0 +1,60 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.BDataFile + * javax.baja.sys.BIcon + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.util; + +import javax.baja.file.BDataFile; +import javax.baja.sys.BIcon; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPemFile +extends BDataFile { + public static final Type TYPE; + private static final Lexicon lex; + private static final BIcon icon; + static /* synthetic */ Class class$com$tridium$platcrypto$util$BPemFile; + + public Type getType() { + return TYPE; + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$platcrypto$util$BPemFile; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$util$BPemFile = BPemFile.class("[Lcom.tridium.platcrypto.util.BPemFile;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"platCrypto"); + icon = BIcon.std((String)"files/certificate.png"); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/util/BSslSessionInfo.java b/modules/cfr_output/com/tridium/platcrypto/util/BSslSessionInfo.java new file mode 100644 index 0000000..5327ca5 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/util/BSslSessionInfo.java @@ -0,0 +1,177 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.CertValidationResult + * com.tridium.crypto.core.cert.NX509Certificate + * com.tridium.crypto.core.cert.TridiumCertValidator + * com.tridium.crypto.core.io.CryptoSupport + * com.tridium.crypto.core.io.ICoreCryptoManager + * com.tridium.util.BSessionInfo + * javax.baja.security.crypto.CertManagerFactory + * javax.baja.sys.BAbsTime + * javax.baja.sys.BIcon + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.Lexicon + */ +package com.tridium.platcrypto.util; + +import com.tridium.crypto.core.cert.CertValidationResult; +import com.tridium.crypto.core.cert.NX509Certificate; +import com.tridium.crypto.core.cert.TridiumCertValidator; +import com.tridium.crypto.core.io.CryptoSupport; +import com.tridium.crypto.core.io.ICoreCryptoManager; +import com.tridium.platcrypto.core.IExtCryptoManager; +import com.tridium.util.BSessionInfo; +import java.net.Socket; +import java.security.cert.Certificate; +import javax.baja.security.crypto.CertManagerFactory; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BIcon; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.Lexicon; +import javax.net.ssl.SSLSession; +import javax.net.ssl.SSLSocket; +import javax.security.cert.X509Certificate; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BSslSessionInfo +extends BSessionInfo { + public static final Type TYPE; + private static Lexicon lex; + private NX509Certificate cert; + private String protocol; + private String cipherSuite; + private boolean hostnameVerified; + private boolean validCertChain; + private boolean certExpired; + static /* synthetic */ Class class$com$tridium$platcrypto$util$BSslSessionInfo; + + public Type getType() { + return TYPE; + } + + public static BSessionInfo make(String string, BAbsTime bAbsTime, Socket socket, String string2) { + return new BSslSessionInfo(string, bAbsTime, socket, string2); + } + + public BIcon getIdentityVerifiedIcon() { + if (!this.hostnameVerified || !this.validCertChain || this.certExpired) { + return BIcon.make((String)lex.getText("session.info.identityVerified.failed.icon")); + } + return BIcon.make((String)lex.getText("session.info.identityVerified.succeeded.icon")); + } + + public String getIdentityVerifiedMessage() { + if (!this.hostnameVerified || !this.validCertChain || this.certExpired) { + StringBuffer stringBuffer = new StringBuffer(lex.getText("session.info.identityVerified.failed.title")).append("\n"); + if (!this.hostnameVerified) { + stringBuffer.append(" - " + lex.getText("session.info.identityVerified.failed.hostnameMismatch")).append("\n"); + } + if (!this.validCertChain) { + stringBuffer.append(" - " + lex.getText("session.info.identityVerified.failed.certValidation")).append("\n"); + } + if (this.certExpired) { + stringBuffer.append(" - " + lex.getText("session.info.identityVerified.failed.certExpired")).append("\n"); + } + return stringBuffer.toString(); + } + return lex.getText("session.info.identityVerified.succeeded", new Object[]{this.cert.getIssuer()}); + } + + public BIcon getSessionEncryptedIcon() { + return BIcon.make((String)lex.getText("session.info.sessionEncrypted.icon")); + } + + public String getSessionEncryptedMessage() { + return lex.getText("session.info.sessionEncrypted", new Object[]{this.hostname, "" + CryptoSupport.getEncryptionBits((String)this.cipherSuite), this.protocol, CryptoSupport.getEncryptionCipher((String)this.cipherSuite), CryptoSupport.getMessageAuthCipher((String)this.cipherSuite), CryptoSupport.getKeyExchangeCipher((String)this.cipherSuite)}); + } + + public String getProtocol() { + return this.protocol; + } + + public NX509Certificate getCertificate() { + return this.cert; + } + + public String toString(Context context) { + return "SslSessionInfo: cert=" + this.cert.getSubject() + ", protocol=" + this.protocol + ", cipherSuite=" + this.cipherSuite + ", hostnameVerified=" + this.hostnameVerified + ", validCertChain=" + this.validCertChain + ", certExpired=" + this.certExpired; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.cert = null; + this.protocol = null; + this.cipherSuite = null; + this.hostnameVerified = false; + this.validCertChain = false; + this.certExpired = false; + } + + public BSslSessionInfo() { + this.this(); + } + + public BSslSessionInfo(String string, BAbsTime bAbsTime, Socket socket, String string2) { + super(string, bAbsTime, string2); + this.this(); + SSLSocket sSLSocket = (SSLSocket)socket; + SSLSession sSLSession = sSLSocket.getSession(); + if (sSLSession != null) { + this.cipherSuite = sSLSession.getCipherSuite(); + this.protocol = sSLSession.getProtocol(); + try { + Certificate[] certificateArray = sSLSession.getPeerCertificates(); + if (certificateArray != null && certificateArray.length > 0 && certificateArray[0] instanceof java.security.cert.X509Certificate) { + this.cert = NX509Certificate.make((java.security.cert.X509Certificate)((java.security.cert.X509Certificate)certificateArray[0])); + } + X509Certificate[] x509CertificateArray = sSLSession.getPeerCertificateChain(); + java.security.cert.X509Certificate[] x509CertificateArray2 = new java.security.cert.X509Certificate[x509CertificateArray.length]; + int n = 0; + while (n < x509CertificateArray.length) { + x509CertificateArray2[n] = NX509Certificate.convert((X509Certificate)x509CertificateArray[n]); + ++n; + } + IExtCryptoManager iExtCryptoManager = (IExtCryptoManager)CertManagerFactory.getInstanceEx(); + String string3 = sSLSession.getPeerHost(); + String string4 = sSLSession.getPeerHost() + ':' + sSLSession.getPeerPort(); + CertValidationResult certValidationResult = TridiumCertValidator.validateCertificate((java.security.cert.X509Certificate[])x509CertificateArray2, (ICoreCryptoManager)iExtCryptoManager.getCoreCryptoManager(), (String)string3, (String)string4); + this.hostnameVerified = certValidationResult.isHostnameVerified(); + this.validCertChain = certValidationResult.isValidCertChain(); + this.certExpired = certValidationResult.isCertExpired(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + } + + static { + Class clazz = class$com$tridium$platcrypto$util$BSslSessionInfo; + if (clazz == null) { + clazz = class$com$tridium$platcrypto$util$BSslSessionInfo = BSslSessionInfo.class("[Lcom.tridium.platcrypto.util.BSslSessionInfo;", false); + } + TYPE = Sys.loadType((Class)clazz); + lex = Lexicon.make((String)"platCrypto"); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/util/HostValidationException.java b/modules/cfr_output/com/tridium/platcrypto/util/HostValidationException.java new file mode 100644 index 0000000..6652f3f --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/util/HostValidationException.java @@ -0,0 +1,14 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platcrypto.util; + +import javax.net.ssl.SSLException; + +public class HostValidationException +extends SSLException { + public HostValidationException(String string) { + super(string); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/util/Logger.java b/modules/cfr_output/com/tridium/platcrypto/util/Logger.java new file mode 100644 index 0000000..aad112a --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/util/Logger.java @@ -0,0 +1,81 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.util.ILogger + * javax.baja.log.Log + */ +package com.tridium.platcrypto.util; + +import com.tridium.crypto.core.util.ILogger; +import javax.baja.log.Log; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class Logger +implements ILogger { + private Log log; + + public void error(String string) { + this.log.error(string); + } + + public void error(String string, Throwable throwable) { + this.log.error(string, throwable); + } + + public void warning(String string) { + this.log.warning(string); + } + + public void warning(String string, Throwable throwable) { + this.log.warning(string, throwable); + } + + public void message(String string) { + this.log.message(string); + } + + public void message(String string, Throwable throwable) { + this.log.message(string, throwable); + } + + public void trace(String string) { + this.log.trace(string); + } + + public void trace(String string, Throwable throwable) { + this.log.trace(string, throwable); + } + + public void trace(byte[] byArray) { + this.log.trace(byArray); + } + + public void trace(byte[] byArray, int n, int n2) { + this.log.trace(byArray, n, n2); + } + + public void trace(String string, byte[] byArray) { + this.log.trace(string, byArray); + } + + public void trace(String string, byte[] byArray, int n, int n2) { + this.log.trace(string, byArray, n, n2); + } + + public boolean isTraceOn() { + return this.log.isTraceOn(); + } + + private final /* synthetic */ void this() { + this.log = null; + } + + public Logger(Log log) { + this.this(); + this.log = log; + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/util/TridiumAppletX509TrustManager.java b/modules/cfr_output/com/tridium/platcrypto/util/TridiumAppletX509TrustManager.java new file mode 100644 index 0000000..75fb749 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/util/TridiumAppletX509TrustManager.java @@ -0,0 +1,64 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.crypto.core.cert.TridiumX509TrustManager + * javax.baja.nre.util.ByteArrayUtil + */ +package com.tridium.platcrypto.util; + +import com.tridium.crypto.core.cert.TridiumX509TrustManager; +import java.security.KeyStore; +import java.security.MessageDigest; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import javax.baja.nre.util.ByteArrayUtil; +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.X509TrustManager; + +public class TridiumAppletX509TrustManager +extends TridiumX509TrustManager +implements X509TrustManager { + public void checkServerTrusted(X509Certificate[] x509CertificateArray, String string) throws CertificateException { + block2: { + try { + this.defaultTrustManager.checkServerTrusted(x509CertificateArray, string); + } + catch (Exception exception) { + String string2 = TridiumAppletX509TrustManager.extractSHA1Fingerprint(x509CertificateArray[0]); + String string3 = System.getProperty("sha1FingerPrint", ""); + if (string2.equalsIgnoreCase(string3)) break block2; + throw new CertificateException("sha1 fingerprints don't match", exception); + } + } + } + + private static final String extractSHA1Fingerprint(X509Certificate x509Certificate) { + byte[] byArray; + try { + MessageDigest messageDigest = MessageDigest.getInstance("SHA1"); + byArray = messageDigest.digest(x509Certificate.getEncoded()); + } + catch (Exception exception) { + return "???"; + } + return ByteArrayUtil.toHexString((byte[])byArray, (String)":"); + } + + public TridiumAppletX509TrustManager() throws Exception { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("SunX509"); + trustManagerFactory.init((KeyStore)null); + TrustManager[] trustManagerArray = trustManagerFactory.getTrustManagers(); + int n = 0; + while (n < trustManagerArray.length) { + if (trustManagerArray[n] instanceof X509TrustManager) { + this.defaultTrustManager = (X509TrustManager)trustManagerArray[n]; + return; + } + ++n; + } + throw new Exception("Error intializing trust manager"); + } +} + diff --git a/modules/cfr_output/com/tridium/platcrypto/util/ValidationException.java b/modules/cfr_output/com/tridium/platcrypto/util/ValidationException.java new file mode 100644 index 0000000..32fd6c0 --- /dev/null +++ b/modules/cfr_output/com/tridium/platcrypto/util/ValidationException.java @@ -0,0 +1,12 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platcrypto.util; + +public class ValidationException +extends Exception { + public ValidationException(String string) { + super(string); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/BEngineWatchdogPolicy.java b/modules/cfr_output/com/tridium/platform/BEngineWatchdogPolicy.java new file mode 100644 index 0000000..6893d27 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/BEngineWatchdogPolicy.java @@ -0,0 +1,68 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BFrozenEnum + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform; + +import javax.baja.sys.BFrozenEnum; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public final class BEngineWatchdogPolicy +extends BFrozenEnum { + public static final int LOG_ONLY = 1; + public static final int TERMINATE = 2; + public static final int REBOOT = 3; + public static final BEngineWatchdogPolicy logOnly = new BEngineWatchdogPolicy(1); + public static final BEngineWatchdogPolicy terminate = new BEngineWatchdogPolicy(2); + public static final BEngineWatchdogPolicy reboot = new BEngineWatchdogPolicy(3); + public static final Type TYPE; + public static final BEngineWatchdogPolicy DEFAULT; + static /* synthetic */ Class class$com$tridium$platform$BEngineWatchdogPolicy; + + public final Type getType() { + return TYPE; + } + + public static final BEngineWatchdogPolicy make(int n) { + return (BEngineWatchdogPolicy)logOnly.getRange().get(n, false); + } + + public static final BEngineWatchdogPolicy make(String string) { + return (BEngineWatchdogPolicy)logOnly.getRange().get(string); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private BEngineWatchdogPolicy(int n) { + super(n); + } + + static { + Class clazz = class$com$tridium$platform$BEngineWatchdogPolicy; + if (clazz == null) { + clazz = class$com$tridium$platform$BEngineWatchdogPolicy = BEngineWatchdogPolicy.class("[Lcom.tridium.platform.BEngineWatchdogPolicy;", false); + } + TYPE = Sys.loadType((Class)clazz); + DEFAULT = logOnly; + } +} + diff --git a/modules/cfr_output/com/tridium/platform/BFilesystemAttributes.java b/modules/cfr_output/com/tridium/platform/BFilesystemAttributes.java new file mode 100644 index 0000000..3c0b9d0 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/BFilesystemAttributes.java @@ -0,0 +1,133 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BComponent + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform; + +import javax.baja.sys.BComponent; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BFilesystemAttributes +extends BComponent { + public static final Property totalSpace = BFilesystemAttributes.newProperty((int)3, (int)-1, null); + public static final Property freeSpace = BFilesystemAttributes.newProperty((int)3, (int)-1, null); + public static final Property blockSize = BFilesystemAttributes.newProperty((int)3, (int)-1, null); + public static final Property currentFileCount = BFilesystemAttributes.newProperty((int)3, (int)-1, null); + public static final Property maxFileCount = BFilesystemAttributes.newProperty((int)3, (int)-1, null); + public static final Property isFlash = BFilesystemAttributes.newProperty((int)3, (boolean)false, null); + public static final Property isRamDisk = BFilesystemAttributes.newProperty((int)3, (boolean)false, null); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platform$BFilesystemAttributes; + + public long getTotalSpace() { + return this.getLong(totalSpace); + } + + public void setTotalSpace(long l) { + this.setLong(totalSpace, l, null); + } + + public long getFreeSpace() { + return this.getLong(freeSpace); + } + + public void setFreeSpace(long l) { + this.setLong(freeSpace, l, null); + } + + public int getBlockSize() { + return this.getInt(blockSize); + } + + public void setBlockSize(int n) { + this.setInt(blockSize, n, null); + } + + public long getCurrentFileCount() { + return this.getLong(currentFileCount); + } + + public void setCurrentFileCount(long l) { + this.setLong(currentFileCount, l, null); + } + + public long getMaxFileCount() { + return this.getLong(maxFileCount); + } + + public void setMaxFileCount(long l) { + this.setLong(maxFileCount, l, null); + } + + public boolean getIsFlash() { + return this.getBoolean(isFlash); + } + + public void setIsFlash(boolean bl) { + this.setBoolean(isFlash, bl, null); + } + + public boolean getIsRamDisk() { + return this.getBoolean(isRamDisk); + } + + public void setIsRamDisk(boolean bl) { + this.setBoolean(isRamDisk, bl, null); + } + + public Type getType() { + return TYPE; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BFilesystemAttributes() { + } + + public BFilesystemAttributes(long l, long l2, int n) { + this(l, l2, n, -1, -1, false); + } + + public BFilesystemAttributes(long l, long l2, int n, boolean bl) { + this(l, l2, n, -1, -1, bl); + } + + public BFilesystemAttributes(long l, long l2, int n, long l3, long l4, boolean bl) { + this.setTotalSpace(l); + this.setFreeSpace(l2); + this.setBlockSize(n); + this.setIsFlash(bl); + this.setMaxFileCount(l3); + this.setCurrentFileCount(l4); + } + + static { + Class clazz = class$com$tridium$platform$BFilesystemAttributes; + if (clazz == null) { + clazz = class$com$tridium$platform$BFilesystemAttributes = BFilesystemAttributes.class("[Lcom.tridium.platform.BFilesystemAttributes;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/BOperatingSystemEnum.java b/modules/cfr_output/com/tridium/platform/BOperatingSystemEnum.java new file mode 100644 index 0000000..579d3ec --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/BOperatingSystemEnum.java @@ -0,0 +1,99 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BFrozenEnum + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform; + +import javax.baja.sys.BFrozenEnum; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public final class BOperatingSystemEnum +extends BFrozenEnum { + public static final int UNKNOWN = -1; + public static final int WINDOWS = 0; + public static final int QNX = 1; + public static final int LINUX = 2; + public static final int UNSUPPORTED = 3; + public static final BOperatingSystemEnum unknown = new BOperatingSystemEnum(-1); + public static final BOperatingSystemEnum windows = new BOperatingSystemEnum(0); + public static final BOperatingSystemEnum qnx = new BOperatingSystemEnum(1); + public static final BOperatingSystemEnum linux = new BOperatingSystemEnum(2); + public static final BOperatingSystemEnum unsupported = new BOperatingSystemEnum(3); + public static final Type TYPE; + public static final BOperatingSystemEnum DEFAULT; + private static BOperatingSystemEnum os; + static /* synthetic */ Class class$com$tridium$platform$BOperatingSystemEnum; + + public final Type getType() { + return TYPE; + } + + public static final BOperatingSystemEnum make(int n) { + return (BOperatingSystemEnum)unknown.getRange().get(n, false); + } + + public static final BOperatingSystemEnum make(String string) { + return (BOperatingSystemEnum)unknown.getRange().get(string); + } + + public static final BOperatingSystemEnum getOS() { + if (os == null) { + BOperatingSystemEnum.checkOS(); + } + return os; + } + + public static final boolean isOS(BOperatingSystemEnum bOperatingSystemEnum) { + if (os == null) { + BOperatingSystemEnum.checkOS(); + } + boolean bl = false; + if (bOperatingSystemEnum == os) { + bl = true; + } + return bl; + } + + private static final void checkOS() { + if (os == null) { + String string = System.getProperty("os.name"); + os = string.toLowerCase().startsWith("l") && string.toLowerCase().endsWith("x") ? linux : (string.toLowerCase().startsWith("win") ? windows : (string.toLowerCase().startsWith("q") && string.toLowerCase().endsWith("x") ? qnx : unsupported)); + } + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private BOperatingSystemEnum(int n) { + super(n); + } + + static { + Class clazz = class$com$tridium$platform$BOperatingSystemEnum; + if (clazz == null) { + clazz = class$com$tridium$platform$BOperatingSystemEnum = BOperatingSystemEnum.class("[Lcom.tridium.platform.BOperatingSystemEnum;", false); + } + TYPE = Sys.loadType((Class)clazz); + DEFAULT = unknown; + os = null; + } +} + diff --git a/modules/cfr_output/com/tridium/platform/BPlatform.java b/modules/cfr_output/com/tridium/platform/BPlatform.java new file mode 100644 index 0000000..dab89f4 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/BPlatform.java @@ -0,0 +1,462 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.sys.BIPlatform + * com.tridium.sys.Nre + * com.tridium.sys.module.NModule + * com.tridium.sys.resource.ResourceReport + * javax.baja.data.BIDataValue + * javax.baja.io.ValueDocDecoder + * javax.baja.io.ValueDocDecoder$BogTypeResolver + * javax.baja.io.ValueDocDecoder$ITypeResolver + * javax.baja.license.FeatureNotLicensedException + * javax.baja.license.LicenseDatabaseException + * javax.baja.log.Log + * javax.baja.naming.SlotPath + * javax.baja.registry.TypeInfo + * javax.baja.security.AuthenticationException + * javax.baja.sys.BBoolean + * javax.baja.sys.BComplex + * javax.baja.sys.BFacets + * javax.baja.sys.BModule + * javax.baja.sys.BObject + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.Context + * javax.baja.sys.ModuleNotFoundException + * javax.baja.sys.Property + * javax.baja.sys.ServiceNotFoundException + * javax.baja.sys.Slot + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.sys.TypeNotFoundException + * javax.baja.util.BServiceContainer + * javax.baja.xml.XException + */ +package com.tridium.platform; + +import com.tridium.platform.BFilesystemAttributes; +import com.tridium.platform.BOperatingSystemEnum; +import com.tridium.platform.BPlatformService; +import com.tridium.platform.BPlatformServiceContainer; +import com.tridium.platform.BSystemPlatformService; +import com.tridium.platform.daemon.LocalSessionUtil; +import com.tridium.platform.daemon.message.ReportStatusMessage; +import com.tridium.platform.tcpip.BTcpIpPlatformService; +import com.tridium.sys.BIPlatform; +import com.tridium.sys.Nre; +import com.tridium.sys.module.NModule; +import com.tridium.sys.resource.ResourceReport; +import java.io.File; +import java.net.ConnectException; +import javax.baja.data.BIDataValue; +import javax.baja.io.ValueDocDecoder; +import javax.baja.license.FeatureNotLicensedException; +import javax.baja.license.LicenseDatabaseException; +import javax.baja.log.Log; +import javax.baja.naming.SlotPath; +import javax.baja.registry.TypeInfo; +import javax.baja.security.AuthenticationException; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BComplex; +import javax.baja.sys.BFacets; +import javax.baja.sys.BModule; +import javax.baja.sys.BObject; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.Context; +import javax.baja.sys.ModuleNotFoundException; +import javax.baja.sys.Property; +import javax.baja.sys.ServiceNotFoundException; +import javax.baja.sys.Slot; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.sys.TypeNotFoundException; +import javax.baja.util.BServiceContainer; +import javax.baja.xml.XException; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPlatform +extends BObject +implements BIPlatform { + public static final Type TYPE; + private static final PlatformTypeResolver typeResolver; + static final BFacets sysFacets; + public static Log log; + private int memoryUsage; + private int totalMemory; + private int cpuUsage; + private BSystemPlatformService sys; + static /* synthetic */ Class class$com$tridium$platform$BPlatform; + static /* synthetic */ Class class$com$tridium$platform$BPlatformService; + static /* synthetic */ Class class$com$tridium$platform$BFilesystemAttributes; + + public Type getType() { + return TYPE; + } + + public void initPlatform() throws Exception { + Object object; + File file = new File(Sys.getBajaHome(), "lib" + File.separator + "platform.bog"); + if (!file.exists()) { + object = new File(Sys.getBajaHome(), "lib" + File.separator + "platform.bog.working"); + if (((File)object).exists()) { + ((File)object).renameTo(file); + } else { + throw new BajaRuntimeException("!lib/platform.bog file does not exist, can not load platform"); + } + } + if (file.length() == 0L) { + throw new BajaRuntimeException("!lib/platform.bog file is empty, can not load platform"); + } + object = new ValueDocDecoder(file); + object.setTypeResolver((ValueDocDecoder.ITypeResolver)typeResolver); + BPlatformServiceContainer bPlatformServiceContainer = (BPlatformServiceContainer)object.decodeDocument(); + bPlatformServiceContainer.clearHandles(); + BServiceContainer bServiceContainer = null; + try { + bServiceContainer = (BServiceContainer)Sys.getService((Type)BServiceContainer.TYPE); + } + catch (ServiceNotFoundException serviceNotFoundException) { + bServiceContainer = new BServiceContainer(); + Sys.getStation().add(null, (BValue)bServiceContainer); + } + bServiceContainer.add("PlatformServices", (BValue)bPlatformServiceContainer, 3); + TypeInfo[] typeInfoArray = Sys.getRegistry().getConcreteTypes(BPlatformService.TYPE.getTypeInfo()); + Class clazz = class$com$tridium$platform$BPlatformService; + if (clazz == null) { + clazz = class$com$tridium$platform$BPlatformService = BPlatform.class("[Lcom.tridium.platform.BPlatformService;", false); + } + BPlatformService[] bPlatformServiceArray = (BPlatformService[])bPlatformServiceContainer.getChildren(clazz); + int n = 0; + while (n < typeInfoArray.length) { + block24: { + BPlatformService bPlatformService; + boolean bl = false; + int n2 = 0; + while (n2 < bPlatformServiceArray.length) { + if (bPlatformServiceArray[n2].getType().getTypeInfo().equals(typeInfoArray[n])) { + bl = true; + } + ++n2; + } + if (!bl && (bPlatformService = (BPlatformService)typeInfoArray[n].getInstance()).isValidPlatform()) { + String string = bPlatformService.getLicenseFeature(); + String string2 = bPlatformService.getLicenseVendor(); + if (string != null) { + try { + Sys.getLicenseManager().checkFeature(string2, string); + } + catch (FeatureNotLicensedException featureNotLicensedException) { + if (BOperatingSystemEnum.isOS(BOperatingSystemEnum.qnx)) { + log.warning("Platform Service " + (Object)((Object)bPlatformService) + " will not be added, feature \"" + string + "\" is not licensed"); + } + break block24; + } + catch (LicenseDatabaseException licenseDatabaseException) { + break block24; + } + } + bPlatformServiceContainer.add(typeInfoArray[n].getTypeName(), (BValue)bPlatformService, bPlatformService.getSlotFlags()); + } + } + ++n; + } + Class clazz2 = class$com$tridium$platform$BPlatformService; + if (clazz2 == null) { + clazz2 = class$com$tridium$platform$BPlatformService = BPlatform.class("[Lcom.tridium.platform.BPlatformService;", false); + } + bPlatformServiceArray = (BPlatformService[])bPlatformServiceContainer.getChildren(clazz2); + try { + BModule bModule = Sys.loadModule((String)"platJennic"); + Class clazz3 = bModule.loadClass("com.tridium.platJennic.BJennicPlatformService"); + int n3 = 0; + while (n3 < bPlatformServiceArray.length) { + if (bPlatformServiceArray[n3] != null && clazz3.isInstance((Object)bPlatformServiceArray[n3])) { + log.warning("Removing platform service " + (Object)((Object)bPlatformServiceArray[n3]) + ", service is obsolete"); + bPlatformServiceContainer.remove((BComplex)bPlatformServiceArray[n3]); + bPlatformServiceArray[n3] = null; + } + ++n3; + } + } + catch (ClassNotFoundException classNotFoundException) { + } + catch (ModuleNotFoundException moduleNotFoundException) {} + int n4 = 0; + while (n4 < bPlatformServiceArray.length) { + if (bPlatformServiceArray[n4] != null) { + bPlatformServiceArray[n4].fw(1001, bServiceContainer, null, null, null); + } + ++n4; + } + this.sys = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE); + } + + public BSystemPlatformService sys() { + if (this.sys == null || this.sys.getParent() == null) { + this.sys = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE); + } + return this.sys; + } + + public void stationStarted() { + BPlatformServiceContainer bPlatformServiceContainer = (BPlatformServiceContainer)Sys.getService((Type)BPlatformServiceContainer.TYPE); + Class clazz = class$com$tridium$platform$BPlatformService; + if (clazz == null) { + clazz = class$com$tridium$platform$BPlatformService = BPlatform.class("[Lcom.tridium.platform.BPlatformService;", false); + } + BPlatformService[] bPlatformServiceArray = (BPlatformService[])bPlatformServiceContainer.getChildren(clazz); + int n = 0; + while (n < bPlatformServiceArray.length) { + Property property; + try { + bPlatformServiceArray[n].doStationStarted(Sys.getStation()); + } + catch (Throwable throwable) { + throwable.printStackTrace(); + } + if (bPlatformServiceArray[n] instanceof BTcpIpPlatformService) { + property = bPlatformServiceArray[n].getPropertyInParent(); + bPlatformServiceContainer.setFlags((Slot)property, bPlatformServiceContainer.getFlags((Slot)property) & 0xFFFFFFFB); + } else if (bPlatformServiceArray[n] instanceof BSystemPlatformService) { + property = bPlatformServiceArray[n].getPropertyInParent(); + bPlatformServiceContainer.setFlags((Slot)property, bPlatformServiceContainer.getFlags((Slot)property) & 0xFFFFFFFB); + } + ++n; + } + } + + public boolean isFlashFileSystem() { + try { + BSystemPlatformService bSystemPlatformService = this.sys(); + bSystemPlatformService.checkPropertiesLoaded(); + BVector bVector = bSystemPlatformService.getFilesystemAttributes(); + Class clazz = class$com$tridium$platform$BFilesystemAttributes; + if (clazz == null) { + clazz = class$com$tridium$platform$BFilesystemAttributes = BPlatform.class("[Lcom.tridium.platform.BFilesystemAttributes;", false); + } + BFilesystemAttributes[] bFilesystemAttributesArray = (BFilesystemAttributes[])bVector.getChildren(clazz); + return bFilesystemAttributesArray[0].getIsFlash(); + } + catch (ServiceNotFoundException serviceNotFoundException) { + return false; + } + } + + public boolean isFlashFileSystem(String string) { + try { + BSystemPlatformService bSystemPlatformService = this.sys(); + bSystemPlatformService.checkPropertiesLoaded(); + BFilesystemAttributes bFilesystemAttributes = (BFilesystemAttributes)bSystemPlatformService.getFilesystemAttributes().get(SlotPath.escape((String)string)); + if (bFilesystemAttributes == null) { + throw new BajaRuntimeException(string + " filesystem does not exist"); + } + return bFilesystemAttributes.getIsFlash(); + } + catch (ServiceNotFoundException serviceNotFoundException) { + return false; + } + } + + public boolean isStationAutoSaveEnabled() { + try { + BSystemPlatformService bSystemPlatformService = this.sys(); + return bSystemPlatformService.getIsStationAutoSaveEnabled(); + } + catch (ServiceNotFoundException serviceNotFoundException) { + return true; + } + } + + public long getStationAutoSaveFrequency() { + try { + BSystemPlatformService bSystemPlatformService = this.sys(); + return bSystemPlatformService.getStationAutoSaveFrequency().getMillis(); + } + catch (ServiceNotFoundException serviceNotFoundException) { + return 3600000L; + } + } + + public int getStationSaveBackupCount() { + try { + BSystemPlatformService bSystemPlatformService = this.sys(); + return bSystemPlatformService.getStationSaveBackupCount(); + } + catch (ServiceNotFoundException serviceNotFoundException) { + return 3; + } + } + + public void poll() { + try { + BSystemPlatformService bSystemPlatformService = this.sys(); + bSystemPlatformService.checkPropertiesLoaded(); + bSystemPlatformService.invoke(BSystemPlatformService.poll, null, (Context)sysFacets); + int n = bSystemPlatformService.getCurrentCpuUsage(); + this.cpuUsage = n < 0 ? 0 : n / bSystemPlatformService.getNumCpus(); + int n2 = bSystemPlatformService.getTotalPhysicalMemory(); + if (n2 > 0) { + this.totalMemory = n2; + int n3 = bSystemPlatformService.getFreePhysicalMemory(); + this.memoryUsage = n3 >= 0 ? n2 - n3 : 0; + } else { + this.totalMemory = 0; + } + } + catch (ServiceNotFoundException serviceNotFoundException) { + this.memoryUsage = 0; + this.totalMemory = 0; + this.cpuUsage = 0; + } + } + + public int getMemoryUsage() { + return this.memoryUsage; + } + + public int getTotalMemory() { + return this.totalMemory; + } + + public int getCpuUsage() { + return this.cpuUsage; + } + + public String checkForStationFault() { + String string; + BSystemPlatformService bSystemPlatformService = this.sys(); + String string2 = bSystemPlatformService.checkForStationFault(); + if (string2 != null) { + return string2; + } + if (Nre.serviceManager.getActiveDataRecoveryService() != null && (string = Nre.serviceManager.getActiveDataRecoveryService().checkForStationFault()) != null) { + return string; + } + return null; + } + + public void queryResources(ResourceReport resourceReport) { + this.sys.queryResources(resourceReport); + } + + public void reportSummaryFields(String[] stringArray, String[] stringArray2) { + if (LocalSessionUtil.localDaemonIsAvailable()) { + try { + LocalSessionUtil.getLocalSession().sendMessage(new ReportStatusMessage(stringArray, stringArray2)); + } + catch (ConnectException connectException) { + } + catch (AuthenticationException authenticationException) {} + } + } + + public void resetLocalDaemonSession() { + LocalSessionUtil.resetLocalSession(); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.memoryUsage = 0; + this.totalMemory = 0; + this.cpuUsage = 0; + } + + public BPlatform() { + this.this(); + } + + static { + Class clazz = class$com$tridium$platform$BPlatform; + if (clazz == null) { + clazz = class$com$tridium$platform$BPlatform = BPlatform.class("[Lcom.tridium.platform.BPlatform;", false); + } + TYPE = Sys.loadType((Class)clazz); + typeResolver = new PlatformTypeResolver(); + sysFacets = BFacets.make((String[])new String[]{"resourceOnly"}, (BIDataValue[])new BBoolean[]{BBoolean.TRUE}); + log = Log.getLog((String)"platform"); + } + + private static final class PlatformTypeResolver + extends ValueDocDecoder.BogTypeResolver { + public final BModule loadModule(ValueDocDecoder valueDocDecoder, BComplex bComplex, String string, String string2, String string3) { + try { + int n = string2.indexOf(61); + String string4 = string2.substring(0, n).trim(); + String string5 = string2.substring(n + 1).trim(); + if (string2.equals("platJennic=platJennic")) { + log.warning("Ignoring platJennic based type '" + string3 + "' in platform.bog."); + return null; + } + NModule nModule = Nre.moduleManager.loadModule(string5); + this.getModuleMap(valueDocDecoder).put(string4, nModule); + return nModule.bmodule(); + } + catch (ModuleNotFoundException moduleNotFoundException) { + log.warning("Ignoring platform service '" + string3 + "' in platform.bog, required module not found!"); + return null; + } + catch (Exception exception) { + throw new XException("Invalid module attribute '" + string2 + '\''); + } + } + + public final BValue newInstance(ValueDocDecoder valueDocDecoder, BComplex bComplex, String string, Property property, String string2) { + if (string2 == null) { + if (property != null) { + return property.getDefaultValue(); + } + log.warning("Missing frozen property: " + string); + return null; + } + try { + int n = string2.indexOf(58); + if (n <= 0) { + log.warning("Invalid typespec '" + string2 + '\''); + return null; + } + String string3 = string2.substring(0, n); + String string4 = string2.substring(n + 1); + NModule nModule = (NModule)this.getModuleMap(valueDocDecoder).get(string3); + if (nModule == null) { + return null; + } + Type type = nModule.getType(string4); + return (BValue)type.getInstance(); + } + catch (XException xException) { + throw xException; + } + catch (TypeNotFoundException typeNotFoundException) { + log.warning("Type \"" + typeNotFoundException.getMessage() + "\" not found: " + string); + return null; + } + catch (Throwable throwable) { + log.warning("Cannot instantiate type '" + string2 + '\'', throwable); + return null; + } + } + + private PlatformTypeResolver() { + } + } +} + diff --git a/modules/cfr_output/com/tridium/platform/BPlatformSSLSettings.java b/modules/cfr_output/com/tridium/platform/BPlatformSSLSettings.java new file mode 100644 index 0000000..69bca25 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/BPlatformSSLSettings.java @@ -0,0 +1,208 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.log.Log + * javax.baja.security.crypto.BTlsEnum + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.InvalidEnumException + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.xml.XElem + */ +package com.tridium.platform; + +import java.util.ArrayList; +import java.util.List; +import javax.baja.log.Log; +import javax.baja.security.crypto.BTlsEnum; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.InvalidEnumException; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.xml.XElem; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPlatformSSLSettings +extends BComponent { + public static final int DEFAULT_SSL_PORT = 5011; + public static final Property sslLicensed = BPlatformSSLSettings.newProperty((int)3, (boolean)false, null); + public static final Property sslEnabled = BPlatformSSLSettings.newProperty((int)3, (boolean)false, null); + public static final Property sslOnly = BPlatformSSLSettings.newProperty((int)3, (boolean)false, null); + public static final Property sslPort = BPlatformSSLSettings.newProperty((int)3, (int)5011, null); + public static final Property keyAlias = BPlatformSSLSettings.newProperty((int)3, (String)"tridium", null); + public static final Property sslAlgType = BPlatformSSLSettings.newProperty((int)3, (BValue)BTlsEnum.DEFAULT, null); + public static final Property fipsMode = BPlatformSSLSettings.newProperty((int)3, (boolean)false, null); + public static final Property supportsTlsMinProtocol = BPlatformSSLSettings.newProperty((int)3, (boolean)false, null); + public static final Type TYPE; + public static Log log; + private List aliases; + static /* synthetic */ Class class$com$tridium$platform$BPlatformSSLSettings; + + public boolean getSslLicensed() { + return this.getBoolean(sslLicensed); + } + + public void setSslLicensed(boolean bl) { + this.setBoolean(sslLicensed, bl, null); + } + + public boolean getSslEnabled() { + return this.getBoolean(sslEnabled); + } + + public void setSslEnabled(boolean bl) { + this.setBoolean(sslEnabled, bl, null); + } + + public boolean getSslOnly() { + return this.getBoolean(sslOnly); + } + + public void setSslOnly(boolean bl) { + this.setBoolean(sslOnly, bl, null); + } + + public int getSslPort() { + return this.getInt(sslPort); + } + + public void setSslPort(int n) { + this.setInt(sslPort, n, null); + } + + public String getKeyAlias() { + return this.getString(keyAlias); + } + + public void setKeyAlias(String string) { + this.setString(keyAlias, string, null); + } + + public BTlsEnum getSslAlgType() { + return (BTlsEnum)this.get(sslAlgType); + } + + public void setSslAlgType(BTlsEnum bTlsEnum) { + this.set(sslAlgType, (BValue)bTlsEnum, null); + } + + public boolean getFipsMode() { + return this.getBoolean(fipsMode); + } + + public void setFipsMode(boolean bl) { + this.setBoolean(fipsMode, bl, null); + } + + public boolean getSupportsTlsMinProtocol() { + return this.getBoolean(supportsTlsMinProtocol); + } + + public void setSupportsTlsMinProtocol(boolean bl) { + this.setBoolean(supportsTlsMinProtocol, bl, null); + } + + public Type getType() { + return TYPE; + } + + public void updateFromXml(XElem xElem) { + BTlsEnum bTlsEnum; + this.setSslLicensed(this.getB(xElem, "sslLicensed", "true")); + this.setSslEnabled(this.getB(xElem, "sslEnabled")); + this.setSslOnly(this.getB(xElem, "sslOnly")); + this.setSslPort(xElem.geti("sslPort")); + this.setKeyAlias(xElem.get("keyAlias")); + this.setFipsMode(this.getB(xElem, "fipsMode", "false")); + this.setSupportsTlsMinProtocol(this.getB(xElem, "supportsTlsMinProtocol", "false")); + String string = xElem.get("sslAlgType"); + if (string != null) { + string = string.toLowerCase(); + } + try { + bTlsEnum = BTlsEnum.make((String)string); + } + catch (InvalidEnumException invalidEnumException) { + log.trace("Unrecognized platform TLS protocol: " + string + ", defaulting to " + BTlsEnum.DEFAULT.getTag()); + bTlsEnum = BTlsEnum.DEFAULT; + } + this.setSslAlgType(bTlsEnum); + } + + public List getAliases() { + return this.aliases; + } + + public void setAliases(List list) { + this.aliases = list; + } + + private final boolean getB(XElem xElem, String string) { + return this.getB(xElem, string, "false"); + } + + private final boolean getB(XElem xElem, String string, String string2) { + return Boolean.valueOf(xElem.get(string, string2)); + } + + public void loadAliases(XElem xElem) { + XElem[] xElemArray = xElem.elems("key"); + ArrayList arrayList = new ArrayList(xElemArray.length); + int n = 0; + while (n < xElemArray.length) { + arrayList.add(xElemArray[n].get("alias")); + ++n; + } + this.setAliases(arrayList); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.aliases = null; + } + + public BPlatformSSLSettings() { + this.this(); + } + + public BPlatformSSLSettings(BPlatformSSLSettings bPlatformSSLSettings) { + this.this(); + this.setSslEnabled(bPlatformSSLSettings.getSslEnabled()); + this.setSslLicensed(bPlatformSSLSettings.getSslLicensed()); + this.setSslOnly(bPlatformSSLSettings.getSslOnly()); + this.setSslPort(bPlatformSSLSettings.getSslPort()); + this.setKeyAlias(bPlatformSSLSettings.getKeyAlias()); + this.setSslAlgType(bPlatformSSLSettings.getSslAlgType()); + this.setFipsMode(bPlatformSSLSettings.getFipsMode()); + this.setSupportsTlsMinProtocol(bPlatformSSLSettings.getSupportsTlsMinProtocol()); + } + + static { + Class clazz = class$com$tridium$platform$BPlatformSSLSettings; + if (clazz == null) { + clazz = class$com$tridium$platform$BPlatformSSLSettings = BPlatformSSLSettings.class("[Lcom.tridium.platform.BPlatformSSLSettings;", false); + } + TYPE = Sys.loadType((Class)clazz); + log = Log.getLog((String)"platform"); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/BPlatformService.java b/modules/cfr_output/com/tridium/platform/BPlatformService.java new file mode 100644 index 0000000..34ff75d --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/BPlatformService.java @@ -0,0 +1,261 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.agent.AgentList + * javax.baja.file.FileUtil + * javax.baja.io.ValueDocEncoder + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BIService + * javax.baja.sys.BRelTime + * javax.baja.sys.BStation + * javax.baja.sys.BValue + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.Clock + * javax.baja.sys.Clock$Ticket + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform; + +import com.tridium.platform.BPlatformServiceContainer; +import java.io.File; +import javax.baja.agent.AgentList; +import javax.baja.file.FileUtil; +import javax.baja.io.ValueDocEncoder; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BIService; +import javax.baja.sys.BRelTime; +import javax.baja.sys.BStation; +import javax.baja.sys.BValue; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.Clock; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BPlatformService +extends BComponent +implements BIService { + public static final Property platformServiceDescription = BPlatformService.newProperty((int)1, (String)"unknown", null); + public static final Action poll = BPlatformService.newAction((int)2048, null); + public static final Action checkPropertiesLoaded = BPlatformService.newAction((int)4, null); + public static final Action savePlatformServiceProperties = BPlatformService.newAction((int)4, null); + public static final Type TYPE; + protected boolean platformServicePropertiesLoaded; + protected boolean isProxy; + protected boolean isServiceStarted; + protected Clock.Ticket pollTicket; + static /* synthetic */ Class class$com$tridium$platform$BPlatformService; + + public String getPlatformServiceDescription() { + return this.getString(platformServiceDescription); + } + + public void setPlatformServiceDescription(String string) { + this.setString(platformServiceDescription, string, null); + } + + public void poll() { + this.invoke(poll, null, null); + } + + public void checkPropertiesLoaded() { + this.invoke(checkPropertiesLoaded, null, null); + } + + public void savePlatformServiceProperties() { + this.invoke(savePlatformServiceProperties, null, null); + } + + public Type getType() { + return TYPE; + } + + public boolean isProxy() { + return this.isProxy; + } + + public boolean isValidPlatform() { + return false; + } + + public String getLicenseFeature() { + return null; + } + + public String getLicenseVendor() { + return "Tridium"; + } + + public int getSlotFlags() { + return 4; + } + + public void loadPlatformServiceProperties() { + } + + public void doStationStarted(BStation bStation) { + } + + protected boolean startPollTimerOnSubscribe() { + return false; + } + + public BRelTime getPollFrequency() { + return BRelTime.DEFAULT; + } + + public AgentList getAgents(Context context) { + try { + AgentList agentList = super.getAgents(context); + agentList.remove("workbench:PropertySheet"); + return agentList; + } + catch (Exception exception) { + exception.printStackTrace(); + if (exception instanceof RuntimeException) { + throw (RuntimeException)exception; + } + throw new BajaRuntimeException((Throwable)exception); + } + } + + public void doPoll(Context context) { + if (!this.isRunning()) { + return; + } + this.checkPropertiesLoaded(); + } + + public final synchronized void doCheckPropertiesLoaded() { + if (!this.platformServicePropertiesLoaded) { + this.loadPlatformServiceProperties(); + this.platformServicePropertiesLoaded = true; + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void doSavePlatformServiceProperties() throws Exception { + if (!this.isRunning()) { + return; + } + BPlatformServiceContainer bPlatformServiceContainer = (BPlatformServiceContainer)Sys.getService((Type)BPlatformServiceContainer.TYPE); + BPlatformServiceContainer bPlatformServiceContainer2 = bPlatformServiceContainer; + synchronized (bPlatformServiceContainer2) { + File file = new File(Sys.getBajaHome(), "lib" + File.separator + "platform.bog.working"); + File file2 = new File(Sys.getBajaHome(), "lib" + File.separator + "platform.bog"); + ValueDocEncoder valueDocEncoder = new ValueDocEncoder(file); + valueDocEncoder.encodeDocument((BValue)bPlatformServiceContainer); + valueDocEncoder.close(); + FileUtil.renameToBackup((File)file2, (int)1); + if (!file.renameTo(file2)) { + throw new BajaRuntimeException("platform.bog rename failed"); + } + return; + } + } + + public void serviceStarted() throws Exception { + this.isProxy = false; + this.isServiceStarted = true; + } + + public void serviceStopped() throws Exception { + this.isServiceStarted = false; + } + + public boolean isServiceStarted() { + return this.isServiceStarted; + } + + public boolean isParentLegal(BComponent bComponent) { + return bComponent instanceof BPlatformServiceContainer; + } + + public void subscribed() { + if (this.startPollTimerOnSubscribe()) { + this.startPollTimer(); + } else { + this.poll(); + } + super.subscribed(); + } + + public void unsubscribed() { + if (this.startPollTimerOnSubscribe()) { + this.stopPollTimer(); + } + } + + protected void startPollTimer() { + this.poll(); + if (this.pollTicket == null && this.getPollFrequency().getMillis() > 0L && this.isRunning()) { + this.pollTicket = Clock.schedulePeriodically((BComponent)this, (BRelTime)this.getPollFrequency(), (Action)poll, null); + } + } + + protected void stopPollTimer() { + if (this.pollTicket != null) { + this.pollTicket.cancel(); + this.pollTicket = null; + } + } + + public final String getNavDescription(Context context) { + if (this.getPlatformServiceDescription().equals("unknown")) { + return super.getNavDescription(context); + } + return this.getPlatformServiceDescription(); + } + + public boolean hasNavChildren() { + return false; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.platformServicePropertiesLoaded = false; + this.isProxy = true; + this.isServiceStarted = false; + this.pollTicket = null; + } + + public BPlatformService() { + this.this(); + } + + static { + Class clazz = class$com$tridium$platform$BPlatformService; + if (clazz == null) { + clazz = class$com$tridium$platform$BPlatformService = BPlatformService.class("[Lcom.tridium.platform.BPlatformService;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/BPlatformServiceContainer.java b/modules/cfr_output/com/tridium/platform/BPlatformServiceContainer.java new file mode 100644 index 0000000..a3d0908 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/BPlatformServiceContainer.java @@ -0,0 +1,151 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.nav.BINavNode + * javax.baja.nre.util.Array + * javax.baja.sys.Action + * javax.baja.sys.BComponent + * javax.baja.sys.BFacets + * javax.baja.sys.BIService + * javax.baja.sys.BIcon + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.BServiceContainer + */ +package com.tridium.platform; + +import com.tridium.platform.BPlatformService; +import com.tridium.platform.BSystemPlatformService; +import javax.baja.nav.BINavNode; +import javax.baja.nre.util.Array; +import javax.baja.sys.Action; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BIService; +import javax.baja.sys.BIcon; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.BServiceContainer; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPlatformServiceContainer +extends BComponent +implements BIService { + public static final Action sendThreadDumpToConsole = BPlatformServiceContainer.newAction((int)0, null); + public static final Action requestGarbageCollection = BPlatformServiceContainer.newAction((int)0, null); + public static final Action restartStation = BPlatformServiceContainer.newAction((int)128, null); + public static final Action renameAndRestartStation = BPlatformServiceContainer.newAction((int)132, (BValue)BString.make((String)"newStationName"), (BFacets)BFacets.make((String)"validator", (String)"baja:StationNameValidator")); + public static final Type TYPE; + private static final BIcon icon; + static /* synthetic */ Class class$com$tridium$platform$BPlatformServiceContainer; + static /* synthetic */ Class class$javax$baja$nav$BINavNode; + + public void sendThreadDumpToConsole() { + this.invoke(sendThreadDumpToConsole, null, null); + } + + public void requestGarbageCollection() { + this.invoke(requestGarbageCollection, null, null); + } + + public void restartStation() { + this.invoke(restartStation, null, null); + } + + public void renameAndRestartStation(BString bString) { + this.invoke(renameAndRestartStation, (BValue)bString, null); + } + + public Type getType() { + return TYPE; + } + + public Type[] getServiceTypes() { + return new Type[]{TYPE}; + } + + public void serviceStarted() throws Exception { + } + + public void serviceStopped() throws Exception { + } + + public boolean isParentLegal(BComponent bComponent) { + return bComponent instanceof BServiceContainer; + } + + public boolean isChildLegal(BComponent bComponent) { + return bComponent instanceof BPlatformService; + } + + public void doSendThreadDumpToConsole() throws Exception { + BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE); + bSystemPlatformService.sendThreadDumpToConsole(); + } + + public void doRequestGarbageCollection() throws Exception { + BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE); + bSystemPlatformService.requestGarbageCollection(); + } + + public void doRestartStation() throws Exception { + BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE); + bSystemPlatformService.restartStation(); + } + + public void doRenameAndRestartStation(BString bString) { + BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE); + bSystemPlatformService.renameAndRestartStation(bString); + } + + public BINavNode[] getNavChildren() { + Class clazz = class$javax$baja$nav$BINavNode; + if (clazz == null) { + clazz = class$javax$baja$nav$BINavNode = BPlatformServiceContainer.class("[Ljavax.baja.nav.BINavNode;", false); + } + Array array = new Array(clazz); + BINavNode[] bINavNodeArray = super.getNavChildren(); + int n = 0; + while (n < bINavNodeArray.length) { + if (!(bINavNodeArray[n] instanceof BSystemPlatformService)) { + array.add((Object)bINavNodeArray[n]); + } + ++n; + } + return (BINavNode[])array.trim(); + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$platform$BPlatformServiceContainer; + if (clazz == null) { + clazz = class$com$tridium$platform$BPlatformServiceContainer = BPlatformServiceContainer.class("[Lcom.tridium.platform.BPlatformServiceContainer;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BIcon.std((String)"platform.png"); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/BSessionNavNode.java b/modules/cfr_output/com/tridium/platform/BSessionNavNode.java new file mode 100644 index 0000000..3065515 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/BSessionNavNode.java @@ -0,0 +1,97 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.naming.BISession + * javax.baja.naming.BOrd + * javax.baja.naming.OrdQuery + * javax.baja.naming.ViewQuery + * javax.baja.nav.BNavContainer + * javax.baja.sys.BIcon + * javax.baja.sys.Context + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.Lexicon + */ +package com.tridium.platform; + +import javax.baja.naming.BISession; +import javax.baja.naming.BOrd; +import javax.baja.naming.OrdQuery; +import javax.baja.naming.ViewQuery; +import javax.baja.nav.BNavContainer; +import javax.baja.sys.BIcon; +import javax.baja.sys.Context; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.Lexicon; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BSessionNavNode +extends BNavContainer { + public static final Type TYPE; + private BISession session; + private Type viewType; + private Lexicon lexicon; + static /* synthetic */ Class class$com$tridium$platform$BSessionNavNode; + + public Type getType() { + return TYPE; + } + + public BISession getNavSession() { + return this.session; + } + + public Type getViewType() { + return this.viewType; + } + + public BOrd getNavOrd() { + return BOrd.make((BOrd)this.session.getNavOrd(), (OrdQuery)new ViewQuery(this.getViewType().toString())); + } + + public BIcon getNavIcon() { + return this.viewType.getTypeInfo().getIcon(null); + } + + public String getNavDisplayName(Context context) { + return this.viewType.getTypeInfo().getDisplayName(context); + } + + public String getNavDescription(Context context) { + String string = this.lexicon.get(this.viewType.getTypeName() + ".viewDesc"); + return string == null ? "" : string; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BSessionNavNode(BISession bISession, Type type) { + super(type.getModule().getLexicon().get(type.getTypeName() + ".navName", type.getTypeName())); + this.session = bISession; + this.lexicon = type.getModule().getLexicon(); + this.viewType = type; + } + + static { + Class clazz = class$com$tridium$platform$BSessionNavNode; + if (clazz == null) { + clazz = class$com$tridium$platform$BSessionNavNode = BSessionNavNode.class("[Lcom.tridium.platform.BSessionNavNode;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/BSessionNavNodeFactory.java b/modules/cfr_output/com/tridium/platform/BSessionNavNodeFactory.java new file mode 100644 index 0000000..14db957 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/BSessionNavNodeFactory.java @@ -0,0 +1,134 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.agent.AgentFilter + * javax.baja.agent.AgentInfo + * javax.baja.agent.BIAgent + * javax.baja.naming.BISession + * javax.baja.nav.BINavNode + * javax.baja.nre.util.Array + * javax.baja.sys.BObject + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform; + +import com.tridium.platform.BSessionNavNode; +import java.util.Comparator; +import javax.baja.agent.AgentFilter; +import javax.baja.agent.AgentInfo; +import javax.baja.agent.BIAgent; +import javax.baja.naming.BISession; +import javax.baja.nav.BINavNode; +import javax.baja.nre.util.Array; +import javax.baja.sys.BObject; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BSessionNavNodeFactory +extends BObject +implements BIAgent { + public static final Type TYPE; + public static Comparator NAV_NODE_COMPARATOR; + private Array navNodes; + private BISession session; + static /* synthetic */ Class class$com$tridium$platform$BSessionNavNodeFactory; + + public Type getType() { + return TYPE; + } + + public static BSessionNavNodeFactory[] makeFor(BISession bISession) { + AgentInfo[] agentInfoArray = ((BObject)bISession).getAgents().filter(AgentFilter.is((Type)TYPE)).list(); + Class clazz = class$com$tridium$platform$BSessionNavNodeFactory; + if (clazz == null) { + clazz = class$com$tridium$platform$BSessionNavNodeFactory = BSessionNavNodeFactory.class("[Lcom.tridium.platform.BSessionNavNodeFactory;", false); + } + Array array = new Array(clazz); + int n = 0; + while (n < agentInfoArray.length) { + if (!agentInfoArray[n].getAgentType().isAbstract() && !agentInfoArray[n].getAgentType().isInterface()) { + BSessionNavNodeFactory bSessionNavNodeFactory = (BSessionNavNodeFactory)agentInfoArray[n].getAgentType().getInstance(); + bSessionNavNodeFactory.setNavSession(bISession); + array.add((Object)bSessionNavNodeFactory); + if (bISession.isConnected()) { + bSessionNavNodeFactory.connect(); + } + } + ++n; + } + return (BSessionNavNodeFactory[])array.trim(); + } + + public abstract void connect(); + + public void disconnect() { + } + + public final Array getNavNodes() { + return this.navNodes; + } + + public final BSessionNavNode getNavNode(String string) { + if (this.navNodes != null) { + int n = 0; + while (n < this.navNodes.size()) { + if (((BSessionNavNode)((Object)this.navNodes.get(n))).getNavName().equals(string)) { + return (BSessionNavNode)((Object)this.navNodes.get(n)); + } + ++n; + } + } + return null; + } + + public void setNavSession(BISession bISession) { + this.session = bISession; + } + + public final BISession getNavSession() { + return this.session; + } + + protected final void setNavNodes(Array array) { + this.navNodes = array; + } + + protected final void setNavNodes(BSessionNavNode[] bSessionNavNodeArray) { + this.setNavNodes(new Array((Object[])bSessionNavNodeArray)); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$platform$BSessionNavNodeFactory; + if (clazz == null) { + clazz = class$com$tridium$platform$BSessionNavNodeFactory = BSessionNavNodeFactory.class("[Lcom.tridium.platform.BSessionNavNodeFactory;", false); + } + TYPE = Sys.loadType((Class)clazz); + NAV_NODE_COMPARATOR = new Comparator(){ + + public final int compare(Object object, Object object2) { + BINavNode bINavNode = (BINavNode)object; + BINavNode bINavNode2 = (BINavNode)object2; + return bINavNode.getNavDisplayName(null).compareTo(bINavNode2.getNavDisplayName(null)); + } + }; + } +} + diff --git a/modules/cfr_output/com/tridium/platform/BStationRenameCleanupJob.java b/modules/cfr_output/com/tridium/platform/BStationRenameCleanupJob.java new file mode 100644 index 0000000..84019da --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/BStationRenameCleanupJob.java @@ -0,0 +1,96 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.job.BSimpleJob + * javax.baja.sys.Context + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform; + +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.daemon.LocalSessionUtil; +import com.tridium.platform.daemon.message.DeleteStationMessage; +import javax.baja.job.BSimpleJob; +import javax.baja.sys.Context; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public final class BStationRenameCleanupJob +extends BSimpleJob { + public static final Property oldStationName = BStationRenameCleanupJob.newProperty((int)0, (String)"", null); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platform$BStationRenameCleanupJob; + + public final String getOldStationName() { + return this.getString(oldStationName); + } + + public final void setOldStationName(String string) { + this.setString(oldStationName, string, null); + } + + public final Type getType() { + return TYPE; + } + + public final void stationStarted() throws Exception { + new Thread(this.getType().toString()){ + + public final void run() { + try { + Thread.sleep(100L); + } + catch (Exception exception) { + exception.printStackTrace(); + } + BStationRenameCleanupJob.this.getParent().asComponent().remove(BStationRenameCleanupJob.this.getName()); + BStationRenameCleanupJob.this.submit(null); + } + }.start(); + } + + public final void run(Context context) throws Exception { + BDaemonSession bDaemonSession; + this.setProgress(50); + if (!Sys.getStation().getStationName().equals(this.getOldStationName())) { + bDaemonSession = LocalSessionUtil.getLocalSession(); + if (bDaemonSession == null) { + throw new Exception("Could not rename Station. Please ensure Station is running from Platform!"); + } + } else { + throw new Exception("Cannot rename station; station files must locked by another process."); + } + bDaemonSession.sendMessage(new DeleteStationMessage(this.getOldStationName())); + this.log().success("Station rename from " + this.getOldStationName() + " to " + Sys.getStation().getStationName() + " complete."); + this.setProgress(100); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$platform$BStationRenameCleanupJob; + if (clazz == null) { + clazz = class$com$tridium$platform$BStationRenameCleanupJob = BStationRenameCleanupJob.class("[Lcom.tridium.platform.BStationRenameCleanupJob;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/BSystemPlatformService.java b/modules/cfr_output/com/tridium/platform/BSystemPlatformService.java new file mode 100644 index 0000000..8c586d7 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/BSystemPlatformService.java @@ -0,0 +1,1409 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.fox.sys.BFoxChannelRegistry + * com.tridium.fox.sys.BFoxSession + * com.tridium.net.HttpUtil + * com.tridium.nre.security.fips.EntrustProviderManager + * com.tridium.nre.util.JavaTimeUtil + * com.tridium.sys.Nre + * com.tridium.sys.NreLib + * com.tridium.sys.resource.ResourceReport + * com.tridium.sys.station.Station + * com.tridium.sys.station.Station$SaveListener + * com.tridium.timezone.TzJarUtil + * com.tridium.timezone.TzXmlDecoder + * javax.baja.data.BIDataValue + * javax.baja.file.BFileSystem + * javax.baja.file.BIFile + * javax.baja.file.FilePath + * javax.baja.job.BJobState + * javax.baja.license.FeatureNotLicensedException + * javax.baja.naming.BOrd + * javax.baja.naming.SlotPath + * javax.baja.naming.UnresolvedException + * javax.baja.nre.util.Array + * javax.baja.spy.SpyWriter + * javax.baja.sys.Action + * javax.baja.sys.BAbsTime + * javax.baja.sys.BBoolean + * javax.baja.sys.BComponent + * javax.baja.sys.BFacets + * javax.baja.sys.BIcon + * javax.baja.sys.BInteger + * javax.baja.sys.BObject + * javax.baja.sys.BRelTime + * javax.baja.sys.BStation + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.BVector + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.Clock + * javax.baja.sys.Context + * javax.baja.sys.LocalizableRuntimeException + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.sys.TypeNotFoundException + * javax.baja.timezone.BTimeZone + * javax.baja.timezone.DstRule + * javax.baja.units.BUnit + * javax.baja.util.BFormat + * javax.baja.util.BStationNameValidator + * javax.baja.util.BTypeSpec + * javax.baja.util.CannotValidateException + * javax.baja.util.Version + * javax.baja.xml.XElem + * javax.baja.xml.XParser + */ +package com.tridium.platform; + +import com.tridium.fox.sys.BFoxChannelRegistry; +import com.tridium.fox.sys.BFoxSession; +import com.tridium.net.HttpUtil; +import com.tridium.nre.security.fips.EntrustProviderManager; +import com.tridium.nre.util.JavaTimeUtil; +import com.tridium.platform.BEngineWatchdogPolicy; +import com.tridium.platform.BPlatform; +import com.tridium.platform.BPlatformService; +import com.tridium.platform.BStationRenameCleanupJob; +import com.tridium.platform.IPlatformLibrary; +import com.tridium.platform.alarm.BIAlarmablePlatformService; +import com.tridium.platform.alarm.BPlatformAlarmProxy; +import com.tridium.platform.alarm.BPlatformAlarmSupport; +import com.tridium.platform.alarm.BPlatformServiceAlarmRecord; +import com.tridium.platform.alarm.PlatformServiceAlarmListener; +import com.tridium.platform.archive.FileArchive; +import com.tridium.platform.archive.NullFileArchive; +import com.tridium.platform.daemon.BDaemonAccessLevel; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.daemon.BStationSurrogate; +import com.tridium.platform.daemon.DaemonFileUtil; +import com.tridium.platform.daemon.LocalSessionUtil; +import com.tridium.platform.daemon.NiagaraPlatformDaemon; +import com.tridium.platform.daemon.message.DaemonMessage; +import com.tridium.platform.daemon.message.FileTransferMessage; +import com.tridium.platform.daemon.message.UpdateStationMessage; +import com.tridium.platform.daemon.message.XmlResponseMessage; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import com.tridium.platform.fox.BTimeChannel; +import com.tridium.platform.timezone.BDstSupportLevel; +import com.tridium.platform.timezone.TimeZoneUtil; +import com.tridium.sys.Nre; +import com.tridium.sys.NreLib; +import com.tridium.sys.resource.ResourceReport; +import com.tridium.sys.station.Station; +import com.tridium.timezone.TzJarUtil; +import com.tridium.timezone.TzXmlDecoder; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Locale; +import javax.baja.data.BIDataValue; +import javax.baja.file.BFileSystem; +import javax.baja.file.BIFile; +import javax.baja.file.FilePath; +import javax.baja.job.BJobState; +import javax.baja.license.FeatureNotLicensedException; +import javax.baja.naming.BOrd; +import javax.baja.naming.SlotPath; +import javax.baja.naming.UnresolvedException; +import javax.baja.nre.util.Array; +import javax.baja.platform.RemoteStation; +import javax.baja.spy.SpyWriter; +import javax.baja.sys.Action; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BIcon; +import javax.baja.sys.BInteger; +import javax.baja.sys.BObject; +import javax.baja.sys.BRelTime; +import javax.baja.sys.BStation; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.BVector; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.Clock; +import javax.baja.sys.Context; +import javax.baja.sys.LocalizableRuntimeException; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.sys.TypeNotFoundException; +import javax.baja.timezone.BTimeZone; +import javax.baja.timezone.DstRule; +import javax.baja.units.BUnit; +import javax.baja.util.BFormat; +import javax.baja.util.BStationNameValidator; +import javax.baja.util.BTypeSpec; +import javax.baja.util.CannotValidateException; +import javax.baja.util.Version; +import javax.baja.xml.XElem; +import javax.baja.xml.XParser; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BSystemPlatformService +extends BPlatformService +implements BIAlarmablePlatformService { + public static final Property javaVmName = BSystemPlatformService.newProperty((int)3, (String)"", null); + public static final Property javaVmVendor = BSystemPlatformService.newProperty((int)3, (String)"", null); + public static final Property javaVmVersion = BSystemPlatformService.newProperty((int)3, (String)"", null); + public static final Property osArch = BSystemPlatformService.newProperty((int)3, (String)"", null); + public static final Property osName = BSystemPlatformService.newProperty((int)3, (String)"", null); + public static final Property osVersion = BSystemPlatformService.newProperty((int)3, (String)"", null); + public static final Property hostId = BSystemPlatformService.newProperty((int)3, (String)"", null); + public static final Property model = BSystemPlatformService.newProperty((int)3, (String)"", null); + public static final Property niagaraVersion = BSystemPlatformService.newProperty((int)3, (String)"", null); + public static final Property locale = BSystemPlatformService.newProperty((int)3, (String)"", (BFacets)BFacets.make((String[])new String[]{"min", "fieldWidth"}, (BIDataValue[])new BInteger[]{BInteger.make((int)2), BInteger.make((int)8)})); + public static final Property stationName = BSystemPlatformService.newProperty((int)3, (String)"system", null); + public static final Property systemTime = BSystemPlatformService.newProperty((int)3, (BValue)Clock.time((int)1000), null); + public static final Property timeZone = BSystemPlatformService.newProperty((int)3, (BValue)BTimeZone.DEFAULT, null); + public static final Property currentCpuUsage = BSystemPlatformService.newProperty((int)3, (int)-1, (BFacets)BFacets.make((String)"units", (BIDataValue)BUnit.getUnit((String)"percent"))); + public static final Property overallCpuUsage = BSystemPlatformService.newProperty((int)3, (int)-1, (BFacets)BFacets.make((String)"units", (BIDataValue)BUnit.getUnit((String)"percent"))); + public static final Property numCpus = BSystemPlatformService.newProperty((int)3, (int)1, null); + public static final Property totalPhysicalMemory = BSystemPlatformService.newProperty((int)3, (int)-1, null); + public static final Property freePhysicalMemory = BSystemPlatformService.newProperty((int)3, (int)-1, null); + public static final Property filesystemAttributes = BSystemPlatformService.newProperty((int)3, (BValue)new BVector(), null); + public static final Property isStation = BSystemPlatformService.newProperty((int)3, (boolean)false, null); + public static final Property engineWatchdogPolicy = BSystemPlatformService.newProperty((int)1, (BValue)BEngineWatchdogPolicy.terminate, null); + public static final Property engineWatchdogTimeout = BSystemPlatformService.newProperty((int)1, (BValue)BRelTime.MINUTE, (BFacets)BFacets.make((String[])new String[]{"units", "min", "showSeconds"}, (BIDataValue[])new BIDataValue[]{BUnit.getUnit((String)"minute"), BRelTime.make((long)0L), BBoolean.FALSE})); + public static final Property isStationAutoSaveEnabled = BSystemPlatformService.newProperty((int)1, (boolean)true, null); + public static final Property stationAutoSaveFrequency = BSystemPlatformService.newProperty((int)1, (BValue)BRelTime.HOUR, (BFacets)BFacets.make((String[])new String[]{"units", "min", "showSeconds"}, (BIDataValue[])new BIDataValue[]{BUnit.getUnit((String)"minute"), BRelTime.makeMinutes((int)1), BBoolean.FALSE})); + public static final Property stationSaveBackupCount = BSystemPlatformService.newProperty((int)1, (int)3, null); + public static final Property timezoneDayModeSupport = BSystemPlatformService.newProperty((int)3, (BValue)BDstSupportLevel.none, null); + public static final Property localDaemonAccess = BSystemPlatformService.newProperty((int)3, (BValue)BDaemonAccessLevel.none, null); + public static final Property localDaemonPort = BSystemPlatformService.newProperty((int)3, (int)-1, null); + public static final Property localDaemonSslPort = BSystemPlatformService.newProperty((int)3, (int)-1, null); + public static final Property stationSaveAlarmSupport = BSystemPlatformService.newProperty((int)0, (BValue)BSystemPlatformService.initStationSaveAlarmSupport(), null); + public static final Property stationSaveAlarmProxy = BSystemPlatformService.newProperty((int)6, (BValue)new BPlatformAlarmProxy(), null); + public static final Property bajaHome = BSystemPlatformService.newProperty((int)6, (String)"unknown", null); + public static final Property allowStationRestart = BSystemPlatformService.newProperty((int)3, (boolean)false, null); + public static final Property fipsStatus = BSystemPlatformService.newProperty((int)3, (String)"", null); + public static final Action getFilesystemForPath = BSystemPlatformService.newAction((int)4, (BValue)BString.DEFAULT, null); + public static final Action getAllTimeZones = BSystemPlatformService.newAction((int)4, null); + public static final Action reboot = BSystemPlatformService.newAction((int)4, null); + public static final Action requestGarbageCollection = BSystemPlatformService.newAction((int)0, null); + public static final Action sendThreadDumpToConsole = BSystemPlatformService.newAction((int)0, null); + public static final Action restartStation = BSystemPlatformService.newAction((int)128, null); + public static final Action renameAndRestartStation = BSystemPlatformService.newAction((int)132, (BValue)BString.make((String)"newStationName"), (BFacets)BFacets.make((String)"validator", (String)"baja:StationNameValidator")); + public static final Type TYPE; + private static final BIcon icon; + private static final BTypeSpec STATION_OUTPUT_SERVLET; + private static final String ALARM_TYPE_STATION_SAVE = "station save failure"; + private BStation station; + private BVector allTimeZones; + private boolean allowTimeUpdate; + private boolean timeUpdated; + private boolean timeZoneUpdated; + private boolean localeUpdated; + private boolean allowLocaleUpdate; + private SaveListener saveListener; + private volatile boolean stationSaveListenerActive; + static /* synthetic */ Class class$com$tridium$platform$BSystemPlatformService; + static /* synthetic */ Class class$javax$baja$timezone$BTimeZone; + + public String getJavaVmName() { + return this.getString(javaVmName); + } + + public void setJavaVmName(String string) { + this.setString(javaVmName, string, null); + } + + public String getJavaVmVendor() { + return this.getString(javaVmVendor); + } + + public void setJavaVmVendor(String string) { + this.setString(javaVmVendor, string, null); + } + + public String getJavaVmVersion() { + return this.getString(javaVmVersion); + } + + public void setJavaVmVersion(String string) { + this.setString(javaVmVersion, string, null); + } + + public String getOsArch() { + return this.getString(osArch); + } + + public void setOsArch(String string) { + this.setString(osArch, string, null); + } + + public String getOsName() { + return this.getString(osName); + } + + public void setOsName(String string) { + this.setString(osName, string, null); + } + + public String getOsVersion() { + return this.getString(osVersion); + } + + public void setOsVersion(String string) { + this.setString(osVersion, string, null); + } + + public String getHostId() { + return this.getString(hostId); + } + + public void setHostId(String string) { + this.setString(hostId, string, null); + } + + public String getModel() { + return this.getString(model); + } + + public void setModel(String string) { + this.setString(model, string, null); + } + + public String getNiagaraVersion() { + return this.getString(niagaraVersion); + } + + public void setNiagaraVersion(String string) { + this.setString(niagaraVersion, string, null); + } + + public String getLocale() { + return this.getString(locale); + } + + public void setLocale(String string) { + this.setString(locale, string, null); + } + + public String getStationName() { + return this.getString(stationName); + } + + public void setStationName(String string) { + this.setString(stationName, string, null); + } + + public BAbsTime getSystemTime() { + return (BAbsTime)this.get(systemTime); + } + + public void setSystemTime(BAbsTime bAbsTime) { + this.set(systemTime, (BValue)bAbsTime, null); + } + + public BTimeZone getTimeZone() { + return (BTimeZone)this.get(timeZone); + } + + public void setTimeZone(BTimeZone bTimeZone) { + this.set(timeZone, (BValue)bTimeZone, null); + } + + public int getCurrentCpuUsage() { + return this.getInt(currentCpuUsage); + } + + public void setCurrentCpuUsage(int n) { + this.setInt(currentCpuUsage, n, null); + } + + public int getOverallCpuUsage() { + return this.getInt(overallCpuUsage); + } + + public void setOverallCpuUsage(int n) { + this.setInt(overallCpuUsage, n, null); + } + + public int getNumCpus() { + return this.getInt(numCpus); + } + + public void setNumCpus(int n) { + this.setInt(numCpus, n, null); + } + + public int getTotalPhysicalMemory() { + return this.getInt(totalPhysicalMemory); + } + + public void setTotalPhysicalMemory(int n) { + this.setInt(totalPhysicalMemory, n, null); + } + + public int getFreePhysicalMemory() { + return this.getInt(freePhysicalMemory); + } + + public void setFreePhysicalMemory(int n) { + this.setInt(freePhysicalMemory, n, null); + } + + public BVector getFilesystemAttributes() { + return (BVector)this.get(filesystemAttributes); + } + + public void setFilesystemAttributes(BVector bVector) { + this.set(filesystemAttributes, (BValue)bVector, null); + } + + public boolean getIsStation() { + return this.getBoolean(isStation); + } + + public void setIsStation(boolean bl) { + this.setBoolean(isStation, bl, null); + } + + public BEngineWatchdogPolicy getEngineWatchdogPolicy() { + return (BEngineWatchdogPolicy)this.get(engineWatchdogPolicy); + } + + public void setEngineWatchdogPolicy(BEngineWatchdogPolicy bEngineWatchdogPolicy) { + this.set(engineWatchdogPolicy, (BValue)bEngineWatchdogPolicy, null); + } + + public BRelTime getEngineWatchdogTimeout() { + return (BRelTime)this.get(engineWatchdogTimeout); + } + + public void setEngineWatchdogTimeout(BRelTime bRelTime) { + this.set(engineWatchdogTimeout, (BValue)bRelTime, null); + } + + public boolean getIsStationAutoSaveEnabled() { + return this.getBoolean(isStationAutoSaveEnabled); + } + + public void setIsStationAutoSaveEnabled(boolean bl) { + this.setBoolean(isStationAutoSaveEnabled, bl, null); + } + + public BRelTime getStationAutoSaveFrequency() { + return (BRelTime)this.get(stationAutoSaveFrequency); + } + + public void setStationAutoSaveFrequency(BRelTime bRelTime) { + this.set(stationAutoSaveFrequency, (BValue)bRelTime, null); + } + + public int getStationSaveBackupCount() { + return this.getInt(stationSaveBackupCount); + } + + public void setStationSaveBackupCount(int n) { + this.setInt(stationSaveBackupCount, n, null); + } + + public BDstSupportLevel getTimezoneDayModeSupport() { + return (BDstSupportLevel)this.get(timezoneDayModeSupport); + } + + public void setTimezoneDayModeSupport(BDstSupportLevel bDstSupportLevel) { + this.set(timezoneDayModeSupport, (BValue)bDstSupportLevel, null); + } + + public BDaemonAccessLevel getLocalDaemonAccess() { + return (BDaemonAccessLevel)this.get(localDaemonAccess); + } + + public void setLocalDaemonAccess(BDaemonAccessLevel bDaemonAccessLevel) { + this.set(localDaemonAccess, (BValue)bDaemonAccessLevel, null); + } + + public int getLocalDaemonPort() { + return this.getInt(localDaemonPort); + } + + public void setLocalDaemonPort(int n) { + this.setInt(localDaemonPort, n, null); + } + + public int getLocalDaemonSslPort() { + return this.getInt(localDaemonSslPort); + } + + public void setLocalDaemonSslPort(int n) { + this.setInt(localDaemonSslPort, n, null); + } + + public BPlatformAlarmSupport getStationSaveAlarmSupport() { + return (BPlatformAlarmSupport)this.get(stationSaveAlarmSupport); + } + + public void setStationSaveAlarmSupport(BPlatformAlarmSupport bPlatformAlarmSupport) { + this.set(stationSaveAlarmSupport, (BValue)bPlatformAlarmSupport, null); + } + + public BPlatformAlarmProxy getStationSaveAlarmProxy() { + return (BPlatformAlarmProxy)this.get(stationSaveAlarmProxy); + } + + public void setStationSaveAlarmProxy(BPlatformAlarmProxy bPlatformAlarmProxy) { + this.set(stationSaveAlarmProxy, (BValue)bPlatformAlarmProxy, null); + } + + public String getBajaHome() { + return this.getString(bajaHome); + } + + public void setBajaHome(String string) { + this.setString(bajaHome, string, null); + } + + public boolean getAllowStationRestart() { + return this.getBoolean(allowStationRestart); + } + + public void setAllowStationRestart(boolean bl) { + this.setBoolean(allowStationRestart, bl, null); + } + + public String getFipsStatus() { + return this.getString(fipsStatus); + } + + public void setFipsStatus(String string) { + this.setString(fipsStatus, string, null); + } + + public BString getFilesystemForPath(BString bString) { + return (BString)this.invoke(getFilesystemForPath, (BValue)bString, null); + } + + public BVector getAllTimeZones() { + return (BVector)this.invoke(getAllTimeZones, null, null); + } + + public void reboot() { + this.invoke(reboot, null, null); + } + + public void requestGarbageCollection() { + this.invoke(requestGarbageCollection, null, null); + } + + public void sendThreadDumpToConsole() { + this.invoke(sendThreadDumpToConsole, null, null); + } + + public void restartStation() { + this.invoke(restartStation, null, null); + } + + public void renameAndRestartStation(BString bString) { + this.invoke(renameAndRestartStation, (BValue)bString, null); + } + + public Type getType() { + return TYPE; + } + + public void serviceStarted() throws Exception { + super.serviceStarted(); + this.setJavaVmName(System.getProperty("java.vm.name")); + this.setJavaVmVendor(System.getProperty("java.vm.vendor")); + this.setJavaVmVersion(System.getProperty("java.vm.version")); + this.setOsArch(System.getProperty("os.arch")); + this.setOsName(System.getProperty("os.name")); + this.setOsVersion(System.getProperty("os.version")); + this.setHostId(Nre.getHostId()); + this.setModel(Nre.getHostModel()); + this.setBajaHome(Sys.getBajaHome().getAbsolutePath()); + this.setNiagaraVersion(Sys.loadModule((String)"baja").getVendorVersion().toString()); + BFoxChannelRegistry bFoxChannelRegistry = BFoxChannelRegistry.getPrototype(); + if (bFoxChannelRegistry.get("time") == null) { + bFoxChannelRegistry.add("time", (BValue)new BTimeChannel()); + } + } + + public void serviceStopped() throws Exception { + Station.removeSaveListener((Station.SaveListener)this.saveListener); + BFoxChannelRegistry bFoxChannelRegistry = BFoxChannelRegistry.getPrototype(); + if (bFoxChannelRegistry.get("time") != null) { + bFoxChannelRegistry.remove("time"); + } + } + + public void doStationStarted(BStation bStation) { + this.station = bStation; + this.setIsStation(true); + this.setStationName(this.station.getStationName()); + new StationStartupWorker().start(); + } + + public boolean isChildLegal(BComponent bComponent) { + return bComponent.getType().getTypeSpec().equals((Object)STATION_OUTPUT_SERVLET); + } + + public boolean isOnLocalHost() { + return Nre.getHostId().equals(this.getHostId()); + } + + public boolean isValidPlatform() { + return false; + } + + public int getSlotFlags() { + return 0; + } + + public void loadPlatformServiceProperties() { + BTimeZone bTimeZone; + super.loadPlatformServiceProperties(); + this.getStationSaveAlarmProxy().setAlarmSupport(this.getStationSaveAlarmSupport()); + LocalSessionUtil.getLocalSession(); + this.allowTimeUpdate = false; + this.setSystemTime(Clock.time((int)1000)); + this.setTimeZone(BTimeZone.getLocal()); + try { + BTimeZone bTimeZone2 = this.getPlatformTimeZone(); + bTimeZone = this.getTimeZone(); + if (bTimeZone2 == null) { + bTimeZone2 = BTimeZone.UTC; + } + if (bTimeZone == null) { + bTimeZone = BTimeZone.UTC; + } + if (!TimeZoneUtil.isEquivalent(bTimeZone2, bTimeZone)) { + BPlatform.log.warning("OS Time zone '" + bTimeZone2 + "' is not the same as the station time zone '" + bTimeZone + '\''); + } + } + catch (Exception exception) { + BPlatform.log.warning("error checking platform time zone", (Throwable)exception); + } + this.allowTimeUpdate = true; + this.allowLocaleUpdate = false; + this.setLocale(Locale.getDefault().toString()); + this.allowLocaleUpdate = true; + boolean bl = false; + try { + Sys.getLicenseManager().checkFeature("Tridium", "fips140-2"); + bl = true; + } + catch (FeatureNotLicensedException featureNotLicensedException) {} + bTimeZone = new EntrustProviderManager(); + boolean bl2 = bTimeZone.verifyProviders(); + if (bl && bl2) { + this.setFipsStatus(this.getLexicon().getText("labels.system.fipsEnabled")); + } + if (bl && !bl2) { + this.setFipsStatus(this.getLexicon().getText("labels.system.fipsLicensedNotInstalled")); + } else if (!bl && bl2) { + this.setFipsStatus(this.getLexicon().getText("labels.system.fipsInstalledNotLicensed")); + } + } + + public void changed(Property property, Context context) { + super.changed(property, context); + if (this.allowTimeUpdate && this.platformServicePropertiesLoaded) { + if (property == systemTime) { + this.timeUpdated = true; + } + if (property == timeZone) { + this.timeZoneUpdated = true; + } + } + if (this.allowLocaleUpdate && this.platformServicePropertiesLoaded && property == locale) { + this.localeUpdated = true; + } + } + + protected boolean startPollTimerOnSubscribe() { + return true; + } + + public BRelTime getPollFrequency() { + return BRelTime.makeSeconds((int)5); + } + + public void doPoll(Context context) { + if (!this.isRunning()) { + return; + } + super.doPoll(context); + if (!this.timeUpdated) { + this.allowTimeUpdate = false; + this.setSystemTime(Clock.time((int)1000)); + this.allowTimeUpdate = true; + } + } + + public void doSavePlatformServiceProperties() throws Exception { + if (!this.isRunning()) { + return; + } + super.doSavePlatformServiceProperties(); + this.checkPropertiesLoaded(); + if (this.localeUpdated) { + if (!this.setBajaLocaleId(this.getLocale())) { + if (this.stationSaveListenerActive) { + BPlatform.log.warning("Failed to setBajaLocaleId(" + this.getLocale() + ") during station save"); + } else { + throw new BajaRuntimeException("Failed to setBajaLocaleId(" + this.getLocale() + ')'); + } + } + this.localeUpdated = false; + } + if (this.timeZoneUpdated || this.timeUpdated) { + BTimeZone bTimeZone = this.getTimeZone(); + if (!this.setBajaTimeZoneId(bTimeZone.getId())) { + if (this.stationSaveListenerActive) { + BPlatform.log.warning("Failed to setBajaTimeZoneId(" + bTimeZone.getId() + ") during station save"); + } else { + throw new BajaRuntimeException("Failed to setBajaTimeZoneId(" + bTimeZone.getId() + ')'); + } + } + if (this.getLocalDaemonAccess() != BDaemonAccessLevel.restricted) { + BDaemonSession bDaemonSession; + DstRule dstRule; + long l = this.getSystemTime().getMillis(); + if (!TimeZoneUtil.isSupported(l, bTimeZone, this.getTimezoneDayModeSupport())) { + BPlatform.log.warning("Time zone '" + bTimeZone + "' is not supported by the operating system, using UTC as the OS time zone"); + bTimeZone = BTimeZone.UTC; + } + int n = bTimeZone.getUtcOffset(l) / 60000; + int n2 = bTimeZone.getDaylightAdjustment(l) / 60000; + DstRule dstRule2 = DstRule.getWallTimeRule((DstRule)bTimeZone.getDaylightStartRule(l), (int)0, (BTimeZone)bTimeZone); + if (dstRule2 != null && (dstRule2.getDayMode() == 1 || dstRule2.getDayMode() == 2) && this.getTimezoneDayModeSupport().getOrdinal() != 3) { + dstRule2 = DstRule.asWeekdayRule((DstRule)dstRule2); + } + int n3 = -1; + int n4 = -1; + int n5 = -1; + int n6 = -1; + int n7 = -1; + int n8 = -1; + int n9 = -1; + if (dstRule2 != null) { + if (dstRule2.getTime() != null) { + n3 = dstRule2.getTime().getHour(); + n4 = dstRule2.getTime().getMinute(); + } + if (dstRule2.getMonth() != null) { + n5 = dstRule2.getMonth().getOrdinal(); + } + n6 = dstRule2.getDay(); + n7 = dstRule2.getDayMode(); + n8 = dstRule2.getWeek(); + if (dstRule2.getWeekday() != null) { + n9 = dstRule2.getWeekday().getOrdinal(); + } + } + if ((dstRule = DstRule.getWallTimeRule((DstRule)bTimeZone.getDaylightEndRule(l), (int)1, (BTimeZone)bTimeZone)) != null && (dstRule.getDayMode() == 1 || dstRule.getDayMode() == 2) && this.getTimezoneDayModeSupport().getOrdinal() != 3) { + dstRule = DstRule.asWeekdayRule((DstRule)dstRule); + } + int n10 = -1; + int n11 = -1; + int n12 = -1; + int n13 = -1; + int n14 = -1; + int n15 = -1; + int n16 = -1; + if (dstRule != null) { + if (dstRule.getTime() != null) { + n10 = dstRule.getTime().getHour(); + n11 = dstRule.getTime().getMinute(); + } + if (dstRule.getMonth() != null) { + n12 = dstRule.getMonth().getOrdinal(); + } + n13 = dstRule.getDay(); + n14 = dstRule.getDayMode(); + n15 = dstRule.getWeek(); + if (dstRule.getWeekday() != null) { + n16 = dstRule.getWeekday().getOrdinal(); + } + } + if (!this.setPlatformTimeZone(bTimeZone.getId(), n, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16)) { + if (this.stationSaveListenerActive) { + BPlatform.log.warning("Failed to setPlatformTimeZone(" + bTimeZone.getId() + ") during station save"); + } else { + throw new BajaRuntimeException("Failed to setPlatformTimeZone(" + bTimeZone.getId() + ')'); + } + } + if ((bDaemonSession = LocalSessionUtil.getLocalSession()) != null) { + try { + bDaemonSession.sendMessage(new DaemonMessage(){ + + public final String getMessageString() { + return "updatedaemon?reloadTz"; + } + }); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + } + this.timeZoneUpdated = false; + } + if (this.timeUpdated) { + if (this.getLocalDaemonAccess() != BDaemonAccessLevel.restricted && !this.setPlatformSystemTime(this.getSystemTime().getMillis())) { + if (this.stationSaveListenerActive) { + BPlatform.log.warning("Failed to setPlatformSystemTime(" + this.getSystemTime().getMillis() + ") during station save"); + } else { + throw new BajaRuntimeException("Failed to setPlatformSystemTime(" + this.getSystemTime().getMillis() + ')'); + } + } + this.timeUpdated = false; + } + } + + public BIcon getIcon() { + return icon; + } + + public boolean hasNavChildren() { + return false; + } + + public void doReboot() throws Exception { + if (LocalSessionUtil.localDaemonIsAvailable()) { + new Thread("BSystemPlatormService::doReboot"){ + + public final void run() { + try { + Thread.sleep(1L); + LocalSessionUtil.getLocalSession().sendRebootRequest(false); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + }.start(); + } + } + + public void doSendThreadDumpToConsole() { + NreLib.dumpThreads(); + } + + public void doRestartStation() throws Exception { + if (Sys.getStation() == null) { + throw new LocalizableRuntimeException("platform", "system.error.notStation"); + } + if (!LocalSessionUtil.localDaemonIsAvailable()) { + throw new LocalizableRuntimeException("platform", "system.error.localDaemonUnavailable"); + } + new Thread(new Runnable(){ + + public final void run() { + try { + Thread.sleep(3000L); + BSystemPlatformService.this.sendRestartRequest(false); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + }, "BSystemPlatormService::doRestartStation").start(); + } + + public void sendRestartRequest(boolean bl) throws Exception { + if (Sys.getStation() == null) { + throw new LocalizableRuntimeException("platform", "system.error.notStation"); + } + if (!LocalSessionUtil.localDaemonIsAvailable()) { + throw new LocalizableRuntimeException("platform", "system.error.localDaemonUnavailable"); + } + BStationSurrogate bStationSurrogate = BStationSurrogate.make(LocalSessionUtil.getLocalSession(), this.getStationName()); + bStationSurrogate.restartStationAsync(bl); + } + + public IPlatformLibrary getPlatformLibrary() { + throw new UnsupportedOperationException(); + } + + public void systemLog(int n, String string) throws Exception { + this.getPlatformLibrary().log(n, string); + } + + public BTimeZone getPlatformTimeZone() throws Exception { + String string; + block2: { + string = this.getPlatformLibrary().getNativeTimeZone(); + try { + XParser.make((String)string).parse(); + } + catch (Exception exception) { + string = JavaTimeUtil.convertOlsonIdToTimeZoneXml((String)string); + if (string != null) break block2; + string = ""; + } + } + return TzXmlDecoder.getTimeZone((XElem)XParser.make((String)string).parse(), (boolean)false); + } + + public boolean setPlatformSystemTime(long l) { + boolean bl = false; + if (this.getPlatformLibrary().setSystemTime(l) == 0) { + bl = true; + } + return bl; + } + + public boolean setBajaTimeZoneId(String string) { + return NreLib.setSystemProperty((String)"niagara.timezone", (String)string); + } + + public boolean setBajaLocaleId(String string) { + return NreLib.setSystemProperty((String)"niagara.lang", (String)string); + } + + public boolean setPlatformTimeZone(String string, int n, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12, int n13, int n14, int n15, int n16) { + int n17 = this.getPlatformLibrary().setNativeTimeZone(string, n, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16); + boolean bl = false; + if (n17 == 0) { + bl = true; + } + return bl; + } + + public BString doGetFilesystemForPath(BString bString) throws Exception { + File file = BFileSystem.INSTANCE.pathToLocalFile(new FilePath(bString.toString())); + FilePath filePath = BFileSystem.INSTANCE.localFileToPath(new File(file.getCanonicalPath())); + return BString.make((String)this.makeRootName(filePath.nameAt(0))); + } + + public void doRenameAndRestartStation(final BString bString) { + new Thread(new Runnable(){ + + public final void run() { + BSystemPlatformService.this.renameAndRestart(Sys.getStation().getStationName(), bString.getString()); + } + }, "RenameAndRestartStationThread").start(); + } + + private final void renameAndRestart(String string, String string2) { + if (string == null || string2 == null) { + BPlatform.log.error("No Station running to rename!"); + return; + } + try { + BStationNameValidator.INSTANCE.validate((BObject)BString.make((String)string2), null); + } + catch (CannotValidateException cannotValidateException) { + BPlatform.log.error("Cannot rename Station. " + cannotValidateException.getMessage(), (Throwable)cannotValidateException); + return; + } + if (string.equals(string2)) { + return; + } + try { + int n; + BDaemonSession bDaemonSession = LocalSessionUtil.getLocalSession(); + if (bDaemonSession == null) { + BPlatform.log.error("No Daemon Session available. Please ensure Station is running from the Platform for Station rename!"); + return; + } + NiagaraPlatformDaemon niagaraPlatformDaemon = NiagaraPlatformDaemon.make(bDaemonSession, DaemonSessionTaskListener.NULL_TASK_LISTENER); + RemoteStation[] remoteStationArray = niagaraPlatformDaemon.getStationManager().getAllStations(); + if (remoteStationArray.length > (n = bDaemonSession.getHostProperties().getMaxStations())) { + BPlatform.log.error("Cannot rename Station. Max App limit reached! There cannot be more than " + n + " Stations in Niagara's 'stations' directory"); + return; + } + int n2 = 0; + while (n2 < remoteStationArray.length) { + if (remoteStationArray[n2].getName().equals(string2)) { + BPlatform.log.error("Cannot rename Station to " + string2 + ". Station already exists!"); + return; + } + ++n2; + } + RemoteStation remoteStation = null; + int n3 = 0; + while (n3 < remoteStationArray.length) { + if (remoteStationArray[n3].getName().equals(string)) { + remoteStation = remoteStationArray[n3]; + break; + } + ++n3; + } + if (remoteStation == null) { + BPlatform.log.error("Cannot find Station to rename: " + string); + return; + } + this.doRenameAndRestart(bDaemonSession, string, string2); + } + catch (Exception exception) { + BPlatform.log.error("Could not commit platform changes for Station rename", (Throwable)exception); + } + } + + protected void doRenameAndRestart(BDaemonSession bDaemonSession, String string, String string2) throws Exception { + Runtime.getRuntime().addShutdownHook(new RenameShutdownHook(string, string2)); + BStationRenameCleanupJob bStationRenameCleanupJob = new BStationRenameCleanupJob(); + bStationRenameCleanupJob.setOldStationName(string); + Sys.getStation().add(null, (BValue)bStationRenameCleanupJob, 5); + BStationSurrogate bStationSurrogate = BStationSurrogate.make(bDaemonSession, string); + bStationSurrogate.stopStation(null, null); + } + + public boolean archiveEnabled(String string) { + return false; + } + + public FileArchive createFileArchive(String string) { + return new NullFileArchive(); + } + + public void extractArchive(String string) { + } + + public String getRuntimeDirectory(String string) { + return "^" + string; + } + + public void addPlatformServiceAlarmListener(PlatformServiceAlarmListener platformServiceAlarmListener) { + this.getStationSaveAlarmProxy().addPlatformServiceAlarmListener(platformServiceAlarmListener); + } + + public void removePlatformServiceAlarmListener(PlatformServiceAlarmListener platformServiceAlarmListener) { + this.getStationSaveAlarmProxy().removePlatformServiceAlarmListener(platformServiceAlarmListener); + } + + public void firePlatformServiceAlarmEvent(BPlatformServiceAlarmRecord bPlatformServiceAlarmRecord) { + throw new IllegalStateException(); + } + + public BBoolean ackAlarm(BPlatformServiceAlarmRecord bPlatformServiceAlarmRecord) { + throw new IllegalStateException(); + } + + protected static BPlatformAlarmSupport initStationSaveAlarmSupport() { + BPlatformAlarmSupport bPlatformAlarmSupport = new BPlatformAlarmSupport(); + bPlatformAlarmSupport.setSourceName(BFormat.make((String)"%parent.displayName%")); + bPlatformAlarmSupport.setToFaultText(BFormat.make((String)"%lexicon(platform:SystemPlatformService.stationSaveFailure)%")); + bPlatformAlarmSupport.setToNormalText(BFormat.make((String)"%lexicon(platform:SystemPlatformService.stationSaveSuccess)%")); + HashMap hashMap = new HashMap(); + hashMap.put("alarmType", BString.make((String)ALARM_TYPE_STATION_SAVE)); + bPlatformAlarmSupport.setMetaData(BFacets.make(hashMap)); + return bPlatformAlarmSupport; + } + + public void doRequestGarbageCollection() { + System.gc(); + } + + public BVector getStationTimeZones() { + return this.getStationTimeZones(true); + } + + public BVector doGetAllTimeZones() { + return this.getStationTimeZones(false); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + private final BVector getStationTimeZones(boolean bl) { + BTimeZone bTimeZone; + Object object; + Array array; + block39: { + InputStream inputStream; + if (this.allTimeZones != null) return this.allTimeZones; + array = null; + BTimeChannel bTimeChannel = null; + try { + object = (Version)((BFoxSession)this.getSession()).fw(404, (Object)"platform", null, null, null); + if (object != null && object.compareTo((Object)new Version("3.7.201")) != -1) { + bTimeChannel = (BTimeChannel)((BFoxSession)this.getSession()).getConnection().getChannels().get("time", BTimeChannel.TYPE); + } + } + catch (Exception exception) {} + if (bTimeChannel != null) { + object = null; + try { + try { + object = bTimeChannel.gettimezones(); + array = TzJarUtil.getTimeZones((InputStream)object); + } + catch (Exception exception) { + exception.printStackTrace(); + array = null; + } + inputStream = null; + } + catch (Throwable throwable) { + Object var6_11 = null; + try { + ((InputStream)object).close(); + throw throwable; + } + catch (IOException iOException) {} + throw throwable; + } + try {} + catch (IOException iOException) {} + ((InputStream)object).close(); + } + if (array == null) { + try { + InputStream inputStream2; + try { + object = (BIFile)BOrd.make((String)"file:!lib/timezones.jar").get((BObject)this); + inputStream2 = object.getInputStream(); + try { + array = TzJarUtil.getTimeZones((InputStream)inputStream2); + Object var7_15 = null; + } + catch (Throwable throwable) { + Object var7_14 = null; + try { + inputStream2.close(); + throw throwable; + } + catch (IOException iOException) {} + throw throwable; + } + try {} + catch (IOException iOException) { + } + inputStream2.close(); + } + catch (UnresolvedException unresolvedException) { + if (!bl) break block39; + try { + inputStream2 = (BIFile)BOrd.make((String)"file:!lib/timezones.xml").get((BObject)this); + inputStream = inputStream2.getInputStream(); + Class clazz = class$javax$baja$timezone$BTimeZone; + if (clazz == null) { + clazz = class$javax$baja$timezone$BTimeZone = BSystemPlatformService.class("[Ljavax.baja.timezone.BTimeZone;", false); + } + array = new Array(clazz); + try { + XElem[] xElemArray = XParser.make((InputStream)inputStream).parse().elems("zone"); + int n = 0; + while (n < xElemArray.length) { + array.add((Object)TzXmlDecoder.getTimeZone((XElem)xElemArray[n], (boolean)false)); + ++n; + } + bTimeZone = null; + } + catch (Throwable throwable) { + Object var8_20 = null; + try { + inputStream.close(); + throw throwable; + } + catch (IOException iOException) {} + throw throwable; + } + try {} + catch (IOException iOException) {} + inputStream.close(); + } + catch (UnresolvedException unresolvedException2) {} + } + } + catch (RuntimeException runtimeException) { + throw runtimeException; + } + catch (Exception exception) { + throw new BajaRuntimeException((Throwable)exception); + } + } + } + object = this; + synchronized (object) { + this.allTimeZones = new BVector(); + if (array == null) return this.allTimeZones; + array = array.sort(TimeZoneUtil.TZ_COMPARATOR); + int n = 0; + while (n < array.size()) { + bTimeZone = (BTimeZone)array.get(n); + this.allTimeZones.add(SlotPath.escape((String)bTimeZone.getId()), (BValue)bTimeZone); + ++n; + } + return this.allTimeZones; + } + } + + public String makeRootName(String string) { + throw new UnsupportedOperationException(); + } + + public long getProcessId() { + return -1; + } + + public void spy(SpyWriter spyWriter) throws Exception { + super.spy(spyWriter); + spyWriter.startProps(); + spyWriter.trTitle((Object)"SystemPlatformService", 2); + spyWriter.prop((Object)"onLocalHost", this.isOnLocalHost()); + spyWriter.prop((Object)"processId", (Object)(this.isProxy() ? "remote" : String.valueOf(this.getProcessId()))); + spyWriter.endProps(); + } + + public String checkForStationFault() { + return null; + } + + public void queryResources(ResourceReport resourceReport) { + } + + public Type[] getServiceTypes() { + return new Type[]{TYPE}; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.allTimeZones = null; + this.allowTimeUpdate = true; + this.timeUpdated = false; + this.timeZoneUpdated = false; + this.localeUpdated = false; + this.allowLocaleUpdate = true; + this.saveListener = new SaveListener(); + this.stationSaveListenerActive = false; + } + + public BSystemPlatformService() { + this.this(); + this.setPlatformServiceDescription(this.getLexicon().getText("SystemPlatformService.description")); + } + + static { + Class clazz = class$com$tridium$platform$BSystemPlatformService; + if (clazz == null) { + clazz = class$com$tridium$platform$BSystemPlatformService = BSystemPlatformService.class("[Lcom.tridium.platform.BSystemPlatformService;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BIcon.std((String)"platform.png"); + STATION_OUTPUT_SERVLET = BTypeSpec.make((String)"platform", (String)"StationOutputServlet"); + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class StationStartupWorker + extends Thread { + public void run() { + if (LocalSessionUtil.localDaemonIsAvailable()) { + try { + try { + BSystemPlatformService.this.add("stationOutput", (BValue)Sys.getType((String)"platform:StationOutputServlet").getInstance(), 7); + } + catch (TypeNotFoundException typeNotFoundException) {} + Nre.getPlatform().reportSummaryFields(new String[]{"process"}, new String[]{String.valueOf(BSystemPlatformService.this.getProcessId())}); + EngineMonitor engineMonitor = new EngineMonitor(); + Thread thread = new Thread(engineMonitor, "Plat:EngineMonitor"); + thread.start(); + Station.addSaveListener((Station.SaveListener)BSystemPlatformService.this.saveListener); + } + catch (Exception exception) { + BPlatform.log.error("Error reporting status to platform daemon", (Throwable)exception); + } + } else { + BPlatform.log.warning("Local daemon session not available, skipping engine monitor initialization"); + Station.addSaveListener((Station.SaveListener)BSystemPlatformService.this.saveListener); + } + } + + public StationStartupWorker() { + super("SystemPlatformService:StationStartupWorker"); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class RenameShutdownHook + extends Thread { + private String oldStationName; + private String newStationName; + + public void run() { + BPlatform.log.message("Running Station rename"); + this.finishRename(); + } + + public void finishRename() { + try { + BDaemonSession bDaemonSession = LocalSessionUtil.getLocalSession(); + if (bDaemonSession == null) { + BPlatform.log.error("No Daemon Session available. Please ensure Station is running from the Platform for Station rename!"); + return; + } + NiagaraPlatformDaemon niagaraPlatformDaemon = NiagaraPlatformDaemon.make(bDaemonSession, DaemonSessionTaskListener.NULL_TASK_LISTENER); + RemoteStation[] remoteStationArray = niagaraPlatformDaemon.getStationManager().getAllStations(); + int n = 0; + while (n < remoteStationArray.length) { + if (remoteStationArray[n].getName().equals(this.oldStationName)) { + BPlatform.log.message("Waiting 10 seconds for lock to clear..."); + Thread.sleep(10000L); + BPlatform.log.message("Renaming Station..."); + BStationSurrogate bStationSurrogate = BStationSurrogate.make(bDaemonSession, this.oldStationName); + try { + DaemonFileUtil.transfer(bDaemonSession, FileTransferMessage.makeRename(new FilePath("!stations/" + bStationSurrogate.getStationName()), this.newStationName, bDaemonSession.getFileSpace()), null, null); + } + catch (Exception exception) { + BPlatform.log.error("Cannot rename Station; Station files must be in use by another process", (Throwable)exception); + bStationSurrogate.restartStationAsync(true); + BPlatform.log.error("Restarting original Station..."); + return; + } + bDaemonSession.sendMessage(new UpdateStationMessage()); + BStationSurrogate bStationSurrogate2 = BStationSurrogate.make(bDaemonSession, this.newStationName); + bDaemonSession.sendMessage(new UpdateStationMessage(this.newStationName, false, true, true, true)); + bStationSurrogate2.startStationAsync(); + bDaemonSession.sendMessage(new UpdateStationMessage(this.oldStationName, true, false, false, true)); + } + ++n; + } + } + catch (Exception exception) { + BPlatform.log.error("Could not commit platform changes for Station rename in Shutdown hook", (Throwable)exception); + } + BPlatform.log.message("Station rename complete for " + this.oldStationName + " -> " + this.newStationName); + } + + public RenameShutdownHook(String string, String string2) { + super("RenameShutdownHook"); + this.oldStationName = string; + this.newStationName = string2; + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class SaveListener + implements Station.SaveListener { + private Boolean lastSaveSuccessful; + + public void stationSave() { + if (BSystemPlatformService.this.stationSaveListenerActive) { + return; + } + BSystemPlatformService.this.stationSaveListenerActive = true; + try { + BSystemPlatformService.this.savePlatformServiceProperties(); + } + catch (Exception exception) { + BPlatform.log.warning("Error occurred in SystemPlatformService::savePlatformServiceProperties() during station save:", (Throwable)exception); + } + BSystemPlatformService.this.stationSaveListenerActive = false; + } + + public void stationSaveOk() { + if (this.lastSaveSuccessful == null || !this.lastSaveSuccessful.booleanValue()) { + BPlatformServiceAlarmRecord bPlatformServiceAlarmRecord = BSystemPlatformService.this.getStationSaveAlarmSupport().makeToNormal(); + BSystemPlatformService.this.getStationSaveAlarmProxy().firePlatformServiceAlarmEvent(bPlatformServiceAlarmRecord); + this.lastSaveSuccessful = Boolean.TRUE; + } + if (LocalSessionUtil.localDaemonIsAvailable()) { + new UpdateJobState("baja:StationSaveJob@" + BSystemPlatformService.this.getStationName(), BJobState.success.getTag() + '@' + Clock.millis()).start(); + } + } + + public void stationSaveFail(String string) { + if (this.lastSaveSuccessful == null || this.lastSaveSuccessful.booleanValue()) { + BPlatformServiceAlarmRecord bPlatformServiceAlarmRecord = BSystemPlatformService.this.getStationSaveAlarmSupport().makeNewOffnormalAlarm(); + BSystemPlatformService.this.getStationSaveAlarmProxy().firePlatformServiceAlarmEvent(bPlatformServiceAlarmRecord); + this.lastSaveSuccessful = Boolean.FALSE; + } + if (LocalSessionUtil.localDaemonIsAvailable()) { + new UpdateJobState("baja:StationSaveJob@" + BSystemPlatformService.this.getStationName(), BJobState.failed.getTag() + '@' + Clock.millis()).start(); + } + } + + public String toString() { + return "SystemPlatformService " + BSystemPlatformService.this.getNavOrd(); + } + + private final /* synthetic */ void this() { + this.lastSaveSuccessful = null; + } + + private SaveListener() { + this.this(); + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private class EngineMonitor + implements Runnable { + public void run() { + try { + while (true) { + int n; + if ((n = BSystemPlatformService.this.getEngineWatchdogTimeout().getSeconds()) == 0) { + Thread.sleep(60000L); + } else { + Thread.sleep(n * 200); + } + int n2 = Nre.engineManager.getCycles(); + BSystemPlatformService.this.getPlatformLibrary().updateWatchdog(Sys.getStationHome().getName(), n2, BSystemPlatformService.this.getEngineWatchdogPolicy().getOrdinal(), n); + } + } + catch (Exception exception) { + exception.printStackTrace(); + return; + } + } + + private EngineMonitor() { + } + } + + private static class UpdateJobState + extends Thread { + private String requestId; + private String stateTag; + + public void run() { + try { + LocalSessionUtil.getLocalSession().sendMessage(new XmlResponseMessage(){ + + public final String getMessageString() { + return "report?requestId=" + HttpUtil.encodeUrl((String)UpdateJobState.this.requestId) + "&state=" + HttpUtil.encodeUrl((String)UpdateJobState.this.stateTag); + } + }); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + public UpdateJobState(String string, String string2) { + super("SystemPlatformService::UpdateJobState"); + this.requestId = string; + this.stateTag = string2; + } + } +} + diff --git a/modules/cfr_output/com/tridium/platform/IPlatformLibrary.java b/modules/cfr_output/com/tridium/platform/IPlatformLibrary.java new file mode 100644 index 0000000..f76af0d --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/IPlatformLibrary.java @@ -0,0 +1,45 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platform; + +public interface IPlatformLibrary { + public String getLastErrorMessage(); + + public void log(int var1, String var2); + + public String getNativeTimeZone(); + + public int setNativeTimeZone(String var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, int var13, int var14, int var15, int var16, int var17); + + public int setSystemTime(long var1); + + public String[] getAllFileSystemNames(); + + public long getFreeBytes(String var1); + + public long getTotalBytes(String var1); + + public int getBlockSize(String var1); + + public long getMaxFileCount(String var1); + + public long getCurrentFileCount(String var1); + + public boolean isFlash(String var1); + + public long getTotalPhysicalMemoryBytes(); + + public long getFreePhysicalMemoryBytes(); + + public int getCurrentCPUUtilization(); + + public int getOverallCPUUtilization(); + + public int getNumberCPUs(); + + public void updateWatchdog(String var1, int var2, int var3, int var4); + + public long getProcessId(); +} + diff --git a/modules/cfr_output/com/tridium/platform/LocalizableConnectException.java b/modules/cfr_output/com/tridium/platform/LocalizableConnectException.java new file mode 100644 index 0000000..888c952 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/LocalizableConnectException.java @@ -0,0 +1,82 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.Context + * javax.baja.sys.Localizable + * javax.baja.util.Lexicon + */ +package com.tridium.platform; + +import java.net.ConnectException; +import java.text.MessageFormat; +import javax.baja.sys.Context; +import javax.baja.sys.Localizable; +import javax.baja.util.Lexicon; + +public class LocalizableConnectException +extends ConnectException +implements Localizable { + private String lexiconModule; + private String lexiconKey; + private Object[] lexiconArgs; + + public String getLexiconModule() { + return this.lexiconModule; + } + + public String getLexiconKey() { + return this.lexiconKey; + } + + public Object[] getLexiconArguments() { + return this.lexiconArgs; + } + + public String toString(Context context) { + return LocalizableConnectException.format(this.lexiconModule, this.lexiconKey, this.lexiconArgs, context); + } + + public static String format(String string, String string2, Object[] objectArray, Context context) { + try { + String string3 = Lexicon.make((String)string, (Context)context).get(string2, null); + if (string3 != null) { + return MessageFormat.format(string3, objectArray); + } + StringBuffer stringBuffer = new StringBuffer(string2); + if (objectArray != null) { + stringBuffer.append(" {"); + int n = 0; + while (n < objectArray.length) { + if (n > 0) { + stringBuffer.append(", "); + } + stringBuffer.append(objectArray[n]); + ++n; + } + stringBuffer.append(" }"); + } + return stringBuffer.toString(); + } + catch (Throwable throwable) { + throwable.printStackTrace(); + return string2; + } + } + + public LocalizableConnectException(String string, String string2, Object[] objectArray) { + super(LocalizableConnectException.format(string, string2, objectArray, null)); + this.lexiconModule = string; + this.lexiconKey = string2; + this.lexiconArgs = objectArray; + } + + public LocalizableConnectException(String string, String string2) { + this(string, string2, null); + } + + public LocalizableConnectException(Lexicon lexicon, String string) { + this(lexicon.module.getModuleName(), string, null); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/NativePlatformLibrary.java b/modules/cfr_output/com/tridium/platform/NativePlatformLibrary.java new file mode 100644 index 0000000..b6497ab --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/NativePlatformLibrary.java @@ -0,0 +1,201 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platform; + +import com.tridium.platform.BPlatform; +import com.tridium.platform.IPlatformLibrary; + +abstract class NativePlatformLibrary +implements IPlatformLibrary { + public static boolean nativesLoaded = false; + public static boolean errorPrinted = false; + private static Object NATIVE_FS_MONITOR = new Object(); + + public static synchronized boolean load() { + block3: { + if (!nativesLoaded) { + try { + System.loadLibrary("platform"); + nativesLoaded = true; + errorPrinted = false; + } + catch (Throwable throwable) { + if (errorPrinted) break block3; + BPlatform.log.error("Cannot load native platform library"); + errorPrinted = true; + } + } + } + return nativesLoaded; + } + + public String getLastErrorMessage() { + return NativePlatformLibrary.getLastErrorMessage0(); + } + + public void log(int n, String string) { + NativePlatformLibrary.log0(n, string); + } + + public int setSystemTime(long l) { + return NativePlatformLibrary.setSystemTime0(l); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public String[] getAllFileSystemNames() { + Object object = NATIVE_FS_MONITOR; + synchronized (object) { + return NativePlatformLibrary.getAllFileSystemNames0(); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public long getFreeBytes(String string) { + Object object = NATIVE_FS_MONITOR; + synchronized (object) { + return NativePlatformLibrary.getFreeBytes0(string); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public long getTotalBytes(String string) { + Object object = NATIVE_FS_MONITOR; + synchronized (object) { + return NativePlatformLibrary.getTotalBytes0(string); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public int getBlockSize(String string) { + Object object = NATIVE_FS_MONITOR; + synchronized (object) { + return NativePlatformLibrary.getBlockSize0(string); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public long getMaxFileCount(String string) { + Object object = NATIVE_FS_MONITOR; + synchronized (object) { + return NativePlatformLibrary.getMaxFileCount0(string); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public long getCurrentFileCount(String string) { + Object object = NATIVE_FS_MONITOR; + synchronized (object) { + return NativePlatformLibrary.getCurrentFileCount0(string); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public boolean isFlash(String string) { + Object object = NATIVE_FS_MONITOR; + synchronized (object) { + return NativePlatformLibrary.isFlash0(string); + } + } + + public long getTotalPhysicalMemoryBytes() { + return NativePlatformLibrary.getTotalPhysicalMemoryBytes0(); + } + + public long getFreePhysicalMemoryBytes() { + return NativePlatformLibrary.getFreePhysicalMemoryBytes0(); + } + + public int getCurrentCPUUtilization() { + return NativePlatformLibrary.getCurrentCPUUtilization0(); + } + + public int getOverallCPUUtilization() { + return NativePlatformLibrary.getOverallCPUUtilization0(); + } + + public int getNumberCPUs() { + return NativePlatformLibrary.getNumberCPUs0(); + } + + public void updateWatchdog(String string, int n, int n2, int n3) { + NativePlatformLibrary.updateWatchdog0(string, n, n2, n3); + } + + public long getProcessId() { + return NativePlatformLibrary.getProcessId0(); + } + + private static final native String getLastErrorMessage0(); + + private static final native void log0(int var0, String var1); + + private static final native int setSystemTime0(long var0); + + private static final native String[] getAllFileSystemNames0(); + + private static final native long getFreeBytes0(String var0); + + private static final native long getTotalBytes0(String var0); + + private static final native int getBlockSize0(String var0); + + private static final native long getMaxFileCount0(String var0); + + private static final native long getCurrentFileCount0(String var0); + + private static final native boolean isFlash0(String var0); + + private static final native long getTotalPhysicalMemoryBytes0(); + + private static final native long getFreePhysicalMemoryBytes0(); + + private static final native int getCurrentCPUUtilization0(); + + private static final native int getOverallCPUUtilization0(); + + private static final native int getNumberCPUs0(); + + private static final native void updateWatchdog0(String var0, int var1, int var2, int var3); + + private static final native long getProcessId0(); + + NativePlatformLibrary() { + } +} + diff --git a/modules/cfr_output/com/tridium/platform/NativePlatformLibraryNpsdk.java b/modules/cfr_output/com/tridium/platform/NativePlatformLibraryNpsdk.java new file mode 100644 index 0000000..571cceb --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/NativePlatformLibraryNpsdk.java @@ -0,0 +1,42 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.nre.util.JavaTimeUtil + */ +package com.tridium.platform; + +import com.tridium.nre.util.JavaTimeUtil; +import com.tridium.platform.NativePlatformLibrary; + +public class NativePlatformLibraryNpsdk +extends NativePlatformLibrary { + public String getNativeTimeZone() { + String string = JavaTimeUtil.convertOlsonIdToTimeZoneXml((String)NativePlatformLibraryNpsdk.getNativeTimeZone0()); + if (string == null) { + string = ""; + } + return string; + } + + public int setNativeTimeZone(String string, int n, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12, int n13, int n14, int n15, int n16) { + return NativePlatformLibraryNpsdk.setNativeTimeZone0(string); + } + + private static final native String getNativeTimeZone0(); + + private static final native int setNativeTimeZone0(String var0); + + public String getAltArchivePath() { + return NativePlatformLibraryNpsdk.getAltArchivePath0(); + } + + public int getArchiveBackupCount() { + return NativePlatformLibraryNpsdk.getArchiveBackupCount0(); + } + + private static final native String getAltArchivePath0(); + + private static final native int getArchiveBackupCount0(); +} + diff --git a/modules/cfr_output/com/tridium/platform/NativePlatformLibraryTridium.java b/modules/cfr_output/com/tridium/platform/NativePlatformLibraryTridium.java new file mode 100644 index 0000000..c0016c9 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/NativePlatformLibraryTridium.java @@ -0,0 +1,22 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platform; + +import com.tridium.platform.NativePlatformLibrary; + +public class NativePlatformLibraryTridium +extends NativePlatformLibrary { + public String getNativeTimeZone() { + return NativePlatformLibraryTridium.getNativeTimeZone0(); + } + + public int setNativeTimeZone(String string, int n, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12, int n13, int n14, int n15, int n16) { + return NativePlatformLibraryTridium.setNativeTimeZone0(string, n, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16); + } + + private static final native String getNativeTimeZone0(); + + private static final native int setNativeTimeZone0(String var0, int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, int var13, int var14, int var15, int var16); +} + diff --git a/modules/cfr_output/com/tridium/platform/NiagaraLocalPlatform.java b/modules/cfr_output/com/tridium/platform/NiagaraLocalPlatform.java new file mode 100644 index 0000000..9e64b97 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/NiagaraLocalPlatform.java @@ -0,0 +1,43 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform; + +import com.tridium.platform.BSystemPlatformService; +import com.tridium.platform.tcpip.PlatformTcpIpManager; +import com.tridium.platform.time.PlatformTimeManager; +import javax.baja.platform.LocalPlatform; +import javax.baja.platform.tcpip.TcpIpManager; +import javax.baja.platform.time.TimeManager; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public class NiagaraLocalPlatform +extends LocalPlatform { + private PlatformTimeManager timeMgr = PlatformTimeManager.make(); + private PlatformTcpIpManager tcpipMgr = PlatformTcpIpManager.make(); + + public static LocalPlatform make() { + return new NiagaraLocalPlatform(); + } + + public TcpIpManager getTcpIpManager() { + return this.tcpipMgr; + } + + public TimeManager getTimeManager() { + return this.timeMgr; + } + + public void restartNiagaraEnvironment() { + ((BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE)).restartStation(); + } + + private NiagaraLocalPlatform() { + } +} + diff --git a/modules/cfr_output/com/tridium/platform/alarm/BIAlarmablePlatformService.java b/modules/cfr_output/com/tridium/platform/alarm/BIAlarmablePlatformService.java new file mode 100644 index 0000000..e88f502 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/alarm/BIAlarmablePlatformService.java @@ -0,0 +1,45 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BBoolean + * javax.baja.sys.BInterface + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform.alarm; + +import com.tridium.platform.alarm.BPlatformServiceAlarmRecord; +import com.tridium.platform.alarm.PlatformServiceAlarmListener; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BInterface; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public interface BIAlarmablePlatformService +extends BInterface { + public static final Type TYPE; + public static final String MSG_TEXT = "msgText"; + public static final String SOURCE_NAME = "sourceName"; + public static final String HYPERLINK_ORD = "hyperlinkOrd"; + public static final String SOUND_FILE = "soundFile"; + public static final String ICON = "icon"; + public static final String P_ALARM_TYPE = "alarmType"; + + public void addPlatformServiceAlarmListener(PlatformServiceAlarmListener var1); + + public void removePlatformServiceAlarmListener(PlatformServiceAlarmListener var1); + + public void firePlatformServiceAlarmEvent(BPlatformServiceAlarmRecord var1); + + public BBoolean ackAlarm(BPlatformServiceAlarmRecord var1); + + static { + Class clazz = 1.class$com$tridium$platform$alarm$BIAlarmablePlatformService; + if (clazz == null) { + clazz = 1.class$com$tridium$platform$alarm$BIAlarmablePlatformService = 1.class("[Lcom.tridium.platform.alarm.BIAlarmablePlatformService;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/alarm/BPlatformAlarmProxy.java b/modules/cfr_output/com/tridium/platform/alarm/BPlatformAlarmProxy.java new file mode 100644 index 0000000..f44b604 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/alarm/BPlatformAlarmProxy.java @@ -0,0 +1,106 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.Action + * javax.baja.sys.BBoolean + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform.alarm; + +import com.tridium.platform.alarm.BIAlarmablePlatformService; +import com.tridium.platform.alarm.BPlatformAlarmSupport; +import com.tridium.platform.alarm.BPlatformServiceAlarmRecord; +import com.tridium.platform.alarm.PlatformServiceAlarmListener; +import java.util.Enumeration; +import java.util.Vector; +import javax.baja.sys.Action; +import javax.baja.sys.BBoolean; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPlatformAlarmProxy +extends BComponent +implements BIAlarmablePlatformService { + public static final Action ackAlarm = BPlatformAlarmProxy.newAction((int)0, (BValue)new BPlatformServiceAlarmRecord(), null); + public static final Type TYPE; + Vector alarmListeners; + BPlatformAlarmSupport alarmSupport; + static /* synthetic */ Class class$com$tridium$platform$alarm$BPlatformAlarmProxy; + + public BBoolean ackAlarm(BPlatformServiceAlarmRecord bPlatformServiceAlarmRecord) { + return (BBoolean)this.invoke(ackAlarm, (BValue)bPlatformServiceAlarmRecord, null); + } + + public Type getType() { + return TYPE; + } + + public void setAlarmSupport(BPlatformAlarmSupport bPlatformAlarmSupport) { + this.alarmSupport = bPlatformAlarmSupport; + bPlatformAlarmSupport.setSourceComponent(this); + } + + public void addPlatformServiceAlarmListener(PlatformServiceAlarmListener platformServiceAlarmListener) { + this.alarmListeners.add(platformServiceAlarmListener); + } + + public void removePlatformServiceAlarmListener(PlatformServiceAlarmListener platformServiceAlarmListener) { + this.alarmListeners.remove(platformServiceAlarmListener); + } + + public void firePlatformServiceAlarmEvent(BPlatformServiceAlarmRecord bPlatformServiceAlarmRecord) { + if (this.alarmListeners.size() == 0) { + return; + } + Enumeration enumeration = this.alarmListeners.elements(); + while (enumeration.hasMoreElements()) { + PlatformServiceAlarmListener platformServiceAlarmListener = (PlatformServiceAlarmListener)enumeration.nextElement(); + platformServiceAlarmListener.platformServiceAlarm(bPlatformServiceAlarmRecord); + } + } + + public BBoolean doAckAlarm(BPlatformServiceAlarmRecord bPlatformServiceAlarmRecord) { + boolean bl = this.alarmSupport.ackAlarm(bPlatformServiceAlarmRecord); + return BBoolean.make((boolean)bl); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.alarmListeners = new Vector(1); + this.alarmSupport = null; + } + + public BPlatformAlarmProxy() { + this.this(); + } + + static { + Class clazz = class$com$tridium$platform$alarm$BPlatformAlarmProxy; + if (clazz == null) { + clazz = class$com$tridium$platform$alarm$BPlatformAlarmProxy = BPlatformAlarmProxy.class("[Lcom.tridium.platform.alarm.BPlatformAlarmProxy;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/alarm/BPlatformAlarmSupport.java b/modules/cfr_output/com/tridium/platform/alarm/BPlatformAlarmSupport.java new file mode 100644 index 0000000..143f4cb --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/alarm/BPlatformAlarmSupport.java @@ -0,0 +1,288 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.data.BIDataValue + * javax.baja.naming.BOrd + * javax.baja.naming.OrdQuery + * javax.baja.sys.BAbsTime + * javax.baja.sys.BComponent + * javax.baja.sys.BFacets + * javax.baja.sys.BIcon + * javax.baja.sys.BString + * javax.baja.sys.BValue + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.BFormat + */ +package com.tridium.platform.alarm; + +import com.tridium.platform.alarm.BPlatformServiceAlarmRecord; +import com.tridium.platform.alarm.BPlatformServiceSourceState; +import java.util.HashMap; +import javax.baja.data.BIDataValue; +import javax.baja.naming.BOrd; +import javax.baja.naming.OrdQuery; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BComponent; +import javax.baja.sys.BFacets; +import javax.baja.sys.BIcon; +import javax.baja.sys.BString; +import javax.baja.sys.BValue; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.BFormat; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPlatformAlarmSupport +extends BComponent { + public static final Property alarmClass = BPlatformAlarmSupport.newProperty((int)0, (String)"defaultAlarmClass", (BFacets)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"alarm:AlarmClassFE"))); + public static final Property sourceName = BPlatformAlarmSupport.newProperty((int)0, (BValue)BFormat.make((String)"%parent.displayName%"), null); + public static final Property alertText = BPlatformAlarmSupport.newProperty((int)0, (BValue)BFormat.make((String)""), null); + public static final Property toFaultText = BPlatformAlarmSupport.newProperty((int)0, (BValue)BFormat.make((String)""), null); + public static final Property toOffnormalText = BPlatformAlarmSupport.newProperty((int)0, (BValue)BFormat.make((String)""), null); + public static final Property toNormalText = BPlatformAlarmSupport.newProperty((int)0, (BValue)BFormat.make((String)""), null); + public static final Property hyperlinkOrd = BPlatformAlarmSupport.newProperty((int)0, (BValue)BOrd.NULL, (BFacets)BFacets.make((String)"ordRelativize", (boolean)false)); + public static final Property soundFile = BPlatformAlarmSupport.newProperty((int)0, (BValue)BOrd.NULL, (BFacets)BFacets.make((String)"targetType", (BIDataValue)BString.make((String)"file:AudioFile"))); + public static final Property alarmIcon = BPlatformAlarmSupport.newProperty((int)0, (BValue)BOrd.NULL, (BFacets)BFacets.make((String)"targetType", (BIDataValue)BString.make((String)"file:ImageFile"))); + public static final Property metaData = BPlatformAlarmSupport.newProperty((int)0, (BValue)BFacets.DEFAULT, null); + public static final Type TYPE; + private static final BIcon icon; + BComponent comp; + BAbsTime lastAlertTime; + BAbsTime lastOffnormalTime; + BAbsTime lastFaultTime; + static /* synthetic */ Class class$com$tridium$platform$alarm$BPlatformAlarmSupport; + + public String getAlarmClass() { + return this.getString(alarmClass); + } + + public void setAlarmClass(String string) { + this.setString(alarmClass, string, null); + } + + public BFormat getSourceName() { + return (BFormat)this.get(sourceName); + } + + public void setSourceName(BFormat bFormat) { + this.set(sourceName, (BValue)bFormat, null); + } + + public BFormat getAlertText() { + return (BFormat)this.get(alertText); + } + + public void setAlertText(BFormat bFormat) { + this.set(alertText, (BValue)bFormat, null); + } + + public BFormat getToFaultText() { + return (BFormat)this.get(toFaultText); + } + + public void setToFaultText(BFormat bFormat) { + this.set(toFaultText, (BValue)bFormat, null); + } + + public BFormat getToOffnormalText() { + return (BFormat)this.get(toOffnormalText); + } + + public void setToOffnormalText(BFormat bFormat) { + this.set(toOffnormalText, (BValue)bFormat, null); + } + + public BFormat getToNormalText() { + return (BFormat)this.get(toNormalText); + } + + public void setToNormalText(BFormat bFormat) { + this.set(toNormalText, (BValue)bFormat, null); + } + + public BOrd getHyperlinkOrd() { + return (BOrd)this.get(hyperlinkOrd); + } + + public void setHyperlinkOrd(BOrd bOrd) { + this.set(hyperlinkOrd, (BValue)bOrd, null); + } + + public BOrd getSoundFile() { + return (BOrd)this.get(soundFile); + } + + public void setSoundFile(BOrd bOrd) { + this.set(soundFile, (BValue)bOrd, null); + } + + public BOrd getAlarmIcon() { + return (BOrd)this.get(alarmIcon); + } + + public void setAlarmIcon(BOrd bOrd) { + this.set(alarmIcon, (BValue)bOrd, null); + } + + public BFacets getMetaData() { + return (BFacets)this.get(metaData); + } + + public void setMetaData(BFacets bFacets) { + this.set(metaData, (BValue)bFacets, null); + } + + public Type getType() { + return TYPE; + } + + public void setSourceComponent(BComponent bComponent) { + this.comp = bComponent; + } + + public BPlatformServiceAlarmRecord makeNewAlert() { + return this.makeNewAlert(BFacets.NULL); + } + + public BPlatformServiceAlarmRecord makeNewAlert(BFacets bFacets) { + return this.makeNewAlarm(BPlatformServiceSourceState.alert, bFacets); + } + + public BPlatformServiceAlarmRecord makeNewOffnormalAlarm() { + return this.makeNewOffnormalAlarm(BFacets.NULL); + } + + public BPlatformServiceAlarmRecord makeNewOffnormalAlarm(BFacets bFacets) { + return this.makeNewAlarm(BPlatformServiceSourceState.offnormal, bFacets); + } + + public BPlatformServiceAlarmRecord makeNewFaultAlarm() { + return this.makeNewFaultAlarm(BFacets.NULL); + } + + public BPlatformServiceAlarmRecord makeNewFaultAlarm(BFacets bFacets) { + return this.makeNewAlarm(BPlatformServiceSourceState.fault, bFacets); + } + + private final BPlatformServiceAlarmRecord makeNewAlarm(BPlatformServiceSourceState bPlatformServiceSourceState, BFacets bFacets) { + BFacets bFacets2 = BFacets.make((BFacets)this.makeAlarmData(bPlatformServiceSourceState), (BFacets)bFacets); + BPlatformServiceAlarmRecord bPlatformServiceAlarmRecord = new BPlatformServiceAlarmRecord(BOrd.make((OrdQuery)this.comp.getSlotPath()), this.getAlarmClass(), bPlatformServiceSourceState, bFacets2); + if (bPlatformServiceSourceState == BPlatformServiceSourceState.offnormal) { + this.lastOffnormalTime = bPlatformServiceAlarmRecord.getTimestamp(); + } else if (bPlatformServiceSourceState == BPlatformServiceSourceState.fault) { + this.lastFaultTime = bPlatformServiceAlarmRecord.getTimestamp(); + } else if (bPlatformServiceSourceState == BPlatformServiceSourceState.alert) { + this.lastAlertTime = bPlatformServiceAlarmRecord.getTimestamp(); + } + return bPlatformServiceAlarmRecord; + } + + public BPlatformServiceAlarmRecord makeToNormal() { + return this.makeToNormal(BFacets.NULL); + } + + public BPlatformServiceAlarmRecord makeToNormal(BFacets bFacets) { + return this.makeNewAlarm(BPlatformServiceSourceState.normal, bFacets); + } + + public boolean ackAlarm(BPlatformServiceAlarmRecord bPlatformServiceAlarmRecord) { + boolean bl = false; + bPlatformServiceAlarmRecord.setAlarmClass(this.getAlarmClass()); + if (bPlatformServiceAlarmRecord.getSourceState() == BPlatformServiceSourceState.offnormal) { + boolean bl2 = true; + if (this.lastOffnormalTime != null) { + bl2 = bPlatformServiceAlarmRecord.getTimestamp().equals((Object)this.lastOffnormalTime); + } + bl = bl2; + } else if (bPlatformServiceAlarmRecord.getSourceState() == BPlatformServiceSourceState.fault) { + boolean bl3 = true; + if (this.lastFaultTime != null) { + bl3 = bPlatformServiceAlarmRecord.getTimestamp().equals((Object)this.lastFaultTime); + } + bl = bl3; + } else if (bPlatformServiceAlarmRecord.getSourceState() == BPlatformServiceSourceState.alert) { + boolean bl4 = true; + if (this.lastAlertTime != null) { + bl4 = bPlatformServiceAlarmRecord.getTimestamp().equals((Object)this.lastAlertTime); + } + bl = bl4; + } + return bl; + } + + public BFacets makeAlarmData(BPlatformServiceSourceState bPlatformServiceSourceState) { + HashMap hashMap = new HashMap(); + if (!this.getSourceName().toString().equals("")) { + hashMap.put("sourceName", BString.make((String)this.getSourceName().format((Object)this))); + } + String string = ""; + if (bPlatformServiceSourceState == BPlatformServiceSourceState.offnormal) { + string = this.getToOffnormalText().toString(); + } else if (bPlatformServiceSourceState == BPlatformServiceSourceState.fault) { + string = this.getToFaultText().toString(); + } else if (bPlatformServiceSourceState == BPlatformServiceSourceState.alert) { + string = this.getAlertText().toString(); + } else if (bPlatformServiceSourceState == BPlatformServiceSourceState.normal) { + string = this.getToNormalText().toString(); + } + if (!string.equals("")) { + hashMap.put("msgText", BString.make((String)string)); + } + if (this.getHyperlinkOrd() != BOrd.NULL) { + hashMap.put("hyperlinkOrd", BString.make((String)this.getHyperlinkOrd().toString())); + } + if (this.getSoundFile() != BOrd.NULL) { + hashMap.put("soundFile", BString.make((String)this.getSoundFile().toString())); + } + if (this.getAlarmIcon() != BOrd.NULL) { + hashMap.put("icon", BString.make((String)this.getAlarmIcon().toString())); + } + String[] stringArray = this.getMetaData().list(); + int n = 0; + while (n < stringArray.length) { + hashMap.put(stringArray[n], this.getMetaData().get(stringArray[n])); + ++n; + } + return BFacets.make(hashMap); + } + + public BIcon getIcon() { + return icon; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BPlatformAlarmSupport() { + } + + public BPlatformAlarmSupport(BComponent bComponent) { + this.comp = bComponent; + } + + static { + Class clazz = class$com$tridium$platform$alarm$BPlatformAlarmSupport; + if (clazz == null) { + clazz = class$com$tridium$platform$alarm$BPlatformAlarmSupport = BPlatformAlarmSupport.class("[Lcom.tridium.platform.alarm.BPlatformAlarmSupport;", false); + } + TYPE = Sys.loadType((Class)clazz); + icon = BIcon.std((String)"alarm.png"); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/alarm/BPlatformServiceAlarmRecord.java b/modules/cfr_output/com/tridium/platform/alarm/BPlatformServiceAlarmRecord.java new file mode 100644 index 0000000..199ae05 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/alarm/BPlatformServiceAlarmRecord.java @@ -0,0 +1,128 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.naming.BOrd + * javax.baja.sys.BAbsTime + * javax.baja.sys.BFacets + * javax.baja.sys.BStruct + * javax.baja.sys.BValue + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + * javax.baja.util.BUuid + */ +package com.tridium.platform.alarm; + +import com.tridium.platform.alarm.BPlatformServiceSourceState; +import javax.baja.naming.BOrd; +import javax.baja.sys.BAbsTime; +import javax.baja.sys.BFacets; +import javax.baja.sys.BStruct; +import javax.baja.sys.BValue; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; +import javax.baja.util.BUuid; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BPlatformServiceAlarmRecord +extends BStruct { + public static final Property uuid = BPlatformServiceAlarmRecord.newProperty((int)0, (BValue)BUuid.make(), null); + public static final Property source = BPlatformServiceAlarmRecord.newProperty((int)0, (BValue)BOrd.DEFAULT, null); + public static final Property alarmClass = BPlatformServiceAlarmRecord.newProperty((int)0, (String)"defaultAlarmClass", null); + public static final Property sourceState = BPlatformServiceAlarmRecord.newProperty((int)0, (BValue)BPlatformServiceSourceState.offnormal, null); + public static final Property timestamp = BPlatformServiceAlarmRecord.newProperty((int)0, (BValue)BAbsTime.NULL, null); + public static final Property alarmData = BPlatformServiceAlarmRecord.newProperty((int)0, (BValue)BFacets.DEFAULT, null); + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platform$alarm$BPlatformServiceAlarmRecord; + + public BUuid getUuid() { + return (BUuid)this.get(uuid); + } + + public void setUuid(BUuid bUuid) { + this.set(uuid, (BValue)bUuid, null); + } + + public BOrd getSource() { + return (BOrd)this.get(source); + } + + public void setSource(BOrd bOrd) { + this.set(source, (BValue)bOrd, null); + } + + public String getAlarmClass() { + return this.getString(alarmClass); + } + + public void setAlarmClass(String string) { + this.setString(alarmClass, string, null); + } + + public BPlatformServiceSourceState getSourceState() { + return (BPlatformServiceSourceState)this.get(sourceState); + } + + public void setSourceState(BPlatformServiceSourceState bPlatformServiceSourceState) { + this.set(sourceState, (BValue)bPlatformServiceSourceState, null); + } + + public BAbsTime getTimestamp() { + return (BAbsTime)this.get(timestamp); + } + + public void setTimestamp(BAbsTime bAbsTime) { + this.set(timestamp, (BValue)bAbsTime, null); + } + + public BFacets getAlarmData() { + return (BFacets)this.get(alarmData); + } + + public void setAlarmData(BFacets bFacets) { + this.set(alarmData, (BValue)bFacets, null); + } + + public Type getType() { + return TYPE; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + public BPlatformServiceAlarmRecord() { + this.setUuid(BUuid.make()); + } + + public BPlatformServiceAlarmRecord(BOrd bOrd, String string, BPlatformServiceSourceState bPlatformServiceSourceState, BFacets bFacets) { + this.setUuid(BUuid.make()); + this.setSource(bOrd); + this.setAlarmClass(string); + this.setSourceState(bPlatformServiceSourceState); + this.setTimestamp(BAbsTime.now()); + this.setAlarmData(bFacets); + } + + static { + Class clazz = class$com$tridium$platform$alarm$BPlatformServiceAlarmRecord; + if (clazz == null) { + clazz = class$com$tridium$platform$alarm$BPlatformServiceAlarmRecord = BPlatformServiceAlarmRecord.class("[Lcom.tridium.platform.alarm.BPlatformServiceAlarmRecord;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/alarm/BPlatformServiceSourceState.java b/modules/cfr_output/com/tridium/platform/alarm/BPlatformServiceSourceState.java new file mode 100644 index 0000000..75391cc --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/alarm/BPlatformServiceSourceState.java @@ -0,0 +1,70 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BFrozenEnum + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform.alarm; + +import javax.baja.sys.BFrozenEnum; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public final class BPlatformServiceSourceState +extends BFrozenEnum { + public static final int OFFNORMAL = 0; + public static final int FAULT = 1; + public static final int NORMAL = 2; + public static final int ALERT = 3; + public static final BPlatformServiceSourceState offnormal = new BPlatformServiceSourceState(0); + public static final BPlatformServiceSourceState fault = new BPlatformServiceSourceState(1); + public static final BPlatformServiceSourceState normal = new BPlatformServiceSourceState(2); + public static final BPlatformServiceSourceState alert = new BPlatformServiceSourceState(3); + public static final Type TYPE; + public static final BPlatformServiceSourceState DEFAULT; + static /* synthetic */ Class class$com$tridium$platform$alarm$BPlatformServiceSourceState; + + public final Type getType() { + return TYPE; + } + + public static final BPlatformServiceSourceState make(int n) { + return (BPlatformServiceSourceState)offnormal.getRange().get(n, false); + } + + public static final BPlatformServiceSourceState make(String string) { + return (BPlatformServiceSourceState)offnormal.getRange().get(string); + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private BPlatformServiceSourceState(int n) { + super(n); + } + + static { + Class clazz = class$com$tridium$platform$alarm$BPlatformServiceSourceState; + if (clazz == null) { + clazz = class$com$tridium$platform$alarm$BPlatformServiceSourceState = BPlatformServiceSourceState.class("[Lcom.tridium.platform.alarm.BPlatformServiceSourceState;", false); + } + TYPE = Sys.loadType((Class)clazz); + DEFAULT = offnormal; + } +} + diff --git a/modules/cfr_output/com/tridium/platform/alarm/PlatformServiceAlarmListener.java b/modules/cfr_output/com/tridium/platform/alarm/PlatformServiceAlarmListener.java new file mode 100644 index 0000000..8ff2e31 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/alarm/PlatformServiceAlarmListener.java @@ -0,0 +1,11 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platform.alarm; + +import com.tridium.platform.alarm.BPlatformServiceAlarmRecord; + +public interface PlatformServiceAlarmListener { + public void platformServiceAlarm(BPlatformServiceAlarmRecord var1); +} + diff --git a/modules/cfr_output/com/tridium/platform/archive/FileArchive.java b/modules/cfr_output/com/tridium/platform/archive/FileArchive.java new file mode 100644 index 0000000..09c09c7 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/archive/FileArchive.java @@ -0,0 +1,13 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platform.archive; + +import java.io.File; + +public interface FileArchive { + public void writeFile(File var1, String var2); + + public void close(); +} + diff --git a/modules/cfr_output/com/tridium/platform/archive/NullFileArchive.java b/modules/cfr_output/com/tridium/platform/archive/NullFileArchive.java new file mode 100644 index 0000000..b284c8d --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/archive/NullFileArchive.java @@ -0,0 +1,17 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platform.archive; + +import com.tridium.platform.archive.FileArchive; +import java.io.File; + +public class NullFileArchive +implements FileArchive { + public void writeFile(File file, String string) { + } + + public void close() { + } +} + diff --git a/modules/cfr_output/com/tridium/platform/archive/ZipArchive.java b/modules/cfr_output/com/tridium/platform/archive/ZipArchive.java new file mode 100644 index 0000000..9771953 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/archive/ZipArchive.java @@ -0,0 +1,140 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.file.FileUtil + * javax.baja.log.Log + */ +package com.tridium.platform.archive; + +import com.tridium.platform.archive.FileArchive; +import com.tridium.platform.archive.ZipArchiveReader; +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.zip.ZipEntry; +import java.util.zip.ZipException; +import java.util.zip.ZipOutputStream; +import javax.baja.file.FileUtil; +import javax.baja.log.Log; + +public class ZipArchive +implements FileArchive { + public static Log log = Log.getLog((String)"platform.zipArchive"); + String archiveName; + String archivePath; + private File archiveFile; + private File workingFile; + private ZipOutputStream out; + int maxBackups; + + public void writeFile(File file, String string) { + try { + int n; + if (!file.exists()) { + log.warning(file + " does not exist!"); + return; + } + if (file.isDirectory()) { + throw new IllegalArgumentException("File is directory: " + file); + } + if ((string = string.replace('\\', '/')).charAt(0) == '/') { + string = string.substring(1); + } + ZipEntry zipEntry = new ZipEntry(string); + zipEntry.setSize(file.length()); + zipEntry.setTime(file.lastModified()); + try { + this.out.putNextEntry(zipEntry); + } + catch (ZipException zipException) { + log.warning("Archive " + this.archiveName + " unable to put zip entry ", (Throwable)zipException); + return; + } + log.trace("Adding " + string); + FileInputStream fileInputStream = new FileInputStream(file); + BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream); + byte[] byArray = new byte[4096]; + while ((n = bufferedInputStream.read(byArray)) != -1) { + this.out.write(byArray, 0, n); + } + bufferedInputStream.close(); + this.out.closeEntry(); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + public void close() { + try { + this.out.flush(); + this.out.close(); + log.trace("renaming archive file to backup " + this.archiveFile); + FileUtil.renameToBackup((File)this.archiveFile, (int)this.maxBackups); + log.trace("renaming working file to backup " + this.archiveFile); + this.workingFile.renameTo(this.archiveFile); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + + public static void unzip(String string, String string2, String string3) throws IOException { + Object object; + File file = new File(string3); + if (!file.exists()) { + file.mkdir(); + } else if (!file.isDirectory()) { + throw new IllegalArgumentException("destDir <" + file + "> is not a directory"); + } + File[] fileArray = file.listFiles(); + int n = 0; + while (n < fileArray.length) { + FileUtil.delete((File)fileArray[n]); + ++n; + } + File file2 = new File(string, string2); + if (!file2.exists()) { + object = new File(string, string2 + ".working"); + if (((File)object).exists()) { + ((File)object).renameTo(file2); + } else { + return; + } + } + object = new ZipArchiveReader(file2, false); + ((ZipArchiveReader)object).extractAll(file); + } + + public ZipArchive(String string, String string2, int n) { + try { + this.archivePath = string; + this.archiveName = string2; + this.archiveFile = new File(string, string2); + this.workingFile = new File(this.archiveFile + ".working"); + this.maxBackups = n; + if (this.archiveFile.isDirectory()) { + throw new IllegalArgumentException("File is directory: " + this.archiveFile); + } + this.out = new ZipOutputStream(new FileOutputStream(this.workingFile)); + this.out.setMethod(8); + String string3 = string2.substring(0, string2.indexOf(46)); + File[] fileArray = FileUtil.getBackups((File)new File(string), (String)string3); + if (fileArray != null && fileArray.length != 0) { + int n2 = fileArray.length - 1; + while (n2 > n) { + log.trace("Deleting " + fileArray[n2]); + fileArray[n2].delete(); + --n2; + } + } + } + catch (Exception exception) { + exception.printStackTrace(); + } + } +} + diff --git a/modules/cfr_output/com/tridium/platform/archive/ZipArchiveReader.java b/modules/cfr_output/com/tridium/platform/archive/ZipArchiveReader.java new file mode 100644 index 0000000..111018e --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/archive/ZipArchiveReader.java @@ -0,0 +1,77 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.tridium.platform.archive; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class ZipArchiveReader { + private ZipInputStream in; + private boolean isVerbose; + + public void extractAll(File file) throws IOException { + ZipEntry zipEntry; + if (!file.exists()) { + throw new IllegalArgumentException("Path does not exist " + file); + } + if (!file.isDirectory()) { + throw new IllegalArgumentException("Path not a directory: " + file); + } + byte[] byArray = new byte[65000]; + while ((zipEntry = this.in.getNextEntry()) != null) { + Object object; + String string = file.getPath() + '/' + zipEntry.getName(); + String string2 = string.substring(0, string.lastIndexOf(47)); + new File(string2).mkdirs(); + if (zipEntry.isDirectory()) { + object = new File(string); + ((File)object).mkdir(); + if (this.isVerbose) { + System.out.println("ZipArchiveReader: creating dir " + string); + } + } else { + object = new FileOutputStream(new File(string)); + if (this.isVerbose) { + System.out.println("ZipArchiveReader: expanding " + string); + } + int n = this.in.read(byArray); + while (n >= 0) { + ((FileOutputStream)object).write(byArray, 0, n); + n = this.in.read(byArray); + } + ((OutputStream)object).flush(); + ((FileOutputStream)object).close(); + } + this.in.closeEntry(); + } + } + + private final /* synthetic */ void this() { + this.isVerbose = false; + } + + public ZipArchiveReader(File file, boolean bl) throws IOException { + this.this(); + if (!file.exists()) { + throw new IllegalArgumentException("File does not exist: " + file); + } + if (file.isDirectory()) { + throw new IllegalArgumentException("File is directory: " + file); + } + this.in = new ZipInputStream(new FileInputStream(file)); + this.isVerbose = bl; + if (bl) { + System.out.println("archive file name: " + file); + } + } +} + diff --git a/modules/cfr_output/com/tridium/platform/command/BAbstractPlatformCommand.java b/modules/cfr_output/com/tridium/platform/command/BAbstractPlatformCommand.java new file mode 100644 index 0000000..96199f7 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/command/BAbstractPlatformCommand.java @@ -0,0 +1,238 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * javax.baja.sys.BSingleton + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform.command; + +import com.tridium.platform.command.BIPlatformCommand; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PushbackInputStream; +import java.util.Arrays; +import javax.baja.sys.BSingleton; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BAbstractPlatformCommand +extends BSingleton +implements BIPlatformCommand { + public static final Type TYPE; + static /* synthetic */ Class class$com$tridium$platform$command$BAbstractPlatformCommand; + + public Type getType() { + return TYPE; + } + + public String getLicenseVendor() { + return null; + } + + public String getLicenseFeature() { + return null; + } + + public boolean includeInCommandListing() { + return true; + } + + protected boolean promptBoolean(String string) { + String string2 = this.promptString(string); + boolean bl = false; + if (string2.charAt(0) == 'Y' || string2.charAt(0) == 'y') { + bl = true; + } + return bl; + } + + protected String promptPasswordString(String string) { + return this.promptPasswordString(string, new Filter()); + } + + protected String promptPasswordString(String string, Filter filter) { + try { + String string2 = null; + while (!filter.accept(string2)) { + System.out.print(string); + string2 = new String(BAbstractPlatformCommand.getPassword(System.in)); + } + return string2; + } + catch (RuntimeException runtimeException) { + throw runtimeException; + } + catch (Exception exception) { + throw new BajaRuntimeException((Throwable)exception); + } + } + + protected String promptString(String string) { + return this.promptString(string, new Filter()); + } + + protected String promptString(String string, Filter filter) { + try { + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); + String string2 = null; + while (!filter.accept(string2)) { + System.out.print(string); + string2 = bufferedReader.readLine(); + } + return string2; + } + catch (RuntimeException runtimeException) { + throw runtimeException; + } + catch (Exception exception) { + throw new BajaRuntimeException((Throwable)exception); + } + } + + protected static void println(String string) { + System.out.println(string); + } + + public static final char[] getPassword(InputStream inputStream) throws IOException { + char[] cArray; + MaskingThread maskingThread = new MaskingThread(); + Thread thread = new Thread(maskingThread); + thread.start(); + char[] cArray2 = cArray = new char[128]; + int n = cArray2.length; + int n2 = 0; + block4: while (true) { + int n3 = inputStream.read(); + switch (n3) { + case -1: + case 10: { + break block4; + } + case 13: { + int n4 = inputStream.read(); + if (n4 == 10 || n4 == -1) break block4; + if (!(inputStream instanceof PushbackInputStream)) { + inputStream = new PushbackInputStream(inputStream); + } + ((PushbackInputStream)inputStream).unread(n4); + } + default: { + if (--n < 0) { + cArray2 = new char[n2 + 128]; + n = cArray2.length - n2 - 1; + System.arraycopy(cArray, 0, cArray2, 0, n2); + Arrays.fill(cArray, ' '); + cArray = cArray2; + } + cArray2[n2++] = (char)n3; + continue block4; + } + } + break; + } + maskingThread.stopMasking(); + if (n2 == 0) { + return new char[0]; + } + char[] cArray3 = new char[n2]; + System.arraycopy(cArray2, 0, cArray3, 0, n2); + Arrays.fill(cArray2, ' '); + return cArray3; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + static { + Class clazz = class$com$tridium$platform$command$BAbstractPlatformCommand; + if (clazz == null) { + clazz = class$com$tridium$platform$command$BAbstractPlatformCommand = BAbstractPlatformCommand.class("[Lcom.tridium.platform.command.BAbstractPlatformCommand;", false); + } + TYPE = Sys.loadType((Class)clazz); + } + + public static class Filter { + public boolean accept(String string) { + boolean bl = false; + if (string != null && string.length() > 0) { + bl = true; + } + return bl; + } + } + + /* + * Illegal identifiers - consider using --renameillegalidents true + */ + private static class MaskingThread + extends Thread { + private volatile boolean stop; + private char echochar; + + /* + * Enabled aggressive block sorting + * Enabled unnecessary exception pruning + * Enabled aggressive exception aggregation + */ + public void run() { + int n = Thread.currentThread().getPriority(); + Thread.currentThread().setPriority(10); + try { + this.stop = true; + while (this.stop) { + System.out.print("\b" + this.echochar); + try { + Thread.sleep(1L); + } + catch (InterruptedException interruptedException) { + Thread.currentThread().interrupt(); + Object var3_3 = null; + Thread.currentThread().setPriority(n); + return; + } + } + Object var3_5 = null; + Thread.currentThread().setPriority(n); + return; + } + catch (Throwable throwable) { + Object var3_4 = null; + Thread.currentThread().setPriority(n); + throw throwable; + } + } + + public void stopMasking() { + this.stop = false; + } + + private final /* synthetic */ void this() { + this.echochar = (char)32; + } + + public MaskingThread() { + super("AbstractPlatformCommand:MaskingThread"); + this.this(); + } + } +} + diff --git a/modules/cfr_output/com/tridium/platform/command/BDaemonSessionCommand.java b/modules/cfr_output/com/tridium/platform/command/BDaemonSessionCommand.java new file mode 100644 index 0000000..298a5dc --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/command/BDaemonSessionCommand.java @@ -0,0 +1,162 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.util.CommandLineArguments + * javax.baja.naming.BHost + * javax.baja.naming.BOrd + * javax.baja.security.AuthenticationException + * javax.baja.security.BICredentials + * javax.baja.security.BPassword + * javax.baja.security.BUsernameAndPassword + * javax.baja.sys.BajaRuntimeException + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform.command; + +import com.tridium.platform.command.BAbstractPlatformCommand; +import com.tridium.platform.daemon.BDaemonSession; +import com.tridium.platform.daemon.task.DaemonSessionTask; +import com.tridium.platform.daemon.task.DaemonSessionTaskListener; +import com.tridium.util.CommandLineArguments; +import java.net.ConnectException; +import javax.baja.naming.BHost; +import javax.baja.naming.BOrd; +import javax.baja.security.AuthenticationException; +import javax.baja.security.BICredentials; +import javax.baja.security.BPassword; +import javax.baja.security.BUsernameAndPassword; +import javax.baja.sys.BajaRuntimeException; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public abstract class BDaemonSessionCommand +extends BAbstractPlatformCommand +implements DaemonSessionTaskListener { + public static final Type TYPE; + private String lastTaskMessage; + static /* synthetic */ Class class$com$tridium$platform$command$BDaemonSessionCommand; + + public Type getType() { + return TYPE; + } + + /* + * Loose catch block + */ + protected BDaemonSession getSession(CommandLineArguments commandLineArguments) throws ConnectException { + BHost bHost = this.getHost(commandLineArguments); + if (bHost == null) { + return null; + } + int n = this.getPort(commandLineArguments); + BDaemonSession bDaemonSession = BDaemonSession.make(bHost, n); + BUsernameAndPassword bUsernameAndPassword = this.getCredentials(bDaemonSession, commandLineArguments); + bDaemonSession.setCredentials((BICredentials)bUsernameAndPassword); + while (true) { + try { + bDaemonSession.connect(); + return bDaemonSession; + } + catch (ConnectException connectException) { + throw connectException; + } + catch (AuthenticationException authenticationException) { + if (commandLineArguments.hasOption("noinput")) { + throw authenticationException; + } + BDaemonSessionCommand.println("Authentication failed"); + bUsernameAndPassword = this.getCredentials(bDaemonSession, null); + bDaemonSession.setCredentials((BICredentials)bUsernameAndPassword); + continue; + } + catch (RuntimeException runtimeException) { + throw runtimeException; + } + break; + } + catch (Exception exception) { + throw new BajaRuntimeException((Throwable)exception); + } + } + + protected BHost getHost(CommandLineArguments commandLineArguments) { + String string = commandLineArguments.getOption("h"); + return string == null ? null : (BHost)BOrd.make((String)string).get(); + } + + public int getPort(CommandLineArguments commandLineArguments) { + return commandLineArguments.getIntOption("p", 3011); + } + + public BUsernameAndPassword getCredentials(BDaemonSession bDaemonSession, CommandLineArguments commandLineArguments) throws ConnectException { + String string; + String string2 = commandLineArguments == null ? null : commandLineArguments.getOption("usr"); + String string3 = string = commandLineArguments == null ? null : commandLineArguments.getOption("pwd"); + if (!(string2 != null || commandLineArguments != null && commandLineArguments.hasOption("noinput"))) { + string2 = this.promptString("User: "); + } + if (!(string != null || commandLineArguments != null && commandLineArguments.hasOption("noinput"))) { + string = this.promptPasswordString("Password: "); + } + if (string2 == null || string == null) { + return null; + } + BUsernameAndPassword bUsernameAndPassword = (BUsernameAndPassword)bDaemonSession.makeCredentials(); + bUsernameAndPassword.setUsername(string2); + bUsernameAndPassword.setPassword(BPassword.make((String)string)); + return bUsernameAndPassword; + } + + public void taskStarted(DaemonSessionTask daemonSessionTask) { + if (!daemonSessionTask.getMessage().equals(this.lastTaskMessage)) { + System.out.println(daemonSessionTask.getMessage()); + this.lastTaskMessage = daemonSessionTask.getMessage(); + } + } + + public void taskUpdated(DaemonSessionTask daemonSessionTask) { + this.taskStarted(daemonSessionTask); + } + + public void taskFinished(DaemonSessionTask daemonSessionTask) { + } + + public boolean isCancelEnabled() { + return false; + } + + static /* synthetic */ Class class(String string, boolean bl) { + try { + Class clazz = Class.forName(string); + if (!bl) { + clazz = clazz.getComponentType(); + } + return clazz; + } + catch (ClassNotFoundException classNotFoundException) { + throw new NoClassDefFoundError(classNotFoundException.getMessage()); + } + } + + private final /* synthetic */ void this() { + this.lastTaskMessage = null; + } + + public BDaemonSessionCommand() { + this.this(); + } + + static { + Class clazz = class$com$tridium$platform$command$BDaemonSessionCommand; + if (clazz == null) { + clazz = class$com$tridium$platform$command$BDaemonSessionCommand = BDaemonSessionCommand.class("[Lcom.tridium.platform.command.BDaemonSessionCommand;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/command/BIPlatformCommand.java b/modules/cfr_output/com/tridium/platform/command/BIPlatformCommand.java new file mode 100644 index 0000000..388ccc1 --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/command/BIPlatformCommand.java @@ -0,0 +1,48 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.util.CommandLineArguments + * javax.baja.sys.BInterface + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform.command; + +import com.tridium.util.CommandLineArguments; +import javax.baja.sys.BInterface; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +public interface BIPlatformCommand +extends BInterface { + public static final Type TYPE; + public static final int EXIT_SUCCESS = 0; + public static final int EXIT_FAILURE = 1; + public static final int EXIT_INVALID_USAGE = 2; + public static final int EXIT_FINISHED_WITH_ERRORS = 3; + public static final int EXIT_NO_ACTION = 4; + + public void usage(); + + public int invoke(CommandLineArguments var1) throws Exception; + + public String getCommandName(); + + public boolean includeInCommandListing(); + + public String getCommandDescription(); + + public String getLicenseVendor(); + + public String getLicenseFeature(); + + static { + Class clazz = 1.class$com$tridium$platform$command$BIPlatformCommand; + if (clazz == null) { + clazz = 1.class$com$tridium$platform$command$BIPlatformCommand = 1.class("[Lcom.tridium.platform.command.BIPlatformCommand;", false); + } + TYPE = Sys.loadType((Class)clazz); + } +} + diff --git a/modules/cfr_output/com/tridium/platform/command/BMakeStationPortableCommand.java b/modules/cfr_output/com/tridium/platform/command/BMakeStationPortableCommand.java new file mode 100644 index 0000000..b0969ac --- /dev/null +++ b/modules/cfr_output/com/tridium/platform/command/BMakeStationPortableCommand.java @@ -0,0 +1,301 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * com.tridium.file.types.bog.BBogFile + * com.tridium.nre.security.Aes256PasswordManager + * com.tridium.nre.security.KeyMaterial + * com.tridium.nre.security.KeyRing + * com.tridium.nre.security.SimpleKeyRing + * com.tridium.util.CommandLineArguments + * com.tridium.util.ComponentTreeCursor + * javax.baja.file.BFileSpace + * javax.baja.file.BFileSystem + * javax.baja.file.BIFileStore + * javax.baja.file.BLocalFileStore + * javax.baja.file.FileUtil + * javax.baja.log.Log + * javax.baja.security.BPassword + * javax.baja.space.BComponentSpace + * javax.baja.sys.BComponent + * javax.baja.sys.BValue + * javax.baja.sys.Property + * javax.baja.sys.Sys + * javax.baja.sys.Type + */ +package com.tridium.platform.command; + +import com.tridium.file.types.bog.BBogFile; +import com.tridium.nre.security.Aes256PasswordManager; +import com.tridium.nre.security.KeyMaterial; +import com.tridium.nre.security.KeyRing; +import com.tridium.nre.security.SimpleKeyRing; +import com.tridium.platform.command.BAbstractPlatformCommand; +import com.tridium.util.CommandLineArguments; +import com.tridium.util.ComponentTreeCursor; +import java.io.File; +import javax.baja.file.BFileSpace; +import javax.baja.file.BFileSystem; +import javax.baja.file.BIFileStore; +import javax.baja.file.BLocalFileStore; +import javax.baja.file.FileUtil; +import javax.baja.log.Log; +import javax.baja.security.BPassword; +import javax.baja.space.BComponentSpace; +import javax.baja.sys.BComponent; +import javax.baja.sys.BValue; +import javax.baja.sys.Property; +import javax.baja.sys.Sys; +import javax.baja.sys.Type; + +/* + * Illegal identifiers - consider using --renameillegalidents true + */ +public class BMakeStationPortableCommand +extends BAbstractPlatformCommand { + public static final BMakeStationPortableCommand INSTANCE = new BMakeStationPortableCommand(); + public static final Type TYPE; + private static final Log log; + private KeyRing kr; + private boolean errors; + static /* synthetic */ Class class$com$tridium$platform$command$BMakeStationPortableCommand; + + public Type getType() { + return TYPE; + } + + public void usage() { + BMakeStationPortableCommand.println(""); + BMakeStationPortableCommand.println("usage:"); + BMakeStationPortableCommand.println(" plat makeportable [target] [securityDir]"); + BMakeStationPortableCommand.println("parameters:"); + BMakeStationPortableCommand.println(" sourceStationDir the station directory to convert"); + BMakeStationPortableCommand.println(" target the name of the target station. Defaults to the name of the source station."); + BMakeStationPortableCommand.println(" securityDir the security directory of the source station. Defaults to /../../security"); + BMakeStationPortableCommand.println("optional flags:"); + BMakeStationPortableCommand.println(" -o overwrite existing destStationDir"); + BMakeStationPortableCommand.println(" -locale: set the default locale (en_US)"); + BMakeStationPortableCommand.println(" -@