合并主线2.0.0.0-0k0.1~2.0.0.0-0k0.14版本到openkylin
This commit is contained in:
parent
c2cc7fec93
commit
bf5a351040
|
@ -21,6 +21,7 @@ debian/libkysdk-system/
|
|||
debian/libkysdk-system-dev/
|
||||
debian/libkysdk-systime/
|
||||
debian/libkysdk-systime-dev/
|
||||
debian/libkysdk-processmanage/
|
||||
debian/libkysdk*.substvars
|
||||
debian/libkysdk*.debhelper
|
||||
debian/.debhelper
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
libkysdk-system (2.0.0.0-ok7) yangtze; urgency=medium
|
||||
|
||||
*Bug号:
|
||||
*需求号:
|
||||
*其他修改:合并主线2.0.0.0-0k0.1~2.0.0.0-0k0.14版本到openkylin
|
||||
|
||||
-- szm-min <shaozhimin@kylinos.cn> Mon, 03 Apr 2023 10:46:43 +0800
|
||||
|
||||
libkysdk-system (2.0.0.0-ok6) yangtze; urgency=medium
|
||||
|
||||
*Bug号:
|
||||
|
|
|
@ -22,7 +22,10 @@ Build-Depends: debhelper-compat (= 12),
|
|||
libtesseract-dev,
|
||||
libcups2-dev,
|
||||
libcurl4-openssl-dev,
|
||||
libxrandr-dev
|
||||
libxrandr-dev,
|
||||
libqt5dbus5,
|
||||
libqt5webchannel5-dev,
|
||||
libqt5websockets5-dev
|
||||
Standards-Version: 4.4.1
|
||||
Homepage: http://gitlab2.kylin.com/kysdk/kysdk-system
|
||||
|
||||
|
@ -102,6 +105,7 @@ Depends: ${shlibs:Depends},
|
|||
systemd,
|
||||
libglib2.0-0,
|
||||
libkysdk-timer(>=1.2.0),
|
||||
libkysdk-config(>=1.2.0),
|
||||
libkysdk-systemcommon
|
||||
Multi-Arch: same
|
||||
Description: 系统时间相关操作库
|
||||
|
@ -113,7 +117,8 @@ Depends: ${shlibs:Depends},
|
|||
${misc:Depends},
|
||||
libkysdk-systime,
|
||||
libglib2.0-dev,
|
||||
libkysdk-timer-dev(>=1.2.0)
|
||||
libkysdk-timer-dev(>=1.2.0),
|
||||
libkysdk-config-dev(>=1.2.0)
|
||||
Multi-Arch: foreign
|
||||
Description: 系统时间相关操作库 - 开发库
|
||||
|
||||
|
@ -228,6 +233,7 @@ Architecture: any
|
|||
Section: utils
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
libkysdk-log(>=1.2.0),
|
||||
libkysdk-systemcommon
|
||||
Multi-Arch: same
|
||||
Description: 运行时信息获取库
|
||||
|
@ -237,6 +243,8 @@ Architecture: all
|
|||
Section: utils
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
libkysdk-log-dev(>=1.2.0),
|
||||
libkysdk-utils-dev(>=1.2.0),
|
||||
libkysdk-proc
|
||||
Multi-Arch: foreign
|
||||
Description: 运行时信息获取库 - 开发库
|
||||
|
@ -343,4 +351,72 @@ Depends: ${shlibs:Depends},
|
|||
${misc:Depends},
|
||||
libkysdk-realtime
|
||||
Multi-Arch: foreign
|
||||
Description: 运行时信息库 - 开发库
|
||||
Description: 运行时信息库 - 开发库
|
||||
|
||||
Package: libkysdk-system-java
|
||||
Architecture: any
|
||||
Section: utils
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
libkysdk-system-dbus
|
||||
Multi-Arch: same
|
||||
Description: 多语言支持 - java
|
||||
|
||||
Package: libkysdk-system-python
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, python3-dbus, libkysdk-system-dbus
|
||||
Multi-Arch: same
|
||||
Description: 多语言支持 - python
|
||||
|
||||
Package: libkysdk-system-dbus
|
||||
Architecture: any
|
||||
Section: utils
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
libqt5dbus5,
|
||||
libkysdk-disk,
|
||||
libkysdk-hardware,
|
||||
libkysdk-location,
|
||||
libkysdk-net,
|
||||
libkysdk-package,
|
||||
libkysdk-proc,
|
||||
libkysdk-realtime,
|
||||
libkysdk-sysinfo
|
||||
Multi-Arch: same
|
||||
Description: sdk dbus
|
||||
|
||||
Package: libkysdk-system-javascript-http
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends},libqt5widgets5,libqt5gui5,libqt5dbus5,libqt5core5a,libkysdk-system-dbus
|
||||
Multi-Arch: same
|
||||
Description:多语言支持 - javascript
|
||||
|
||||
Package: libkysdk-system-javascript-websocket
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends},libqt5webchannel5,libqt5websockets5,libkysdk-system-dbus
|
||||
Multi-Arch: same
|
||||
Description: 多语言支持 - javascript
|
||||
|
||||
Package: libkysdk-logrotate
|
||||
Architecture: any
|
||||
Section: utils
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
libkysdk-systemcommon,
|
||||
libqt5core5a,
|
||||
libqt5dbus5,
|
||||
libkysdk-log,
|
||||
logrotate
|
||||
Multi-Arch: same
|
||||
Description: 日志转储服务
|
||||
|
||||
Package: libkysdk-processmanage
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends},
|
||||
${shlibs:Depends},
|
||||
libdbus-1-3,
|
||||
libkysdk-log,
|
||||
libkysdk-config,
|
||||
libkysdk-utils
|
||||
Description: 进程管理
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
systemctl enable dbus_location.service
|
||||
systemctl restart dbus_location.service
|
|
@ -0,0 +1,4 @@
|
|||
bin/kysdk-logrotate usr/bin/
|
||||
src/logrotate/com.kysdk.base.conf etc/dbus-1/system.d/
|
||||
src/logrotate/kysdk-logrotate.service lib/systemd/system/
|
||||
src/logrotate/logrotate.cron usr/lib/kysdk/kysdk-system/
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
systemctl enable kysdk-logrotate.service
|
||||
systemctl restart kysdk-logrotate.service
|
||||
crontab /usr/lib/kysdk/kysdk-system/logrotate.cron
|
|
@ -0,0 +1,4 @@
|
|||
development-files/kysdk-processmanage.pc usr/share/pkgconfig/
|
||||
src/processmanage/processStateManage.service lib/systemd/system
|
||||
src/processmanage/com.kylin.processStateManage.conf etc/dbus-1/system.d
|
||||
bin/processStateManage usr/bin/
|
|
@ -0,0 +1,6 @@
|
|||
bin/kySdkDbus usr/bin/
|
||||
bin/kySdkDbus-session usr/bin/
|
||||
src/kysdkdbus/com.kylin.kysdk.service.conf etc/dbus-1/system.d/
|
||||
src/kysdkdbus/kysdk-dbus.service lib/systemd/system/
|
||||
src/kysdkdbus/kysdk-dbus-session.desktop etc/xdg/autostart/
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable kysdk-dbus.service
|
||||
|
|
@ -0,0 +1 @@
|
|||
src/kysdk-java/kysdk-java-ext/kysdk-java/target/kysdk-java-1.0.0.jar usr/share/java
|
|
@ -0,0 +1,4 @@
|
|||
src/libkysdk-system-javascript-http/httpServer usr/bin/
|
||||
src/libkysdk-system-javascript-http/conf/kysdk.conf etc/kysdk/
|
||||
src/libkysdk-system-javascript-http/conf/kysdkHttpServer.desktop etc/xdg/autostart/
|
||||
src/libkysdk-system-javascript-http/html/ usr/lib/kysdk-dbus-http/html/
|
|
@ -0,0 +1,3 @@
|
|||
src/libkysdk-system-javascript-websocket/kysdk-dbus-websocket usr/bin/
|
||||
src/libkysdk-system-javascript-websocket/kysdk-dbus-websocket.desktop etc/xdg/autostart/
|
||||
src/libkysdk-system-javascript-websocket/html/ usr/lib/kysdk-dbus-websocket/html/
|
|
@ -0,0 +1 @@
|
|||
src/python/kysdk.py usr/lib/python3/dist-packages/
|
|
@ -0,0 +1,2 @@
|
|||
usr/include/kysdk/kysdk-system/libkydate.h
|
||||
development-files/kysdk-systime.pc usr/share/pkgconfig/
|
|
@ -1,3 +1,10 @@
|
|||
bin/* usr/bin/
|
||||
bin/systime usr/bin/
|
||||
src/systemtime/com.kylin.kysdk.TimeServer.conf etc/dbus-1/system.d/
|
||||
src/systemtime/kysdk-systime.service lib/systemd/system/
|
||||
src/systemtime/kysdk-systime-date.desktop etc/xdg/autostart/
|
||||
bin/sdk-date usr/bin/
|
||||
usr/lib/kysdk/kysdk-system/libkydate.so*
|
||||
src/systemtime/dateform.conf /etc/kydate/
|
||||
po/zh_CN.mo usr/share/locale/zh_CN/LC_MESSAGES/
|
||||
po/bo_CN.mo usr/share/locale/bo_CN/LC_MESSAGES/
|
||||
|
||||
|
|
|
@ -8,3 +8,5 @@ else
|
|||
systemctl restart kysdk-systime.service
|
||||
fi
|
||||
|
||||
mv /usr/share/locale/zh_CN/LC_MESSAGES/zh_CN.mo /usr/share/locale/zh_CN/LC_MESSAGES/kysdk-date.mo
|
||||
mv /usr/share/locale/bo_CN/LC_MESSAGES/bo_CN.mo /usr/share/locale/bo_CN/LC_MESSAGES/kysdk-date.mo
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Name: process-state-manage
|
||||
Description: manage process oom_score_adj and oom_score_adj_child
|
||||
Requires: kysdk-log kysdk-config libsystemd dbus-1 dbus-glib-1
|
||||
Version: 2.0.0
|
|
@ -0,0 +1,6 @@
|
|||
Name: libkysdk-systime
|
||||
Description: kysdk system layer date component
|
||||
Requires: kysdk-config glib-2.0
|
||||
Version: 2.0.0
|
||||
Libs: -L/usr/lib/kysdk/kysdk-system/ -lkydate -Wl,-rpath=/usr/lib/kysdk/kysdk-system/
|
||||
Cflags: -I/usr/include/kysdk/kysdk-system/
|
Binary file not shown.
|
@ -0,0 +1,266 @@
|
|||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-08-16 14:41+0800\n"
|
||||
"PO-Revision-Date: 2022-08-17 03:47+0000\n"
|
||||
"Last-Translator: shaozhimin <shaozhimin@kylinos.cn>\n"
|
||||
"Language-Team: Tibetan (China) <http://weblate.openkylin.top/projects/"
|
||||
"kysdk-system/kysdk-system/bo_CN/>\n"
|
||||
"Language: bo_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Weblate 4.12.1-dev\n"
|
||||
|
||||
#: src/systemtime/libkydate.c:109 src/systemtime/libkydate.c:1162
|
||||
#: src/systemtime/libkydate.c:1435 src/systemtime/date.c:104
|
||||
msgid "%Y_year%m_mon%d_day"
|
||||
msgstr "%Yལོ།%mཟླ།%dཉིན།"
|
||||
|
||||
#: src/systemtime/libkydate.c:126 src/systemtime/libkydate.c:603
|
||||
#: src/systemtime/libkydate.c:696 src/systemtime/libkydate.c:1174
|
||||
#: src/systemtime/libkydate.c:1447 src/systemtime/date.c:82
|
||||
#: src/systemtime/libkydate.c:1494
|
||||
#, c-format
|
||||
msgid "%d_year%d_mon%d_day"
|
||||
msgstr "%dལོ།%dཟླ།%dཉིན།"
|
||||
|
||||
#: src/systemtime/libkydate.c:445
|
||||
#, c-format
|
||||
msgid "**year**mon**day"
|
||||
msgstr "**ལོ།**ཟླ།**ཉིན།"
|
||||
|
||||
#: src/systemtime/libkydate.c:456
|
||||
#, c-format
|
||||
msgid "*year*mon*day"
|
||||
msgstr "*ལོ།*ཟླ།*ཉིན།"
|
||||
|
||||
#: src/systemtime/libkydate.c:486 src/systemtime/libkydate.c:499
|
||||
#: src/systemtime/date.c:115 src/systemtime/date.c:124
|
||||
#, c-format
|
||||
msgid "24-hour clock"
|
||||
msgstr "ཆུ་ཚོད་24ལམ་ལུགས་"
|
||||
|
||||
#: src/systemtime/libkydate.c:507 src/systemtime/date.c:131
|
||||
#, c-format
|
||||
msgid "12-hour clock"
|
||||
msgstr "ཆུ་ཚོད་12ལམ་ལུགས་"
|
||||
|
||||
#: src/systemtime/libkydate.c:687
|
||||
#, c-format
|
||||
msgid "%d_year0%d_mon0%d_day"
|
||||
msgstr "%dལོ།0%dཟླ།0%dཉིན།"
|
||||
|
||||
#: src/systemtime/libkydate.c:689
|
||||
#, c-format
|
||||
msgid "%d_year0%d_mon%d_day"
|
||||
msgstr "%dལོ།0%dཟླ།%dཉིན།"
|
||||
|
||||
#: src/systemtime/libkydate.c:694
|
||||
#, c-format
|
||||
msgid "%d_year%d_mon0%d_day"
|
||||
msgstr "%dལོ།%dཟླ།0%dཉིན།"
|
||||
|
||||
#: src/systemtime/libkydate.c:778 src/systemtime/libkydate.c:820
|
||||
#, c-format
|
||||
msgid "pm%d:0%d"
|
||||
msgstr "ཕྱི་དྲོ།%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:781 src/systemtime/libkydate.c:823
|
||||
#, c-format
|
||||
msgid "pm%d:0%d:0%d"
|
||||
msgstr "ཕྱི་དྲོ།%d:0%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:784 src/systemtime/libkydate.c:825
|
||||
#, c-format
|
||||
msgid "pm%d:0%d:%d"
|
||||
msgstr "ཕྱི་དྲོ།%d:0%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:787 src/systemtime/libkydate.c:828
|
||||
#, c-format
|
||||
msgid "pm%d:%d"
|
||||
msgstr "ཕྱི་དྲོ།%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:790 src/systemtime/libkydate.c:831
|
||||
#, c-format
|
||||
msgid "pm%d:%d:0%d"
|
||||
msgstr "ཕྱི་དྲོ།%d:%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:793 src/systemtime/libkydate.c:833
|
||||
#, c-format
|
||||
msgid "pm%d:%d:%d"
|
||||
msgstr "ཕྱི་དྲོ།%d:%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:801
|
||||
#, c-format
|
||||
msgid "pm0%d:0%d"
|
||||
msgstr "ཕྱི་དྲོ།0%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:804
|
||||
#, c-format
|
||||
msgid "pm0%d:0%d:0%d"
|
||||
msgstr "ཕྱི་དྲོ།0%d:0%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:806
|
||||
#, c-format
|
||||
msgid "pm0%d:0%d:%d"
|
||||
msgstr "ཕྱི་དྲོ།0%d:0%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:809
|
||||
#, c-format
|
||||
msgid "pm0%d:%d"
|
||||
msgstr "ཕྱི་དྲོ།0%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:812
|
||||
#, c-format
|
||||
msgid "pm0%d:%d:0%d"
|
||||
msgstr "ཕྱི་དྲོ།0%d:%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:814
|
||||
#, c-format
|
||||
msgid "pm0%d:%d:%d"
|
||||
msgstr "ཕྱི་དྲོ།0%d:%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:843
|
||||
#, c-format
|
||||
msgid "am0%d:0%d"
|
||||
msgstr "སྔ་དྲོ།0%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:846
|
||||
#, c-format
|
||||
msgid "am0%d:0%d:0%d"
|
||||
msgstr "སྔ་དྲོ།0%d:0%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:848
|
||||
#, c-format
|
||||
msgid "am0%d:0%d:%d"
|
||||
msgstr "སྔ་དྲོ།0%d:0%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:851
|
||||
#, c-format
|
||||
msgid "am0%d:%d"
|
||||
msgstr "སྔ་དྲོ།0%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:854
|
||||
#, c-format
|
||||
msgid "am0%d:%d:0%d"
|
||||
msgstr "སྔ་དྲོ།0%d:%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:856
|
||||
#, c-format
|
||||
msgid "am0%d:%d:%d"
|
||||
msgstr "སྔ་དྲོ།0%d:%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:862
|
||||
#, c-format
|
||||
msgid "am%d:0%d"
|
||||
msgstr "སྔ་དྲོ།%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:865
|
||||
#, c-format
|
||||
msgid "am%d:0%d:0%d"
|
||||
msgstr "སྔ་དྲོ།%d:0%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:867
|
||||
#, c-format
|
||||
msgid "am%d:0%d:%d"
|
||||
msgstr "སྔ་དྲོ།%d:0%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:870
|
||||
#, c-format
|
||||
msgid "am%d:%d"
|
||||
msgstr "སྔ་དྲོ།%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:873
|
||||
#, c-format
|
||||
msgid "am%d:%d:0%d"
|
||||
msgstr "སྔ་དྲོ།%d:%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:875
|
||||
#, c-format
|
||||
msgid "am%d:%d:%d"
|
||||
msgstr "སྔ་དྲོ།%d:%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:1084 src/systemtime/libkydate.c:1386
|
||||
msgid "pm%I:%M"
|
||||
msgstr "ཕྱི་དྲོ།%I:%M"
|
||||
|
||||
#: src/systemtime/libkydate.c:1086 src/systemtime/libkydate.c:1388
|
||||
msgid "am%I:%M"
|
||||
msgstr "སྔ་དྲོ།%I:%M"
|
||||
|
||||
#: src/systemtime/libkydate.c:1214
|
||||
msgid "_Sun"
|
||||
msgstr "གཟའ་ཉི་མ།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1217
|
||||
msgid "_Mon"
|
||||
msgstr "གཟའ་ཟླ་བ།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1220
|
||||
msgid "_Tue"
|
||||
msgstr "གཟའ་མིག་དམར།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1223
|
||||
msgid "_Wed"
|
||||
msgstr "གཟའ་ལྷག་པ།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1226
|
||||
msgid "_Thu"
|
||||
msgstr "གཟའ་ཕུར་བུ།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1229
|
||||
msgid "_Fri"
|
||||
msgstr "གཟའ་པ་སངས།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1232
|
||||
msgid "_Sat"
|
||||
msgstr "གཟའ་སྤེན་པ།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1263
|
||||
msgid "_Sunday"
|
||||
msgstr "གཟའ་ཉི་མ།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1266
|
||||
msgid "_Monday"
|
||||
msgstr "གཟའ་ཟླ་བ།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1269
|
||||
msgid "_Tuesday"
|
||||
msgstr "གཟའ་མིག་དམར།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1272
|
||||
msgid "_Wednesday"
|
||||
msgstr "གཟའ་ལྷག་པ།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1275
|
||||
msgid "_Thursday"
|
||||
msgstr "གཟའ་ཕུར་བུ།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1278
|
||||
msgid "_Friday"
|
||||
msgstr "གཟའ་པ་སངས།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1281
|
||||
msgid "_Saturday"
|
||||
msgstr "གཟའ་སྤེན་པ།"
|
||||
|
||||
#: src/systemtime/libkydate.c:1330
|
||||
msgid "pm%I:%M:%S"
|
||||
msgstr "ཕྱི་དྲོ།%I:%M:%S"
|
||||
|
||||
#: src/systemtime/libkydate.c:1332
|
||||
msgid "am%I:%M:%S"
|
||||
msgstr "སྔ་དྲོ།%I:%M:%S"
|
||||
|
||||
#: src/systemtime/libkydate.c:1483
|
||||
#, c-format
|
||||
msgid "%s_year%s_mon%s_day"
|
||||
msgstr "%sལོ།%sཟླ།%sཉིན།"
|
Binary file not shown.
|
@ -0,0 +1,265 @@
|
|||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-08-16 14:41+0800\n"
|
||||
"PO-Revision-Date: 2022-08-19 09:56+0800\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.3\n"
|
||||
"Last-Translator: \n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"Language: zh_CN\n"
|
||||
|
||||
#: src/systemtime/libkydate.c:109 src/systemtime/libkydate.c:1162
|
||||
#: src/systemtime/libkydate.c:1435 src/systemtime/date.c:104
|
||||
msgid "%Y_year%m_mon%d_day"
|
||||
msgstr "%Y年%m月%d日"
|
||||
|
||||
#: src/systemtime/libkydate.c:126 src/systemtime/libkydate.c:603
|
||||
#: src/systemtime/libkydate.c:696 src/systemtime/libkydate.c:1174
|
||||
#: src/systemtime/libkydate.c:1447 src/systemtime/date.c:82
|
||||
#: src/systemtime/libkydate.c:1494
|
||||
#, c-format
|
||||
msgid "%d_year%d_mon%d_day"
|
||||
msgstr "%d年%d月%d日"
|
||||
|
||||
#: src/systemtime/libkydate.c:445
|
||||
#, c-format
|
||||
msgid "**year**mon**day"
|
||||
msgstr "**年**月**日"
|
||||
|
||||
#: src/systemtime/libkydate.c:456
|
||||
#, c-format
|
||||
msgid "*year*mon*day"
|
||||
msgstr "*年*月*日"
|
||||
|
||||
#: src/systemtime/libkydate.c:486 src/systemtime/libkydate.c:499
|
||||
#: src/systemtime/date.c:115 src/systemtime/date.c:124
|
||||
#, c-format
|
||||
msgid "24-hour clock"
|
||||
msgstr "24小时制"
|
||||
|
||||
#: src/systemtime/libkydate.c:507 src/systemtime/date.c:131
|
||||
#, c-format
|
||||
msgid "12-hour clock"
|
||||
msgstr "12小时制"
|
||||
|
||||
#: src/systemtime/libkydate.c:687
|
||||
#, c-format
|
||||
msgid "%d_year0%d_mon0%d_day"
|
||||
msgstr "%d年0%d月0%d日"
|
||||
|
||||
#: src/systemtime/libkydate.c:689
|
||||
#, c-format
|
||||
msgid "%d_year0%d_mon%d_day"
|
||||
msgstr "%d年0%d月%d日"
|
||||
|
||||
#: src/systemtime/libkydate.c:694
|
||||
#, c-format
|
||||
msgid "%d_year%d_mon0%d_day"
|
||||
msgstr "%d年%d月0%d日"
|
||||
|
||||
#: src/systemtime/libkydate.c:778 src/systemtime/libkydate.c:820
|
||||
#, c-format
|
||||
msgid "pm%d:0%d"
|
||||
msgstr "下午%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:781 src/systemtime/libkydate.c:823
|
||||
#, c-format
|
||||
msgid "pm%d:0%d:0%d"
|
||||
msgstr "下午%d:0%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:784 src/systemtime/libkydate.c:825
|
||||
#, c-format
|
||||
msgid "pm%d:0%d:%d"
|
||||
msgstr "下午%d:0%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:787 src/systemtime/libkydate.c:828
|
||||
#, c-format
|
||||
msgid "pm%d:%d"
|
||||
msgstr "下午%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:790 src/systemtime/libkydate.c:831
|
||||
#, c-format
|
||||
msgid "pm%d:%d:0%d"
|
||||
msgstr "下午%d:%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:793 src/systemtime/libkydate.c:833
|
||||
#, c-format
|
||||
msgid "pm%d:%d:%d"
|
||||
msgstr "下午%d:%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:801
|
||||
#, c-format
|
||||
msgid "pm0%d:0%d"
|
||||
msgstr "下午0%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:804
|
||||
#, c-format
|
||||
msgid "pm0%d:0%d:0%d"
|
||||
msgstr "下午0%d:0%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:806
|
||||
#, c-format
|
||||
msgid "pm0%d:0%d:%d"
|
||||
msgstr "下午0%d:0%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:809
|
||||
#, c-format
|
||||
msgid "pm0%d:%d"
|
||||
msgstr "下午0%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:812
|
||||
#, c-format
|
||||
msgid "pm0%d:%d:0%d"
|
||||
msgstr "下午0%d:%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:814
|
||||
#, c-format
|
||||
msgid "pm0%d:%d:%d"
|
||||
msgstr "下午0%d:%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:843
|
||||
#, c-format
|
||||
msgid "am0%d:0%d"
|
||||
msgstr "上午0%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:846
|
||||
#, c-format
|
||||
msgid "am0%d:0%d:0%d"
|
||||
msgstr "上午0%d:0%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:848
|
||||
#, c-format
|
||||
msgid "am0%d:0%d:%d"
|
||||
msgstr "上午0%d:0%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:851
|
||||
#, c-format
|
||||
msgid "am0%d:%d"
|
||||
msgstr "上午0%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:854
|
||||
#, c-format
|
||||
msgid "am0%d:%d:0%d"
|
||||
msgstr "上午0%d:%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:856
|
||||
#, c-format
|
||||
msgid "am0%d:%d:%d"
|
||||
msgstr "上午0%d:%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:862
|
||||
#, c-format
|
||||
msgid "am%d:0%d"
|
||||
msgstr "上午%d0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:865
|
||||
#, c-format
|
||||
msgid "am%d:0%d:0%d"
|
||||
msgstr "上午%d:0%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:867
|
||||
#, c-format
|
||||
msgid "am%d:0%d:%d"
|
||||
msgstr "上午%d:0%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:870
|
||||
#, c-format
|
||||
msgid "am%d:%d"
|
||||
msgstr "上午%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:873
|
||||
#, c-format
|
||||
msgid "am%d:%d:0%d"
|
||||
msgstr "上午%d:%d:0%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:875
|
||||
#, c-format
|
||||
msgid "am%d:%d:%d"
|
||||
msgstr "上午%d:%d:%d"
|
||||
|
||||
#: src/systemtime/libkydate.c:1084 src/systemtime/libkydate.c:1386
|
||||
msgid "pm%I:%M"
|
||||
msgstr "下午%I:%M"
|
||||
|
||||
#: src/systemtime/libkydate.c:1086 src/systemtime/libkydate.c:1388
|
||||
msgid "am%I:%M"
|
||||
msgstr "上午%I:%M"
|
||||
|
||||
#: src/systemtime/libkydate.c:1214
|
||||
msgid "_Sun"
|
||||
msgstr "周日"
|
||||
|
||||
#: src/systemtime/libkydate.c:1217
|
||||
msgid "_Mon"
|
||||
msgstr "周一"
|
||||
|
||||
#: src/systemtime/libkydate.c:1220
|
||||
msgid "_Tue"
|
||||
msgstr "周二"
|
||||
|
||||
#: src/systemtime/libkydate.c:1223
|
||||
msgid "_Wed"
|
||||
msgstr "周三"
|
||||
|
||||
#: src/systemtime/libkydate.c:1226
|
||||
msgid "_Thu"
|
||||
msgstr "周四"
|
||||
|
||||
#: src/systemtime/libkydate.c:1229
|
||||
msgid "_Fri"
|
||||
msgstr "周五"
|
||||
|
||||
#: src/systemtime/libkydate.c:1232
|
||||
msgid "_Sat"
|
||||
msgstr "周六"
|
||||
|
||||
#: src/systemtime/libkydate.c:1263
|
||||
msgid "_Sunday"
|
||||
msgstr "星期日"
|
||||
|
||||
#: src/systemtime/libkydate.c:1266
|
||||
msgid "_Monday"
|
||||
msgstr "星期一"
|
||||
|
||||
#: src/systemtime/libkydate.c:1269
|
||||
msgid "_Tuesday"
|
||||
msgstr "星期二"
|
||||
|
||||
#: src/systemtime/libkydate.c:1272
|
||||
msgid "_Wednesday"
|
||||
msgstr "星期三"
|
||||
|
||||
#: src/systemtime/libkydate.c:1275
|
||||
msgid "_Thursday"
|
||||
msgstr "星期四"
|
||||
|
||||
#: src/systemtime/libkydate.c:1278
|
||||
msgid "_Friday"
|
||||
msgstr "星期五"
|
||||
|
||||
#: src/systemtime/libkydate.c:1281
|
||||
msgid "_Saturday"
|
||||
msgstr "星期六"
|
||||
|
||||
#: src/systemtime/libkydate.c:1330
|
||||
msgid "pm%I:%M:%S"
|
||||
msgstr "下午%I:%M:%S"
|
||||
|
||||
#: src/systemtime/libkydate.c:1332
|
||||
msgid "am%I:%M:%S"
|
||||
msgstr "上午%I:%M:%S"
|
||||
|
||||
#: src/systemtime/libkydate.c:1483
|
||||
#, c-format
|
||||
msgid "%s_year%s_mon%s_day"
|
||||
msgstr "%s年%s月%s日"
|
|
@ -1,3 +1,10 @@
|
|||
|
||||
# add_custom_target(PREBUILDER ALL)
|
||||
# add_custom_command(TARGET PREBUILDER
|
||||
# PRE_BUILD
|
||||
# COMMAND sh ${PROJECT_SOURCE_DIR}/src/realtime/smartctl/configure
|
||||
# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/realtime/smartctl)
|
||||
|
||||
add_subdirectory(disk)
|
||||
add_subdirectory(systeminfo)
|
||||
add_subdirectory(systemtime)
|
||||
|
@ -8,5 +15,10 @@ add_subdirectory(filesystem)
|
|||
add_subdirectory(powermanagement)
|
||||
add_subdirectory(kdkocr)
|
||||
add_subdirectory(location)
|
||||
add_subdirectory(logrotate)
|
||||
add_subdirectory(net)
|
||||
add_subdirectory(realtime)
|
||||
add_subdirectory(realtime)
|
||||
add_subdirectory(kysdkdbus)
|
||||
add_subdirectory(libkysdk-system-javascript-http)
|
||||
add_subdirectory(libkysdk-system-javascript-websocket)
|
||||
add_subdirectory(processmanage)
|
||||
|
|
|
@ -115,7 +115,7 @@ static int get_disk_space(int fd, kdk_diskinfo *di)
|
|||
if (get_disk_size(fd, &bytes))
|
||||
{
|
||||
klog_err("磁盘容量获取失败\n");
|
||||
printf("Unable to get disk size.\n");
|
||||
klog_err("Unable to get disk size.\n");
|
||||
return -1;
|
||||
}
|
||||
di->sectors_num = (bytes >> 9);
|
||||
|
@ -244,18 +244,23 @@ static int get_disk_type(kdk_diskinfo *di)
|
|||
// 获取接口类型
|
||||
|
||||
// 获取磁盘类型
|
||||
if (isdigit(di->name[strlen(di->name)])) // 分区盘
|
||||
{
|
||||
di->disk_type = DISK_TYPE_NONE;
|
||||
goto out;
|
||||
}
|
||||
else
|
||||
{
|
||||
// if (isdigit(di->name[strlen(di->name)])) // 分区盘
|
||||
// {
|
||||
// di->disk_type = DISK_TYPE_NONE;
|
||||
// goto out;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
#ifdef __linux__
|
||||
const char *p_name = di->name;
|
||||
p_name += strlastof(p_name, '/');
|
||||
char syspath[PATH_MAX];
|
||||
sprintf(syspath, "/sys/block/%s/queue/rotational", p_name);
|
||||
if(0 != access(syspath,0))
|
||||
{
|
||||
di->disk_type = DISK_TYPE_NONE;
|
||||
goto out;
|
||||
}
|
||||
int tfd = open(syspath, O_RDONLY);
|
||||
if (! tfd)
|
||||
{
|
||||
|
@ -273,13 +278,14 @@ static int get_disk_type(kdk_diskinfo *di)
|
|||
|
||||
if (di->disk_type == DISK_TYPE_SSD)
|
||||
goto out;
|
||||
}
|
||||
// }
|
||||
|
||||
// 获取转速信息(固态除外)
|
||||
|
||||
|
||||
|
||||
out:
|
||||
close(tfd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -420,7 +426,7 @@ kdk_diskinfo *kdk_get_diskinfo(const char *diskname)
|
|||
serial_val = udev_device_get_sysattr_value(dev,"serial");
|
||||
// klog_debug("Dev DeviceDevPath: %s\n", udev_device_get_syspath(dev));
|
||||
// klog_debug("Dev DeviceSerial: %s\n", serial_val);
|
||||
res->serial = strdup(serial_val);
|
||||
res->serial = strdup(serial_val ? serial_val : "None");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -442,7 +448,7 @@ kdk_diskinfo *kdk_get_diskinfo(const char *diskname)
|
|||
// klog_debug("Dev_P DeviceDevPath: %s\n", udev_device_get_syspath(serial));
|
||||
}
|
||||
// klog_debug("Dev_P DeviceSerial: %s\n", serial_val);
|
||||
res->serial = strdup(serial_val);
|
||||
res->serial = strdup(serial_val ? serial_val : "None");
|
||||
res->model = strdup(udev_device_get_sysattr_value(dev_P,"model"));
|
||||
}
|
||||
else if (udev_device_get_sysattr_value(dev_PP,"model"))
|
||||
|
@ -459,7 +465,7 @@ kdk_diskinfo *kdk_get_diskinfo(const char *diskname)
|
|||
// klog_debug("DeviceDevPath: %s\n", udev_device_get_syspath(serial));
|
||||
}
|
||||
// klog_debug("DeviceSerial: %s\n", serial_val);
|
||||
res->serial = strdup(serial_val);
|
||||
res->serial = strdup(serial_val ? serial_val : "None");
|
||||
res->model = strdup(udev_device_get_sysattr_value(dev_PP,"model"));
|
||||
}
|
||||
else{
|
||||
|
@ -479,6 +485,7 @@ kdk_diskinfo *kdk_get_diskinfo(const char *diskname)
|
|||
char buf[10] = {0};
|
||||
read(tfd, buf, FWREV_SIZE);
|
||||
strcpy(res->fwrev, buf);
|
||||
close(tfd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -517,4 +524,4 @@ void kdk_free_diskinfo(kdk_diskinfo *disk)
|
|||
SAFE_FREE(disk->mount_path);
|
||||
SAFE_FREE(disk->fwrev);
|
||||
SAFE_FREE(disk);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
aux_source_directory(. SOURCESCODE)
|
||||
include_directories(.)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(GLIB REQUIRED glib-2.0)
|
||||
include_directories(${GLIB_INCLUDE_DIRS})
|
||||
add_library(kyhw SHARED ${SOURCESCODE})
|
||||
set_target_properties(kyhw PROPERTIES VERSION 2.0.0 SOVERSION 1)
|
||||
add_executable(kync-test test/kync-test.c)
|
||||
|
@ -10,7 +13,7 @@ add_executable(kyusb-test test/kyusb-test.c)
|
|||
add_executable(kybios-test test/kybios-test.c)
|
||||
add_executable(kyboard-test test/kyboard-test.c)
|
||||
# 额外链接的库在这一行
|
||||
target_link_libraries(kyhw kylog kyconf pthread systemd cups curl udev)
|
||||
target_link_libraries(kyhw kylog kyconf pthread systemd cups curl udev ${GLIB_LIBRARIES})
|
||||
target_link_libraries(kyprinterprint-test kyhw)
|
||||
target_link_libraries(kyprinterlist-test kyhw)
|
||||
target_link_libraries(kync-test kyhw)
|
||||
|
@ -38,4 +41,4 @@ install(FILES libkyboard.h
|
|||
DESTINATION include/kysdk/kysdk-system)
|
||||
|
||||
install(FILES libkyusb.h
|
||||
DESTINATION include/kysdk/kysdk-system)
|
||||
DESTINATION include/kysdk/kysdk-system)
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
const char *kdk_board_get_name()
|
||||
{
|
||||
char *name = (char *)calloc(32,sizeof(char));
|
||||
char *name = (char *)calloc(64,sizeof(char));
|
||||
FILE *fd = fopen("/sys/class/dmi/id/board_name","r");
|
||||
if(fd)
|
||||
{
|
||||
fgets(name,32,fd);
|
||||
fgets(name,64,fd);
|
||||
fclose(fd);
|
||||
}
|
||||
return name;
|
||||
|
@ -17,11 +17,11 @@ const char *kdk_board_get_name()
|
|||
|
||||
const char *kdk_board_get_date()
|
||||
{
|
||||
char *date = (char *)calloc(32,sizeof(char));
|
||||
char *date = (char *)calloc(64,sizeof(char));
|
||||
FILE *fd = fopen("/sys/class/dmi/id/bios_date","r");
|
||||
if(fd)
|
||||
{
|
||||
fgets(date,32,fd);
|
||||
fgets(date,64,fd);
|
||||
fclose(fd);
|
||||
}
|
||||
return date;
|
||||
|
@ -29,11 +29,11 @@ const char *kdk_board_get_date()
|
|||
|
||||
const char *kdk_board_get_serial()
|
||||
{
|
||||
char *serial = (char *)calloc(32,sizeof(char));
|
||||
char *serial = (char *)calloc(64,sizeof(char));
|
||||
FILE *fd = fopen("/sys/class/dmi/id/board_serial","r");
|
||||
if(fd)
|
||||
{
|
||||
fgets(serial,32,fd);
|
||||
fgets(serial,64,fd);
|
||||
fclose(fd);
|
||||
}
|
||||
return serial;
|
||||
|
@ -41,11 +41,11 @@ const char *kdk_board_get_serial()
|
|||
|
||||
const char *kdk_board_get_vendor()
|
||||
{
|
||||
char *vendor = (char *)calloc(32,sizeof(char));
|
||||
char *vendor = (char *)calloc(64,sizeof(char));
|
||||
FILE *fd = fopen("/sys/class/dmi/id/board_vendor","r");
|
||||
if(fd)
|
||||
{
|
||||
fgets(vendor,32,fd);
|
||||
fgets(vendor,64,fd);
|
||||
fclose(fd);
|
||||
}
|
||||
return vendor;
|
||||
|
@ -54,4 +54,4 @@ const char *kdk_board_get_vendor()
|
|||
void kdk_board_free(char* info)
|
||||
{
|
||||
free(info);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -365,9 +365,12 @@ static void _get_cpu_info()
|
|||
}
|
||||
fclose(fp);
|
||||
|
||||
if(strstr(cpuinf->model, "Loongson"))
|
||||
if(cpuinf->model)
|
||||
{
|
||||
cpuinf->vendor = strdup("loongson");
|
||||
if(strstr(cpuinf->model, "Loongson"))
|
||||
{
|
||||
cpuinf->vendor = strdup("loongson");
|
||||
}
|
||||
}
|
||||
|
||||
if (cpuinf->flags)
|
||||
|
@ -471,4 +474,4 @@ const char* kdk_cpu_get_virt()
|
|||
unsigned int kdk_cpu_get_process()
|
||||
{
|
||||
GET_VALUE(cpu_process, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#include <netdb.h>
|
||||
#include <ifaddrs.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <glib.h>
|
||||
|
||||
enum cardspec{
|
||||
NCSPEC_ALL,
|
||||
|
@ -42,6 +44,140 @@ enum cardcfg{
|
|||
#define SIOCGIWNAME 0x8B01
|
||||
#define PCIID_PATH "/usr/share/misc/pci.ids"
|
||||
|
||||
static GKeyFile *
|
||||
configure_open_file(const gchar *filename)
|
||||
{
|
||||
GError *err = NULL;
|
||||
GKeyFile *keyfile;
|
||||
keyfile = g_key_file_new();
|
||||
g_key_file_set_list_separator(keyfile, ',');
|
||||
if (!g_key_file_load_from_file(keyfile, filename, G_KEY_FILE_NONE, &err))
|
||||
{
|
||||
g_error_free(err);
|
||||
g_key_file_free(keyfile);
|
||||
return NULL;
|
||||
}
|
||||
return keyfile;
|
||||
}
|
||||
|
||||
static void
|
||||
configure_read_string(GKeyFile *keyfile, GString *ret, gchar *sec, gchar *key, gchar *default_val)
|
||||
{
|
||||
GError *err = NULL;
|
||||
gchar *val = g_key_file_get_string(keyfile,
|
||||
sec,
|
||||
key,
|
||||
&err);
|
||||
if (err)
|
||||
{
|
||||
g_string_assign(ret, default_val);
|
||||
g_error_free(err);
|
||||
return;
|
||||
}
|
||||
g_string_assign(ret, val);
|
||||
g_free(val);
|
||||
}
|
||||
|
||||
static char **
|
||||
get_ip_list(enum cardcfg type,const char *nc)
|
||||
{
|
||||
int count = 0;
|
||||
char curAddr[64] = "\0";
|
||||
char **result = NULL;
|
||||
DIR *dir = NULL;
|
||||
struct dirent *file;
|
||||
char *path = "/etc/NetworkManager/system-connections/";
|
||||
char *value = NULL;
|
||||
if (type == NCCFG_IPv4)
|
||||
{
|
||||
value = "ipv4";
|
||||
if (kdk_nc_get_private_ipv4(nc))
|
||||
strcpy(curAddr, kdk_nc_get_private_ipv4(nc));
|
||||
}
|
||||
else if(type == NCCFG_IPv6)
|
||||
{
|
||||
value = "ipv6";
|
||||
if (kdk_nc_get_private_ipv6(nc))
|
||||
strcpy(curAddr, kdk_nc_get_private_ipv6(nc));
|
||||
}
|
||||
else
|
||||
value = NULL;
|
||||
|
||||
if ((dir = opendir(path)) == NULL)
|
||||
{
|
||||
klog_err("opendir %s failed!", dir);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//网卡当前地址加入返回列表
|
||||
if (curAddr && strcmp(curAddr,""))
|
||||
{
|
||||
result = (char **)calloc(++count + 1, sizeof(char *));
|
||||
if(!result)
|
||||
goto err_out;
|
||||
result[count - 1] = (char *)calloc(strlen(curAddr) + 1, sizeof(char));
|
||||
if(!result[count - 1])
|
||||
goto err_out;
|
||||
strncpy(result[count - 1], curAddr, strlen(curAddr));
|
||||
}
|
||||
|
||||
while (file = readdir(dir))
|
||||
{
|
||||
// 判断是否为文件
|
||||
if (file->d_type != 8)
|
||||
continue;
|
||||
// 为文件加上相对路径
|
||||
char fileName[512] = "\0";
|
||||
strncpy(fileName, path, strlen(path));
|
||||
strcat(fileName, file->d_name);
|
||||
|
||||
GKeyFile *keyFile = configure_open_file(fileName);
|
||||
if (NULL == keyFile)
|
||||
{
|
||||
klog_err("load config file %s failed\n", fileName);
|
||||
continue;
|
||||
}
|
||||
|
||||
GString *val = g_string_new("");
|
||||
configure_read_string(keyFile, val, "connection", "interface-name", "null");
|
||||
|
||||
if (0 == strcmp(val->str, nc))
|
||||
{
|
||||
configure_read_string(keyFile, val, value, "address1", "null");
|
||||
if (0 != strcmp(val->str, "null"))
|
||||
{
|
||||
int i = -1;
|
||||
while(val->str[++i] != 0x2f); // 0x2f是'/'的ascii码值
|
||||
val->str[i] = '\0';
|
||||
if (0 != strcmp(curAddr, val->str))
|
||||
{
|
||||
result = (char **)realloc(result, (++count + 1) * sizeof(char *));
|
||||
if(!result)
|
||||
goto err_out;
|
||||
result[count - 1] = (char *)calloc(i + 1, sizeof(char));
|
||||
if(!result[count - 1])
|
||||
goto err_out;
|
||||
strncpy(result[count - 1], val->str, i);
|
||||
result[count] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
g_string_free(val,TRUE);
|
||||
g_key_file_free(keyFile);
|
||||
}
|
||||
closedir(dir);
|
||||
return result;
|
||||
err_out:
|
||||
while (result && count)
|
||||
{
|
||||
free(result[count - 1]);
|
||||
result[count - 1] = NULL;
|
||||
}
|
||||
free(result);
|
||||
closedir(dir);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static enum cardstat _get_card_stat(const char *nc)
|
||||
{
|
||||
int sfd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
|
@ -170,6 +306,7 @@ char **_get_nc_cfg(const char *nc, enum cardcfg cfg)
|
|||
res[0] = malloc(sizeof(char) * NC_MAC_SIZE);
|
||||
if (!res[0])
|
||||
{
|
||||
free(res);
|
||||
klog_err("内存申请失败:%s\n", strerror(errno));
|
||||
close(sfd);
|
||||
return NULL;
|
||||
|
@ -199,6 +336,7 @@ char **_get_nc_cfg(const char *nc, enum cardcfg cfg)
|
|||
res[0] = malloc(sizeof(char) * NC_IPv4_SIZE);
|
||||
if (!res[0])
|
||||
{
|
||||
free(res);
|
||||
klog_err("内存申请失败:%s\n", strerror(errno));
|
||||
close(sfd);
|
||||
return NULL;
|
||||
|
@ -233,6 +371,7 @@ char **_get_nc_cfg(const char *nc, enum cardcfg cfg)
|
|||
res[0] = malloc(sizeof(char) * INET6_ADDRSTRLEN);
|
||||
if (!res[0])
|
||||
{
|
||||
free(res);
|
||||
klog_err("内存申请失败:%s\n", strerror(errno));
|
||||
close(sfd);
|
||||
freeifaddrs(ifap);
|
||||
|
@ -303,6 +442,13 @@ char* kdk_nc_get_private_ipv4(const char *nc)
|
|||
return ipv4;
|
||||
}
|
||||
|
||||
char **kdk_nc_get_ipv4(const char *nc)
|
||||
{
|
||||
if(!nc)
|
||||
return NULL;
|
||||
return get_ip_list(NCCFG_IPv4, nc);
|
||||
}
|
||||
|
||||
char* kdk_nc_get_private_ipv6(const char *nc)
|
||||
{
|
||||
if (!nc)
|
||||
|
@ -316,17 +462,89 @@ char* kdk_nc_get_private_ipv6(const char *nc)
|
|||
return ipv6;
|
||||
}
|
||||
|
||||
char **kdk_nc_get_ipv6(const char *nc)
|
||||
{
|
||||
if (!nc)
|
||||
return NULL;
|
||||
return get_ip_list(NCCFG_IPv6, nc);
|
||||
}
|
||||
|
||||
int kdk_nc_is_wireless(const char *nc)
|
||||
{
|
||||
if (!nc)
|
||||
return -1;
|
||||
char buffer[2 * IFNAMSIZ + 1];
|
||||
int fd = socket(PF_INET, SOCK_DGRAM, 0);
|
||||
if (fd < 0)
|
||||
int i = 0, ret = -1;
|
||||
char **list = kdk_nc_get_cardlist();
|
||||
if(!list)
|
||||
goto out;
|
||||
while(list[i])
|
||||
{
|
||||
if(0 == strcmp(nc, list[i++]))
|
||||
{
|
||||
char buffer[2 * IFNAMSIZ + 1];
|
||||
int fd = socket(PF_INET, SOCK_DGRAM, 0);
|
||||
if (fd < 0)
|
||||
return -1;
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
strncpy(buffer, nc, sizeof(buffer));
|
||||
ret = ioctl(fd, SIOCGIWNAME, &buffer) == 0 ? 1 : 0;
|
||||
close(fd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
out:
|
||||
kdk_nc_freeall(list);
|
||||
return ret;
|
||||
}
|
||||
|
||||
//根据mac地址获取从hwinfo --usb中获取指定网卡的vendor和device
|
||||
static int __hwinfo_usb(const char * mac,char * vendor, char *product)
|
||||
{
|
||||
FILE * fp = popen("hwinfo --usb","r");
|
||||
if(!fp)
|
||||
return -1;
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
strncpy(buffer, nc, sizeof(buffer));
|
||||
return ioctl(fd, SIOCGIWNAME, &buffer) == 0 ? 1 : 0;
|
||||
char line[1024] = "\0";
|
||||
char ven[256] = "\0";
|
||||
char pro[256] = "\0";
|
||||
int flags = 0;
|
||||
while(fgets(line,1024,fp))
|
||||
{
|
||||
int index = 0;
|
||||
if (flags && (0 < strlen(ven)) && (0 < strlen(pro)))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (strstr(line, "HW Address") && strstr(line, mac))
|
||||
{
|
||||
flags = 1;
|
||||
}
|
||||
|
||||
if(strstr(line, "Vendor:"))
|
||||
{
|
||||
// 返回数据为Vendor: usb 0xxxxx "Linux Foundation",取最后双引号中的内容
|
||||
strcpy(ven, &line[22]);
|
||||
}
|
||||
|
||||
if (strstr(line, "Device:"))
|
||||
{
|
||||
// 返回数据为Device: usb 0xxxxx "2.0 root hub",取最后双引号中的内容
|
||||
strcpy(pro, &line[22]);
|
||||
}
|
||||
|
||||
if(0 < sscanf(line,"%d:%*s",&index))
|
||||
{
|
||||
memset(ven,0,256);
|
||||
memset(pro,0,256);
|
||||
}
|
||||
}
|
||||
if(flags)
|
||||
{
|
||||
strncpy(vendor, ven, strlen(ven) - 2);
|
||||
strncpy(product, pro, strlen(pro) - 2);
|
||||
}
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int kdk_nc_get_vendor_and_product(const char *nc, char *vendor, char *product)
|
||||
|
@ -338,6 +556,27 @@ int kdk_nc_get_vendor_and_product(const char *nc, char *vendor, char *product)
|
|||
if (0 != access(filename, F_OK))
|
||||
return -1; //非物理网卡,可能是逻辑网卡如 lo: 本地环回
|
||||
FILE *fp = NULL;
|
||||
|
||||
|
||||
//usb网卡通过hwinfo获取
|
||||
char ncType[64] = "\0";
|
||||
sprintf(ncType, "%s/%s", filename, "uevent");
|
||||
if(NULL != (fp = fopen(ncType,"r")))
|
||||
{
|
||||
char text[1024] = "\0";
|
||||
if (0 > fread(text, sizeof(char), 1024, fp))
|
||||
{
|
||||
klog_err("open %s failed", ncType);
|
||||
return -1;
|
||||
}
|
||||
if (strstr(text, "usb_interface"))
|
||||
{
|
||||
char *mac = kdk_nc_get_phymac(nc);
|
||||
int ret = __hwinfo_usb(mac,vendor,product);
|
||||
free(mac);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
char vendorId[64] = "0";
|
||||
char productId[64] = "0";
|
||||
strcpy(vendorId, filename);
|
||||
|
@ -355,10 +594,14 @@ int kdk_nc_get_vendor_and_product(const char *nc, char *vendor, char *product)
|
|||
fclose(fp);
|
||||
}
|
||||
|
||||
long u[4]; // 0,1存储网卡的厂家和设备ID,2,3存储pci.ids文件读到的ID
|
||||
memset(u, 0, sizeof(u));
|
||||
sscanf(vendorId, "%lx", &u[0]);
|
||||
long u[4] = {0,1,2,3}; // 0,1存储网卡的厂家和设备ID,2,3存储pci.ids文件读到的ID
|
||||
// memset(u, 0, sizeof(u));
|
||||
int count = sscanf(vendorId, "%lx", &u[0]);
|
||||
if(count < 1)
|
||||
return -1;
|
||||
sscanf(productId, "%lx", &u[1]);
|
||||
if (count < 1)
|
||||
return -1;
|
||||
|
||||
char line[512] = "0";
|
||||
if (NULL != (fp = fopen(PCIID_PATH, "r")))
|
||||
|
@ -392,6 +635,7 @@ int kdk_nc_get_vendor_and_product(const char *nc, char *vendor, char *product)
|
|||
}
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -407,4 +651,4 @@ inline void kdk_nc_freeall(char **list)
|
|||
index ++;
|
||||
}
|
||||
free(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,14 @@ extern char** kdk_nc_get_ipv4(const char* nc);
|
|||
*/
|
||||
extern char* kdk_nc_get_private_ipv6(const char *nc);
|
||||
|
||||
/**
|
||||
* @brief 获取指定网卡的所有IPv6地址
|
||||
*
|
||||
* @param nc 网卡名称,如eno1
|
||||
* @return char** IPv6地址列表,以NULL表示结尾,由alloc生成,需要被kdk_nc_freeall回收;若获取出错,返回NULL;
|
||||
*/
|
||||
extern char **kdk_nc_get_ipv6(const char *nc);
|
||||
|
||||
/**
|
||||
* @brief 获取指定网卡的有线/无线类型
|
||||
*
|
||||
|
@ -90,14 +98,6 @@ extern int kdk_nc_is_wireless(const char *nc);
|
|||
*/
|
||||
extern int kdk_nc_get_vendor_and_product(const char *nc, char *vendor, char *product);
|
||||
|
||||
/**
|
||||
* @brief 获取指定网卡的所有IPv6地址
|
||||
*
|
||||
* @param nc 网卡名称,如eno1
|
||||
* @return char** IPv6地址列表,以NULL表示结尾,由alloc生成,需要被kdk_nc_freeall回收;若获取出错,返回NULL;
|
||||
*/
|
||||
extern char** kdk_nc_get_ipv6(const char *nc);
|
||||
|
||||
/**
|
||||
* @brief 用于回收字符串列表
|
||||
*
|
||||
|
@ -112,4 +112,4 @@ extern inline void kdk_nc_freeall(char **ptr);
|
|||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <curl/curl.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define _IPP_PRIVATE_STRUCTURES 1
|
||||
|
||||
|
@ -127,7 +128,7 @@ void kdk_printer_set_options(int number_up,
|
|||
num_options = cupsAddOption("sides", sides, num_options, &cups_options);
|
||||
}
|
||||
|
||||
int kdk_printer_print_local_file(const char *printername, char *filepath)
|
||||
int kdk_printer_print_local_file(const char *printername, const char *filepath)
|
||||
{
|
||||
printf("[%s] Start\n", __FUNCTION__);
|
||||
printf("[%s] printer_name: %s, file_path: %s\n", __FUNCTION__,
|
||||
|
@ -151,7 +152,7 @@ int kdk_printer_cancel_all_jobs(const char *printername)
|
|||
int ret = cupsCancelJob(printername, CUPS_JOBID_ALL); // 1=success 0=fail
|
||||
if (ret == 0)
|
||||
{
|
||||
printf(LOG_ERR, "%s ,job_id = CUPS_JOBID_ALL, find err = %s ", __FUNCTION__, cupsLastErrorString());
|
||||
printf("%s ,job_id = CUPS_JOBID_ALL, find err = %s ", __FUNCTION__, cupsLastErrorString());
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -381,9 +382,11 @@ size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream)
|
|||
return written;
|
||||
}
|
||||
//获取url内的文件名
|
||||
void kdk_printer_get_filename(const char *url, char *filename)
|
||||
char* kdk_printer_get_filename(const char *url)
|
||||
{
|
||||
printf("[%s] Start\n", __FUNCTION__);
|
||||
char *filename = malloc(strlen(url) + 1);
|
||||
memset(filename, 0, sizeof(url));
|
||||
int len = strlen(url);
|
||||
int i;
|
||||
for (i = (len - 1); i >= 0; i--)
|
||||
|
@ -394,10 +397,10 @@ void kdk_printer_get_filename(const char *url, char *filename)
|
|||
}
|
||||
}
|
||||
strcpy(filename, &url[i + 1]);
|
||||
return;
|
||||
return filename;
|
||||
}
|
||||
//检查url是否存在
|
||||
bool check_url(char *url)
|
||||
int check_url(char *url)
|
||||
{
|
||||
printf("[%s] Start\n", __FUNCTION__);
|
||||
// 获得一个CURL会话,进行网络操作
|
||||
|
@ -423,11 +426,11 @@ bool check_url(char *url)
|
|||
// 根据代码判断网址是否有效
|
||||
int retcode = 0;
|
||||
curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &retcode);
|
||||
bool res = false;
|
||||
int res = URL_UNAVAILABLE;
|
||||
// 如果HTTP反应代码为200,表示网址有效
|
||||
if (200 == retcode)
|
||||
{
|
||||
res = true;
|
||||
res = 0;
|
||||
}
|
||||
// 执行会话的清理工作
|
||||
curl_easy_cleanup(handle);
|
||||
|
@ -436,22 +439,36 @@ bool check_url(char *url)
|
|||
}
|
||||
else // 无法验证
|
||||
{
|
||||
return false;
|
||||
return CAN_NOT_CHECK_URL;
|
||||
}
|
||||
}
|
||||
//下载url到文件
|
||||
// 下载url到文件
|
||||
int download_file(char *url, const char *savefile)
|
||||
{
|
||||
printf("[%s] Start\n", __FUNCTION__);
|
||||
CURL *curl;
|
||||
FILE *fp;
|
||||
FILE *fp = NULL;
|
||||
CURLcode res;
|
||||
printf("[%s] url = %s \n", __FUNCTION__, url);
|
||||
printf("[%s] savefile = %s \n", __FUNCTION__, savefile);
|
||||
//检查保存路径是否可用
|
||||
fp = fopen(savefile, "wb");
|
||||
printf("[%s] fp = %d \n", __FUNCTION__, fp);
|
||||
if (!fp)
|
||||
{
|
||||
switch (errno)
|
||||
{
|
||||
case EACCES: // you don't have permission
|
||||
return PATH_NO_PERMISSION;
|
||||
case ENOENT: // the file doesn't exists
|
||||
return PATH_NOT_EXIST;
|
||||
default:
|
||||
return PATH_ERROR;
|
||||
}
|
||||
}
|
||||
curl = curl_easy_init();
|
||||
if (curl)
|
||||
{
|
||||
fp = fopen(savefile, "wb");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
|
||||
|
@ -462,8 +479,8 @@ int download_file(char *url, const char *savefile)
|
|||
res = curl_easy_perform(curl);
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
fclose(fp);
|
||||
}
|
||||
fclose(fp);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -472,17 +489,19 @@ int kdk_printer_print_download_remote_file(const char *url, const char *filepath
|
|||
printf("[%s] Start\n", __FUNCTION__);
|
||||
int res = -1;
|
||||
|
||||
bool available = check_url(url);
|
||||
if (available)
|
||||
int available = check_url(url);
|
||||
if (available == 0)
|
||||
{
|
||||
res = download_file(url, filepath);
|
||||
printf("res = %d.\n", res);
|
||||
return res;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%s seems to be unavailable.\n", url);
|
||||
return available;
|
||||
}
|
||||
printf("res = %d.\n", res);
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
int kdk_printer_get_job_status(const char *printername, int jobid)
|
||||
|
@ -492,8 +511,9 @@ int kdk_printer_get_job_status(const char *printername, int jobid)
|
|||
int i;
|
||||
int number_jobs;
|
||||
int ret;
|
||||
|
||||
number_jobs = cupsGetJobs(&jobs, printername, 1, CUPS_WHICHJOBS_ALL);
|
||||
// cupsGetJobs函数的第三个参数应该是0而不是1
|
||||
// 因为1表示只获取正在进行中的任务,而0表示获取所有任务,包括已完成的和已停止的
|
||||
number_jobs = cupsGetJobs(&jobs, printername, 0, CUPS_WHICHJOBS_ALL);
|
||||
ipp_jstate_t state = 0;
|
||||
|
||||
for (i = 0; i < number_jobs; i++)
|
||||
|
@ -508,4 +528,5 @@ int kdk_printer_get_job_status(const char *printername, int jobid)
|
|||
cupsFreeJobs(number_jobs, jobs);
|
||||
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef KDK_SYSTEM_HW_NWCARD_H__
|
||||
#define KDK_SYSTEM_HW_NWCARD_H__
|
||||
#ifndef LIBKYPRINTER_H
|
||||
#define LIBKYPRINTER_H
|
||||
//打印机状态
|
||||
#define CUPS_PRINTER_STATE_BUSY 6 //"Busy"
|
||||
#define CUPS_PRINTER_STATE_STOPPED 4 //"Stop"
|
||||
|
@ -15,6 +15,13 @@
|
|||
#define IPP_JOB_ABORTED 8 //由于错误跳过该打印任务
|
||||
#define IPP_JOB_COMPLETED 9 //正常完成
|
||||
|
||||
//下载远程相关状态
|
||||
#define URL_UNAVAILABLE -5
|
||||
#define CAN_NOT_CHECK_URL -6
|
||||
#define PATH_NOT_EXIST -7
|
||||
#define PATH_NO_PERMISSION -8
|
||||
#define PATH_ERROR -9
|
||||
|
||||
//下载状态
|
||||
// typedef enum {
|
||||
// CURLE_OK = 0,
|
||||
|
@ -207,7 +214,7 @@ extern int kdk_printer_print_download_remote_file(const char *url, const char *f
|
|||
* 然后把a.log改名叫a.pdf,这个时候a.pdf就变成了格式不对的文件,打印不出来了
|
||||
*
|
||||
*/
|
||||
extern int kdk_printer_print_local_file(const char *printername, char *filepath);
|
||||
extern int kdk_printer_print_local_file(const char *printername, const char *filepath);
|
||||
|
||||
/**
|
||||
* @brief 清除某个打印机的所有打印队列
|
||||
|
@ -241,12 +248,11 @@ extern int kdk_printer_get_job_status(const char *printername, int jobid);
|
|||
/**
|
||||
* @brief 获取url内的文件名
|
||||
*
|
||||
* @param url
|
||||
* @param filename 解析出来的文件名
|
||||
* @param url
|
||||
*
|
||||
* @return 无
|
||||
* @return 解析出来的函数名
|
||||
*/
|
||||
extern void kdk_printer_get_filename(const char *url, char *filename);
|
||||
extern char* kdk_printer_get_filename(const char *url);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -255,4 +261,4 @@ extern void kdk_printer_get_filename(const char *url, char *filename);
|
|||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <libudev.h>
|
||||
#include "libkylog.h"
|
||||
|
||||
/// @brief
|
||||
/// @return usb device info
|
||||
|
@ -20,7 +21,7 @@ pDriverInfoList kdk_usb_get_list()
|
|||
udev = udev_new();
|
||||
if (!udev)
|
||||
{
|
||||
printf("Can't create udev");
|
||||
klog_err("Can't create udev");
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@ -83,15 +84,15 @@ pDriverInfoList kdk_usb_get_list()
|
|||
//申请节点内存
|
||||
if(NULL == list)
|
||||
{
|
||||
list = (pDriverInfoList)calloc(1, sizeof(DriverInfoList));
|
||||
curnode = list;
|
||||
curnode = (pDriverInfoList)calloc(1, sizeof(DriverInfoList));
|
||||
list = curnode;
|
||||
}
|
||||
else
|
||||
curnode = (pDriverInfoList)calloc(1, sizeof(DriverInfoList));
|
||||
|
||||
if (NULL == curnode)
|
||||
{
|
||||
printf("Request Memory For List Failed");
|
||||
klog_err("Request Memory For List Failed");
|
||||
kdk_usb_free(list);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -99,18 +100,18 @@ pDriverInfoList kdk_usb_get_list()
|
|||
curnode->data = (pDriverInfo)calloc(1, sizeof(DriverInfo));
|
||||
if (NULL == curnode->data)
|
||||
{
|
||||
printf("Request Memory For Data Failed");
|
||||
klog_err("Request Memory For Data Failed");
|
||||
kdk_usb_free(list);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sprintf(curnode->data->name, "%s", udev_device_get_sysattr_value(dev, "product"));
|
||||
sprintf(curnode->data->type, "%s", udev_device_get_sysattr_value(interface, "bInterfaceClass"));
|
||||
sprintf(curnode->data->pid, "%s", udev_device_get_sysattr_value(dev, "idProduct"));
|
||||
sprintf(curnode->data->vid, "%s", udev_device_get_sysattr_value(dev, "idVendor"));
|
||||
sprintf(curnode->data->serialNo, "%s", udev_device_get_sysattr_value(dev, "serial"));
|
||||
sprintf(curnode->data->name, "%s", udev_device_get_sysattr_value(dev, "product") ? udev_device_get_sysattr_value(dev, "product"): "null");
|
||||
sprintf(curnode->data->type, "%s", udev_device_get_sysattr_value(interface, "bInterfaceClass") ? udev_device_get_sysattr_value(interface, "bInterfaceClass") : "null");
|
||||
sprintf(curnode->data->pid, "%s", udev_device_get_sysattr_value(dev, "idProduct") ? udev_device_get_sysattr_value(dev, "idProduct") : "null");
|
||||
sprintf(curnode->data->vid, "%s", udev_device_get_sysattr_value(dev, "idVendor") ? udev_device_get_sysattr_value(dev, "idVendor") : "null");
|
||||
sprintf(curnode->data->serialNo, "%s", udev_device_get_sysattr_value(dev, "serial") ? udev_device_get_sysattr_value(dev, "serial") : "null");
|
||||
sprintf(curnode->data->devNode ,"%s", udev_device_get_devnode(dev));
|
||||
// sprintf(curnode->data->vendor, "%s", udev_device_get_sysattr_value(dev, "manufacturer"));
|
||||
// sprintf(curnode->data->vendor, "%s", udev_device_get_sysattr_value(dev, "manufacturer"));
|
||||
|
||||
if (NULL != prevnode)
|
||||
prevnode->next = curnode;
|
||||
|
@ -136,4 +137,4 @@ void kdk_usb_free(pDriverInfoList list)
|
|||
free(tmp->data);
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,11 @@
|
|||
#include "../libkybios.h"
|
||||
int main()
|
||||
{
|
||||
printf("vendor: %s",kdk_bios_get_vendor());
|
||||
printf("version: %s",kdk_bios_get_version());
|
||||
char *vendor = kdk_bios_get_vendor();
|
||||
char *version = kdk_bios_get_version();
|
||||
printf("vendor: %s", vendor);
|
||||
printf("version: %s",version);
|
||||
free(vendor);
|
||||
free(version);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,9 +3,18 @@
|
|||
|
||||
int main()
|
||||
{
|
||||
printf("name : %s", kdk_board_get_name());
|
||||
printf("vendor : %s", kdk_board_get_vendor());
|
||||
printf("date : %s", kdk_board_get_date());
|
||||
printf("serial : %s", kdk_board_get_serial());
|
||||
|
||||
char *name = kdk_board_get_name();
|
||||
char *vendor = kdk_board_get_vendor();
|
||||
char *date = kdk_board_get_date();
|
||||
char *serial = kdk_board_get_serial();
|
||||
printf("name : %s", name);
|
||||
printf("vendor : %s", vendor);
|
||||
printf("date : %s", date);
|
||||
printf("serial : %s", serial);
|
||||
free(name);
|
||||
free(vendor);
|
||||
free(date);
|
||||
free(serial);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,11 +12,35 @@ int main()
|
|||
char *mac = kdk_nc_get_phymac(cards[index]);
|
||||
char *ipv4 = kdk_nc_get_private_ipv4(cards[index]);
|
||||
char *ipv6 = kdk_nc_get_private_ipv6(cards[index]);
|
||||
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\n", index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down", mac, ipv4,ipv6);
|
||||
char vendor[256] = "\0", product[256] = "\0";
|
||||
kdk_nc_get_vendor_and_product(cards[index], vendor, product);
|
||||
printf("Card %zd: %s\tStatus: %s\tMac: %s\tIPv4: %s\tIPv6: %s\t Vendor: %s\t Product: %s\t Type: %s\n",
|
||||
index + 1, cards[index], kdk_nc_is_up(cards[index]) == 1 ? "Up" : "Down",
|
||||
mac, ipv4, ipv6, vendor, product,
|
||||
kdk_nc_is_wireless(cards[index]) ? "wireless" : "ethernet");
|
||||
|
||||
char **list4 = kdk_nc_get_ipv4(cards[index]);
|
||||
int i = 0;
|
||||
printf("AllIpV4: ");
|
||||
while (list4 && list4[i])
|
||||
{
|
||||
printf("%s\t", list4[i++]);
|
||||
}
|
||||
printf("\n");
|
||||
char **list6 = kdk_nc_get_ipv6(cards[index]);
|
||||
printf("AllIpV6: ");
|
||||
i = 0;
|
||||
while (list6 && list6[i])
|
||||
{
|
||||
printf("%s\t", list6[i++]);
|
||||
}
|
||||
printf("\n");
|
||||
free(mac);
|
||||
free(ipv4);
|
||||
free(ipv6);
|
||||
index ++;
|
||||
free(list4);
|
||||
free(list6);
|
||||
index++;
|
||||
}
|
||||
kdk_nc_freeall(cards);
|
||||
char **upcards = kdk_nc_get_upcards();
|
||||
|
@ -25,8 +49,8 @@ int main()
|
|||
while (upcards[index])
|
||||
{
|
||||
printf("Card %zd: %s\n", index + 1, upcards[index]);
|
||||
index ++;
|
||||
index++;
|
||||
}
|
||||
kdk_nc_freeall(upcards);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ int main()
|
|||
kdk_nc_freeall(printers);
|
||||
//获取可用打印机列表
|
||||
index = 0;
|
||||
char **available_printers = kdk_printer_get_list();
|
||||
char **available_printers = kdk_printer_get_available_list();
|
||||
while (available_printers[index])
|
||||
{
|
||||
int status = kdk_printer_get_status(available_printers[index]);
|
||||
|
@ -26,4 +26,4 @@ int main()
|
|||
kdk_nc_freeall(available_printers);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,9 +17,7 @@ int main()
|
|||
//获取url对应的文件名
|
||||
char *url = "http://www.cztouch.com/upfiles/soft/testpdf.pdf";
|
||||
int res = -1;
|
||||
char *filename = (char *)malloc(sizeof(url)); //申请一个缓冲区,存放接收到的文件内容
|
||||
memset(filename, 0, sizeof(url));
|
||||
kdk_printer_get_filename(url, filename); //从完整路径名中解析出文件名称,例如:/home/test/abc.txt,解析完成后为abc.txt
|
||||
char *filename = kdk_printer_get_filename(url); //从完整路径名中解析出文件名称,例如:/home/test/abc.txt,解析完成后为abc.txt
|
||||
printf("filename = %s\n", filename);
|
||||
|
||||
//设置打印参数
|
||||
|
@ -45,7 +43,8 @@ int main()
|
|||
}
|
||||
|
||||
index++;
|
||||
free(filename);
|
||||
}
|
||||
kdk_nc_freeall(printers);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
*.sql linguist-language=java
|
|
@ -0,0 +1,46 @@
|
|||
######################################################################
|
||||
# Build Tools
|
||||
|
||||
.gradle
|
||||
/build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
######################################################################
|
||||
# IDE
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
build/*
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
|
||||
######################################################################
|
||||
# Others
|
||||
*.log
|
||||
*.xml.versionsBackup
|
||||
*.swp
|
||||
|
||||
!*/build/*.java
|
||||
!*/build/*.html
|
||||
!*/build/*.xml
|
||||
|
||||
### JRebel ###
|
||||
rebel.xml
|
|
@ -0,0 +1,80 @@
|
|||
### 目录结构
|
||||
```shell
|
||||
.
|
||||
├── event-listener
|
||||
│ ├── pom.xml
|
||||
│ ├── src
|
||||
│ │ ├── main
|
||||
│ │ │ ├── java
|
||||
│ │ │ │ ├── cn
|
||||
│ │ │ │ │ └── kylin
|
||||
│ │ │ │ │ └── dbus
|
||||
│ │ │ │ │ ├── client
|
||||
│ │ │ │ │ │ └── DBusClient.java dbus连接器
|
||||
│ │ │ │ │ ├── enums
|
||||
│ │ │ │ │ │ └── EventTypeEnum.java 事件枚举
|
||||
│ │ │ │ │ ├── event
|
||||
│ │ │ │ │ │ ├── PresenceEvent.java
|
||||
│ │ │ │ │ │ ├── ScreenSaverEvent.java
|
||||
│ │ │ │ │ │ ├── UserNameEvent.java
|
||||
│ │ │ │ │ │ └── UserSessionEvent.java
|
||||
│ │ │ │ │ └── listener
|
||||
│ │ │ │ │ ├── DBusListener.java 监听器
|
||||
│ │ │ │ │ ├── DBusListenerSupport.java 监听器扩展
|
||||
│ │ │ │ │ ├── EventResult.java 监听器返回值
|
||||
│ │ │ │ │ ├── PresnceStatusChangedListener.java 键盘监听器
|
||||
│ │ │ │ │ ├── ScreenSaverLockListener.java 锁屏监听器
|
||||
│ │ │ │ │ ├── ScreenSaverUnLockListener.java 解屏监听器
|
||||
│ │ │ │ │ ├── UserSessionNewListener.java 登录监听器
|
||||
│ │ │ │ │ └── UserSessionRemoveListener.java 注销监听器
|
||||
│ │ │ │ ├── com
|
||||
│ │ │ │ │ └── kylin
|
||||
│ │ │ │ │ └── SessionManager
|
||||
│ │ │ │ │ └── User.java
|
||||
│ │ │ │ └── org
|
||||
│ │ │ │ ├── freedesktop
|
||||
│ │ │ │ │ └── login1
|
||||
│ │ │ │ │ └── Manager.java
|
||||
│ │ │ │ ├── gnome
|
||||
│ │ │ │ │ └── SessionManager
|
||||
│ │ │ │ │ └── Presence.java
|
||||
│ │ │ │ └── ukui
|
||||
│ │ │ │ └── ScreenSaver.java
|
||||
│ │ │ └── resources
|
||||
│ └── test
|
||||
│ └── java
|
||||
│ └── cn
|
||||
│ └── kylin
|
||||
│ └── dbus
|
||||
│ └── EventTest.java
|
||||
│ └── target
|
||||
├── package
|
||||
│ ├── build.sh
|
||||
│ └── settings.xml
|
||||
├── pom.xml
|
||||
└── README.md
|
||||
|
||||
```
|
||||
|
||||
|
||||
### 编译
|
||||
```shell
|
||||
cd package
|
||||
./build.sh
|
||||
```
|
||||
|
||||
### 使用
|
||||
```java
|
||||
//执行dubus操作
|
||||
new PresenceEvent().StatusChanged();
|
||||
new ScreenSaverEvent().Lock();
|
||||
new UserSessionEvent().SessionNew();
|
||||
//监听事件
|
||||
DBusListenerSupport listenerSupport = new DBusListenerSupport();
|
||||
EventResult lock= listenerSupport.triggerEvent(EventTypeEnum.LOCK);
|
||||
EventResult unlock= listenerSupport.triggerEvent(EventTypeEnum.UNLOCK);
|
||||
EventResult changed= listenerSupport.triggerEvent(EventTypeEnum.KEY_STATUS_CHANGED);
|
||||
```
|
||||
|
||||
### 注意事项
|
||||
> 所有继承DBusInterface的接口实现,必须跟dbus的路径和方法名一致,大小写强校验
|
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>kylin.kysdk.java</groupId>
|
||||
<artifactId>kysdk-java-ext</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>dbus</groupId>
|
||||
<artifactId>kysdk-java</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>6</source>
|
||||
<target>6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.github.hypfvieh</groupId>
|
||||
<artifactId>dbus-java</artifactId>
|
||||
<version>3.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.hypfvieh</groupId>
|
||||
<artifactId>libmatthew</artifactId>
|
||||
<version>0.8.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.jnr</groupId>
|
||||
<artifactId>jffi</artifactId>
|
||||
<version>1.3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<version>1.7.36</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.24</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>5.9.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,9 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
import java.util.List;
|
||||
|
||||
public interface bios extends DBusInterface {
|
||||
public String getBiosVendor();
|
||||
public String getBiosVersion();
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
import org.freedesktop.dbus.types.UInt32;
|
||||
|
||||
public interface cpuinfo extends DBusInterface {
|
||||
public String getCpuArch();
|
||||
|
||||
public String getCpuVendor();
|
||||
|
||||
public String getCpuModel();
|
||||
|
||||
public String getCpuFreqMHz();
|
||||
|
||||
public UInt32 getCpuCorenums();
|
||||
|
||||
public String getCpuVirt();
|
||||
|
||||
public UInt32 getCpuProcess();
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
import org.freedesktop.dbus.types.UInt32;
|
||||
import org.freedesktop.dbus.types.UInt64;
|
||||
import java.util.List;
|
||||
|
||||
public interface disk extends DBusInterface {
|
||||
public List<String> getDiskList();
|
||||
public UInt32 getDiskSectorSize(String name);
|
||||
public float getDiskTotalSizeMiB(String name);
|
||||
public String getDiskModel(String name);
|
||||
public String getDiskSerial(String name);
|
||||
public UInt32 getDiskPartitionNums(String name);
|
||||
public String getDiskType(String name);
|
||||
public String getDiskVersion(String name);
|
||||
public UInt64 getDiskSectorNum(String name);
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
|
||||
public interface gps extends DBusInterface {
|
||||
public String getGPSInfo();
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
|
||||
public interface mainboard extends DBusInterface{
|
||||
|
||||
//输出:主板型号
|
||||
public String getMainboardName();
|
||||
//输出:发布日期
|
||||
public String getMainboardDate();
|
||||
//输出:主板序列号
|
||||
public String getMainboardSerial();
|
||||
//输出:主板厂商
|
||||
public String getMainboardVendor();
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import java.util.List;
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
|
||||
public interface net extends DBusInterface {
|
||||
public int getPortState(int port);
|
||||
public List<String> getMultiplePortStat(int begin,int end);
|
||||
public List<String> getGatewayInfo();
|
||||
public List<String> getFirewallState();
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import java.util.List;
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
|
||||
public interface netcard extends DBusInterface {
|
||||
|
||||
public List<String> getNetCardName();
|
||||
public int getNetCardUp(String nc);
|
||||
public List<String> getNetCardUpcards();
|
||||
public String getNetCardPhymac(String nc);
|
||||
public String getNetCardPrivateIPv4(String nc);
|
||||
public List<String> getNetCardIPv4(String nc);
|
||||
public String getNetCardPrivateIPv6(String nc);
|
||||
public int getNetCardType(String nc);
|
||||
public List<String> getNetCardProduct(String nc);
|
||||
public List<String> getNetCardIPv6(String nc);
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
import java.util.List;
|
||||
|
||||
public interface packageinfo extends DBusInterface {
|
||||
public List<String> getPackageList();
|
||||
|
||||
public String getPackageVersion(String name);
|
||||
|
||||
public int getPackageInstalled(String name,String version);
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
import java.util.List;
|
||||
|
||||
public interface peripheralsenum extends DBusInterface {
|
||||
public List<String> getAllUsbInfo();
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
import java.util.List;
|
||||
|
||||
public interface print extends DBusInterface {
|
||||
public List<String> getPrinterList();
|
||||
|
||||
public List<String> getPrinterAvailableList();
|
||||
|
||||
public void setPrinterOptions(int page,String paperType,String cups,String sided);
|
||||
|
||||
public int getPrinterPrintLocalFile(String printer,String file);
|
||||
|
||||
public int getPrinterCancelAllJobs(String printer);
|
||||
|
||||
public int getPrinterStatus(String printer);
|
||||
|
||||
public String getPrinterFilename(String url);
|
||||
|
||||
public int getPrinterJobStatus(String job, int id);
|
||||
|
||||
public int getPrinterDownloadRemoteFile(String remoteFile,String localFile);
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import java.util.List;
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
|
||||
public interface process extends DBusInterface {
|
||||
//输入:进程号
|
||||
//输出:CPU瞬时使用率
|
||||
public double getProcInfoCpuUsage(int proc);
|
||||
//输入:进程号
|
||||
//输出:IO使用率
|
||||
public double getProcInfoIoUsage(int proc);
|
||||
//输入:进程号
|
||||
//输出:内存占用率
|
||||
public double getProcInfoMemUsage(int proc);
|
||||
//输入:进程号
|
||||
//输出:进程状态
|
||||
public String getProcInfoStatus(int proc);
|
||||
//输入:进程号
|
||||
//输出:进程使用的端口号
|
||||
public int getProcInfoPort(int proc);
|
||||
//输入:进程号
|
||||
//输出:进程的启动时间
|
||||
public String getProcInfoStartTime(int proc);
|
||||
//输入:进程号
|
||||
//输出:进程的运行时间
|
||||
public String getProcInfoRunningTime(int proc);
|
||||
//输入:进程号
|
||||
//输出:CPU时间
|
||||
public String getProcInfoCpuTime(int proc);
|
||||
//输入:进程号
|
||||
//输出:cmd
|
||||
public String getProcInfoCmd(int proc);
|
||||
//输入:进程号
|
||||
//输出:属主
|
||||
public String getProcInfoUser(int proc);
|
||||
//输入:进程名
|
||||
//输出:某进程所有信息
|
||||
public List<String> getProcInfo(String proc);
|
||||
public List<String> getAllProcInfo();
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
import java.util.List;
|
||||
|
||||
public interface resolution extends DBusInterface{
|
||||
public List<String> getSysLegalResolution();
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
|
||||
public interface resource extends DBusInterface {
|
||||
public double getMemTotalKiB();
|
||||
|
||||
public double getMemUsagePercent();
|
||||
|
||||
public double getMemUsageKiB();
|
||||
|
||||
public double getMemAvailableKiB();
|
||||
|
||||
public double getMemFreeKiB();
|
||||
|
||||
public double getMemVirtAllocKiB();
|
||||
|
||||
public double getMemSwapTotalKiB();
|
||||
|
||||
public double getMemSwapUsagePercent();
|
||||
|
||||
public double getMemSwapUsageKiB();
|
||||
|
||||
public double getMemSwapFreeKiB();
|
||||
|
||||
public double getCpuCurrentUsage();
|
||||
|
||||
public String getUpTime();
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
|
||||
public interface runinfo extends DBusInterface {
|
||||
public double getNetSpeed(String nc);
|
||||
public int getDiskRate(String disk);
|
||||
public double getCpuTemperature();
|
||||
public double getDiskTemperature(String name);
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.kylin.kysdk;
|
||||
|
||||
import org.freedesktop.dbus.interfaces.DBusInterface;
|
||||
import org.freedesktop.dbus.types.UInt32;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface sysinfo extends DBusInterface {
|
||||
|
||||
public String getSystemArchitecture();
|
||||
|
||||
public String getSystemName();
|
||||
|
||||
public String getSystemVersion(boolean verbose);
|
||||
|
||||
public int getSystemActivationStatus();
|
||||
|
||||
public String getSystemSerialNumber();
|
||||
|
||||
public String getSystemKernelVersion();
|
||||
|
||||
public String getSystemEffectUser();
|
||||
|
||||
public String getSystemProjectName();
|
||||
|
||||
public String getSystemProjectSubName();
|
||||
|
||||
public UInt32 getSystemProductFeatures();
|
||||
|
||||
public String getSystemHostVirtType();
|
||||
|
||||
public String getSystemHostCloudPlatform();
|
||||
|
||||
public String getSystemOSVersion();
|
||||
|
||||
public String getSystemUpdateVersion();
|
||||
|
||||
public boolean getSystemIsZYJ();
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package kylin.kysdk.java.client;
|
||||
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
|
||||
/***
|
||||
* dbus连接器
|
||||
* @author lihao3
|
||||
*/
|
||||
public class DBusClient {
|
||||
public static DBusConnection getConn(DBusConnection.DBusBusType dBusBusType) throws DBusException {
|
||||
DBusConnection conn = DBusConnection.getConnection(dBusBusType);
|
||||
return conn;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package kylin.kysdk.java.method;
|
||||
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import com.kylin.kysdk.bios;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class BiosMethod implements bios {
|
||||
|
||||
@Override
|
||||
public String getBiosVendor(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
bios obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/bios", bios.class);
|
||||
return obj.getBiosVendor();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBiosVersion(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
bios obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/bios", bios.class);
|
||||
return obj.getBiosVersion();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
package kylin.kysdk.java.method;
|
||||
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
import org.freedesktop.dbus.types.UInt32;
|
||||
import com.kylin.kysdk.cpuinfo;
|
||||
|
||||
@Slf4j
|
||||
public class CpuMethod implements cpuinfo{
|
||||
@Override
|
||||
public String getCpuArch(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
cpuinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/cpuinfo", cpuinfo.class);
|
||||
return obj.getCpuArch();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getCpuVendor(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
cpuinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/cpuinfo", cpuinfo.class);
|
||||
return obj.getCpuVendor();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getCpuModel(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
cpuinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/cpuinfo", cpuinfo.class);
|
||||
return obj.getCpuModel();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getCpuFreqMHz(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
cpuinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/cpuinfo", cpuinfo.class);
|
||||
return obj.getCpuFreqMHz();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public UInt32 getCpuCorenums(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
cpuinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/cpuinfo", cpuinfo.class);
|
||||
return obj.getCpuCorenums();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getCpuVirt(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
cpuinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/cpuinfo", cpuinfo.class);
|
||||
return obj.getCpuVirt();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public UInt32 getCpuProcess(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
cpuinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/cpuinfo", cpuinfo.class);
|
||||
return obj.getCpuProcess();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,153 @@
|
|||
package kylin.kysdk.java.method;
|
||||
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import com.kylin.kysdk.disk;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
import org.freedesktop.dbus.types.UInt32;
|
||||
import org.freedesktop.dbus.types.UInt64;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class DiskMethod implements disk {
|
||||
@Override
|
||||
public List<String> getDiskList() {
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
disk obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/disk", disk.class);
|
||||
return obj.getDiskList();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public UInt32 getDiskSectorSize(String name) {
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
disk obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/disk", disk.class);
|
||||
return obj.getDiskSectorSize(name);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return new UInt32(0);
|
||||
}
|
||||
@Override
|
||||
public float getDiskTotalSizeMiB(String name){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
disk obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/disk", disk.class);
|
||||
return obj.getDiskTotalSizeMiB(name);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@Override
|
||||
public String getDiskModel(String name){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
disk obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/disk", disk.class);
|
||||
return obj.getDiskModel(name);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getDiskSerial(String name){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
disk obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/disk", disk.class);
|
||||
return obj.getDiskSerial(name);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public UInt32 getDiskPartitionNums(String name){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
disk obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/disk", disk.class);
|
||||
return obj.getDiskPartitionNums(name);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return new UInt32(0);
|
||||
}
|
||||
@Override
|
||||
public String getDiskType(String name){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
disk obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/disk", disk.class);
|
||||
return obj.getDiskType(name);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDiskVersion(String name){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
disk obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/disk", disk.class);
|
||||
return obj.getDiskVersion(name);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UInt64 getDiskSectorNum(String name){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
disk obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/disk", disk.class);
|
||||
return obj.getDiskSectorNum(name);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return new UInt64(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package kylin.kysdk.java.method;
|
||||
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import com.kylin.kysdk.gps;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class GpsMethod implements gps {
|
||||
|
||||
@Override
|
||||
public String getGPSInfo(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
gps obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/gps", gps.class);
|
||||
return obj.getGPSInfo();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
package kylin.kysdk.java.method;
|
||||
import com.kylin.kysdk.mainboard;
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
import lombok.extern.slf4j.Slf4j;;
|
||||
|
||||
@Slf4j
|
||||
public class MainBoardMethod implements mainboard {
|
||||
|
||||
@Override
|
||||
public String getMainboardName(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
mainboard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/mainboard", mainboard.class);
|
||||
return obj.getMainboardName();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMainboardDate(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
mainboard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/mainboard", mainboard.class);
|
||||
return obj.getMainboardDate();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMainboardSerial(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
mainboard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/mainboard", mainboard.class);
|
||||
return obj.getMainboardSerial();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMainboardVendor(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
mainboard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/mainboard", mainboard.class);
|
||||
return obj.getMainboardVendor();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,166 @@
|
|||
package kylin.kysdk.java.method;
|
||||
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import com.kylin.kysdk.netcard;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class NetCardMethod implements netcard {
|
||||
|
||||
@Override
|
||||
public List<String> getNetCardName(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
netcard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/netcard", netcard.class);
|
||||
return obj.getNetCardName();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public int getNetCardUp(String nc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
netcard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/netcard", netcard.class);
|
||||
return obj.getNetCardUp(nc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public List<String> getNetCardUpcards(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
netcard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/netcard", netcard.class);
|
||||
return obj.getNetCardUpcards();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getNetCardPhymac(String nc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
netcard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/netcard", netcard.class);
|
||||
return obj.getNetCardPhymac(nc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getNetCardPrivateIPv4(String nc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
netcard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/netcard", netcard.class);
|
||||
return obj.getNetCardPrivateIPv4(nc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public List<String> getNetCardIPv4(String nc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
netcard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/netcard", netcard.class);
|
||||
return obj.getNetCardIPv4(nc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getNetCardPrivateIPv6(String nc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
netcard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/netcard", netcard.class);
|
||||
return obj.getNetCardPrivateIPv6(nc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public List<String> getNetCardIPv6(String nc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
netcard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/netcard", netcard.class);
|
||||
return obj.getNetCardIPv6(nc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNetCardType(String nc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
netcard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/netcard", netcard.class);
|
||||
return obj.getNetCardType(nc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNetCardProduct(String nc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
netcard obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/netcard", netcard.class);
|
||||
return obj.getNetCardProduct(nc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
package kylin.kysdk.java.method;
|
||||
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import com.kylin.kysdk.net;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class NetMethod implements net {
|
||||
|
||||
@Override
|
||||
public int getPortState(int port){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
net obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/net", net.class);
|
||||
return obj.getPortState(port);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@Override
|
||||
public List<String> getMultiplePortStat(int begin,int end){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
net obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/net", net.class);
|
||||
return obj.getMultiplePortStat(begin,end);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getGatewayInfo(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
net obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/net", net.class);
|
||||
return obj.getGatewayInfo();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public List<String> getFirewallState(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
net obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/net", net.class);
|
||||
return obj.getFirewallState();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package kylin.kysdk.java.method;
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import com.kylin.kysdk.packageinfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class PackageInfoMethod implements packageinfo{
|
||||
@Override
|
||||
public List<String> getPackageList(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
packageinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/packageinfo", packageinfo.class);
|
||||
return obj.getPackageList();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getPackageVersion(String name){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
packageinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/packageinfo", packageinfo.class);
|
||||
return obj.getPackageVersion(name);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public int getPackageInstalled(String name,String version){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
packageinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/packageinfo", packageinfo.class);
|
||||
return obj.getPackageInstalled(name,version);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package kylin.kysdk.java.method;
|
||||
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import com.kylin.kysdk.peripheralsenum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class PeripheralsenumMethod implements peripheralsenum {
|
||||
|
||||
@Override
|
||||
public List<String> getAllUsbInfo(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
peripheralsenum obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/peripheralsenum", peripheralsenum.class);
|
||||
return obj.getAllUsbInfo();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
package kylin.kysdk.java.method;
|
||||
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import com.kylin.kysdk.print;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class PrintMethod implements print {
|
||||
@Override
|
||||
public List<String> getPrinterList(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
print obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/print", print.class);
|
||||
return obj.getPrinterList();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public List<String> getPrinterAvailableList(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
print obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/print", print.class);
|
||||
return obj.getPrinterAvailableList();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public void setPrinterOptions(int page,String paperType,String cups,String sided){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
print obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/print", print.class);
|
||||
obj.setPrinterOptions(page,paperType,cups,sided);
|
||||
return;
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public int getPrinterPrintLocalFile(String printer,String file){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
print obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/print", print.class);
|
||||
return obj.getPrinterPrintLocalFile(printer, file);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public int getPrinterCancelAllJobs(String printer){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
print obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/print", print.class);
|
||||
return obj.getPrinterCancelAllJobs(printer);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public int getPrinterStatus(String printer){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
print obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/print", print.class);
|
||||
return obj.getPrinterStatus(printer);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public String getPrinterFilename(String url){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
print obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/print", print.class);
|
||||
return obj.getPrinterFilename(url);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public int getPrinterJobStatus(String job, int id){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
print obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/print", print.class);
|
||||
return obj.getPrinterJobStatus(job,id);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public int getPrinterDownloadRemoteFile(String remoteFile,String localFile){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
print obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/print", print.class);
|
||||
return obj.getPrinterDownloadRemoteFile(remoteFile, localFile);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,200 @@
|
|||
package kylin.kysdk.java.method;
|
||||
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import com.kylin.kysdk.process;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class ProcessMethod implements process {
|
||||
|
||||
@Override
|
||||
public double getProcInfoCpuUsage(int proc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
process obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/process", process.class);
|
||||
return obj.getProcInfoCpuUsage(proc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getProcInfoIoUsage(int proc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
process obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/process", process.class);
|
||||
return obj.getProcInfoIoUsage(proc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getProcInfoMemUsage(int proc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
process obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/process", process.class);
|
||||
return obj.getProcInfoMemUsage(proc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
@Override
|
||||
public String getProcInfoStatus(int proc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
process obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/process", process.class);
|
||||
return obj.getProcInfoStatus(proc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcInfoPort(int proc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
process obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/process", process.class);
|
||||
return obj.getProcInfoPort(proc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProcInfoStartTime(int proc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
process obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/process", process.class);
|
||||
return obj.getProcInfoStartTime(proc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProcInfoRunningTime(int proc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
process obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/process", process.class);
|
||||
return obj.getProcInfoRunningTime(proc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProcInfoCpuTime(int proc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
process obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/process", process.class);
|
||||
return obj.getProcInfoCpuTime(proc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProcInfoCmd(int proc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
process obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/process", process.class);
|
||||
return obj.getProcInfoCpuTime(proc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProcInfoUser(int proc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
process obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/process", process.class);
|
||||
return obj.getProcInfoUser(proc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getProcInfo(String proc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
process obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/process", process.class);
|
||||
return obj.getProcInfo(proc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public List<String> getAllProcInfo(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
process obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/process", process.class);
|
||||
return obj.getAllProcInfo();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,193 @@
|
|||
package kylin.kysdk.java.method;
|
||||
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
import com.kylin.kysdk.resource;
|
||||
|
||||
@Slf4j
|
||||
public class ResourceMethod implements resource{
|
||||
@Override
|
||||
public double getMemTotalKiB(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
resource obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/resource", resource.class);
|
||||
return obj.getMemTotalKiB();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
@Override
|
||||
public double getMemUsagePercent(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
resource obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/resource", resource.class);
|
||||
return obj.getMemUsagePercent();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
@Override
|
||||
public double getMemUsageKiB(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
resource obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/resource", resource.class);
|
||||
return obj.getMemUsageKiB();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
@Override
|
||||
public double getMemAvailableKiB(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
resource obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/resource", resource.class);
|
||||
return obj.getMemAvailableKiB();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
@Override
|
||||
public double getMemFreeKiB(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
resource obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/resource", resource.class);
|
||||
return obj.getMemFreeKiB();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
@Override
|
||||
public double getMemVirtAllocKiB(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
resource obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/resource", resource.class);
|
||||
return obj.getMemVirtAllocKiB();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
@Override
|
||||
public double getMemSwapTotalKiB(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
resource obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/resource", resource.class);
|
||||
return obj.getMemSwapTotalKiB();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
@Override
|
||||
public double getMemSwapUsagePercent(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
resource obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/resource", resource.class);
|
||||
return obj.getMemSwapUsagePercent();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
@Override
|
||||
public double getMemSwapUsageKiB(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
resource obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/resource", resource.class);
|
||||
return obj.getMemSwapUsageKiB();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMemSwapFreeKiB(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
resource obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/resource", resource.class);
|
||||
return obj.getMemSwapFreeKiB();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getCpuCurrentUsage(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
resource obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/resource", resource.class);
|
||||
return obj.getCpuCurrentUsage();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUpTime(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
resource obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/resource", resource.class);
|
||||
return obj.getUpTime();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package kylin.kysdk.java.method;
|
||||
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import com.kylin.kysdk.runinfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
|
||||
@Slf4j
|
||||
public class RunInfoMethod implements runinfo {
|
||||
@Override
|
||||
public double getNetSpeed(String nc){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
runinfo runinfo = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/runinfo", com.kylin.kysdk.runinfo.class);
|
||||
return runinfo.getNetSpeed(nc);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
@Override
|
||||
public int getDiskRate(String disk){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
runinfo runinfo = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/runinfo", com.kylin.kysdk.runinfo.class);
|
||||
return runinfo.getDiskRate(disk);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@Override
|
||||
public double getCpuTemperature(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
runinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/runinfo", runinfo.class);
|
||||
return obj.getCpuTemperature();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDiskTemperature(String name){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
runinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/runinfo", runinfo.class);
|
||||
return obj.getDiskTemperature(name);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return -1.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,267 @@
|
|||
package kylin.kysdk.java.method;
|
||||
|
||||
import kylin.kysdk.java.client.DBusClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.freedesktop.dbus.connections.impl.DBusConnection;
|
||||
import org.freedesktop.dbus.exceptions.DBusException;
|
||||
import com.kylin.kysdk.sysinfo;
|
||||
import com.kylin.kysdk.resolution;
|
||||
import org.freedesktop.dbus.types.UInt32;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class SysInfoMethod implements sysinfo{
|
||||
@Override
|
||||
public String getSystemArchitecture(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemArchitecture();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getSystemName(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemName();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getSystemVersion(boolean verbose){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemVersion(verbose);
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public int getSystemActivationStatus(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemActivationStatus();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public String getSystemSerialNumber(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemSerialNumber();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getSystemKernelVersion(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemKernelVersion();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getSystemEffectUser(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemEffectUser();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getSystemProjectName(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemProjectName();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getSystemProjectSubName(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemProjectSubName();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public UInt32 getSystemProductFeatures(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemProductFeatures();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getSystemHostVirtType(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemHostVirtType();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getSystemHostCloudPlatform(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemHostCloudPlatform();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getSystemOSVersion(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemOSVersion();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getSystemUpdateVersion(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemUpdateVersion();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public boolean getSystemIsZYJ(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SYSTEM);
|
||||
sysinfo obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/sysinfo", sysinfo.class);
|
||||
return obj.getSystemIsZYJ();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<String> getSysLegalResolution(){
|
||||
ResolutionMethod obj = new ResolutionMethod();
|
||||
return obj.getSysLegalResolution();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public class ResolutionMethod implements resolution{
|
||||
@Override
|
||||
public List<String> getSysLegalResolution(){
|
||||
DBusConnection conn = null;
|
||||
try {
|
||||
conn = DBusClient.getConn(DBusConnection.DBusBusType.SESSION);
|
||||
resolution obj = conn.getRemoteObject("com.kylin.kysdk.service",
|
||||
"/com/kylin/kysdk/resolution", resolution.class);
|
||||
|
||||
return obj.getSysLegalResolution();
|
||||
} catch (DBusException e) {
|
||||
if (conn != null) conn.disconnect();
|
||||
log.error("DBusException GetEUser :",e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public boolean isRemote() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectPath() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,177 @@
|
|||
package kylin.kysdk.java;
|
||||
|
||||
import kylin.kysdk.java.method.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.freedesktop.dbus.types.UInt64;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class EventTest {
|
||||
@Test
|
||||
public void disk() throws InterruptedException {
|
||||
DiskMethod obj = new DiskMethod();
|
||||
List<String> list = obj.getDiskList();
|
||||
System.out.println(list);
|
||||
System.out.println("SecSize: " + obj.getDiskSectorSize(list.get(0)));
|
||||
System.out.println("TotaSize: " + obj.getDiskTotalSizeMiB(list.get(0)));
|
||||
System.out.println("Model: " + obj.getDiskModel(list.get(0)));
|
||||
System.out.println("Serial: " + obj.getDiskSerial(list.get(0)));
|
||||
System.out.println("PartNum: " + obj.getDiskPartitionNums(list.get(0)));
|
||||
System.out.println("Type: " + obj.getDiskType(list.get(0)));
|
||||
System.out.println("Version: " + obj.getDiskVersion(list.get(0)));
|
||||
System.out.println("SecNum: " + obj.getDiskSectorNum(list.get(0)));
|
||||
}
|
||||
@Test
|
||||
public void cpu() throws InterruptedException {
|
||||
CpuMethod obj = new CpuMethod();
|
||||
System.out.println("Arch: " + obj.getCpuArch());
|
||||
System.out.println("Vendor: " + obj.getCpuVendor());
|
||||
System.out.println("Model: " + obj.getCpuModel());
|
||||
System.out.println("Freq: " + obj.getCpuFreqMHz());
|
||||
System.out.println("Core: " + obj.getCpuCorenums());
|
||||
System.out.println("Virt: " + obj.getCpuVirt());
|
||||
System.out.println("Process: " + obj.getCpuProcess());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void netcard() throws InterruptedException {
|
||||
NetCardMethod obj = new NetCardMethod();
|
||||
List<String> list = obj.getNetCardName();
|
||||
System.out.println(list);
|
||||
System.out.println("CardUp: " + obj.getNetCardUp(list.get(0)));
|
||||
System.out.println("UpCards: " + obj.getNetCardUpcards());
|
||||
System.out.println("Mac: " + obj.getNetCardPhymac(list.get(0)));
|
||||
System.out.println("PrivateIPv4: " + obj.getNetCardPrivateIPv4(list.get(0)));
|
||||
System.out.println("Ipv4: " + obj.getNetCardIPv4(list.get(0)));
|
||||
System.out.println("PrivateIPv6: " + obj.getNetCardPrivateIPv6(list.get(0)));
|
||||
System.out.println("Type: " + obj.getNetCardType(list.get(0)));
|
||||
System.out.println("Product: " + obj.getNetCardProduct(list.get(0)));
|
||||
System.out.println("Ipv6: " + obj.getNetCardPrivateIPv6(list.get(0)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bios() throws InterruptedException {
|
||||
BiosMethod obj = new BiosMethod();
|
||||
System.out.println("Vendor" + obj.getBiosVendor());
|
||||
System.out.println("Version" + obj.getBiosVersion());
|
||||
}
|
||||
@Test
|
||||
public void mainboard() throws InterruptedException {
|
||||
MainBoardMethod obj = new MainBoardMethod();
|
||||
System.out.println("Name: " + obj.getMainboardName());
|
||||
System.out.println("date: " + obj.getMainboardDate());
|
||||
System.out.println("Serial: " + obj.getMainboardSerial());
|
||||
System.out.println("Vendor: " + obj.getMainboardVendor());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void usb() throws InterruptedException {
|
||||
PeripheralsenumMethod obj = new PeripheralsenumMethod();
|
||||
System.out.println("Usb: " + obj.getAllUsbInfo());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void packageinfo() throws InterruptedException {
|
||||
PackageInfoMethod obj = new PackageInfoMethod();
|
||||
List<String> list = obj.getPackageList();
|
||||
System.out.println(list);
|
||||
System.out.println("Version:" + obj.getPackageVersion(list.get(1)));
|
||||
System.out.println("state: " + obj.getPackageInstalled(list.get(1), obj.getPackageVersion(list.get(1))));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resource() throws InterruptedException {
|
||||
ResourceMethod obj = new ResourceMethod();
|
||||
System.out.println("Total:" + obj.getMemTotalKiB());
|
||||
System.out.println("UsagePer:" + obj.getMemSwapUsagePercent());
|
||||
System.out.println("Usage:" + obj.getMemUsageKiB());
|
||||
System.out.println("Avail:" + obj.getMemAvailableKiB());
|
||||
System.out.println("Free:" + obj.getMemFreeKiB());
|
||||
System.out.println("Virt:" + obj.getMemVirtAllocKiB());
|
||||
System.out.println("SwapTotal:" + obj.getMemSwapTotalKiB());
|
||||
System.out.println("SwapUsagePer:" + obj.getMemSwapUsagePercent());
|
||||
System.out.println("SwapUsage:" + obj.getMemSwapUsageKiB());
|
||||
System.out.println("SwageFree:" + obj.getMemSwapFreeKiB());
|
||||
System.out.println("CpuUsage:" + obj.getCpuCurrentUsage());
|
||||
System.out.println("UpTime:" + obj.getUpTime());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void process() throws InterruptedException {
|
||||
|
||||
ProcessMethod obj = new ProcessMethod();
|
||||
int proc = 2203;
|
||||
System.out.println("CpuUsage:" + obj.getProcInfoCpuUsage(proc));
|
||||
System.out.println("MemUsage:" + obj.getProcInfoMemUsage(proc));
|
||||
System.out.println("State:" + obj.getProcInfoStatus(proc));
|
||||
System.out.println("Port:" + obj.getProcInfoPort(proc));
|
||||
System.out.println("Start:" + obj.getProcInfoStartTime(proc));
|
||||
System.out.println("Running:" + obj.getProcInfoRunningTime(proc));
|
||||
System.out.println("CpuTime:" + obj.getProcInfoCpuTime(proc));
|
||||
System.out.println("Cmd:" + obj.getProcInfoCmd(proc));
|
||||
System.out.println("User:" + obj.getProcInfoUser(proc));
|
||||
System.out.println(obj.getProcInfo("code"));
|
||||
System.out.println(obj.getAllProcInfo());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sysinfo() throws InterruptedException {
|
||||
SysInfoMethod obj = new SysInfoMethod();
|
||||
System.out.println("Arch:" + obj.getSystemArchitecture());
|
||||
System.out.println("Name:" + obj.getSystemName());
|
||||
System.out.println("Version:" + obj.getSystemVersion(false));
|
||||
System.out.println("Activation:" + obj.getSystemActivationStatus());
|
||||
System.out.println("Serial:" + obj.getSystemSerialNumber());
|
||||
System.out.println("KernelVer:" + obj.getSystemKernelVersion());
|
||||
System.out.println("Effect:" + obj.getSystemEffectUser());
|
||||
System.out.println("ProName:" + obj.getSystemProjectName());
|
||||
System.out.println("SubName:" + obj.getSystemProjectSubName());
|
||||
System.out.println("Product:" + obj.getSystemProductFeatures());
|
||||
System.out.println("Virt:" + obj.getSystemHostVirtType());
|
||||
System.out.println("Paltform:" + obj.getSystemHostCloudPlatform());
|
||||
System.out.println("OSVer:" + obj.getSystemOSVersion());
|
||||
System.out.println("UpdateVer:" + obj.getSystemUpdateVersion());
|
||||
System.out.println("ZYJ:" + obj.getSystemIsZYJ());
|
||||
System.out.println("Arch:" + obj.getSysLegalResolution());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void net() throws InterruptedException {
|
||||
NetMethod obj = new NetMethod();
|
||||
System.out.println("Port:" + obj.getPortState(5868));
|
||||
System.out.println("Multiple:" + obj.getMultiplePortStat(0,500));
|
||||
System.out.println("Gateway:" + obj.getGatewayInfo());
|
||||
System.out.println("Firewall:" + obj.getFirewallState());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void runInfo() throws InterruptedException {
|
||||
RunInfoMethod obj = new RunInfoMethod();
|
||||
System.out.println("NetSpeed:" + obj.getNetSpeed("enp3s0"));
|
||||
System.out.println("Rate:" + obj.getDiskRate("/dev/sda"));
|
||||
System.out.println("CpuTemp:" + obj.getCpuTemperature());
|
||||
System.out.println("DiskTemp:" + obj.getDiskTemperature("/dev/sda"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public static void gps() throws InterruptedException {
|
||||
GpsMethod obj = new GpsMethod();
|
||||
System.out.println(obj.getGPSInfo());
|
||||
}
|
||||
|
||||
@Test
|
||||
public static void print() throws InterruptedException {
|
||||
PrintMethod obj = new PrintMethod();
|
||||
System.out.println("PrinterList:" + obj.getPrinterList());
|
||||
System.out.println("AvailableList:" + obj.getPrinterAvailableList());
|
||||
obj.setPrinterOptions(1, "A4", "", "one-sided");
|
||||
System.out.println("LocalFile:" + obj.getPrinterPrintLocalFile("", ""));
|
||||
System.out.println("CancleJob:" + obj.getPrinterCancelAllJobs(""));
|
||||
System.out.println("Statue:" + obj.getPrinterStatus(""));
|
||||
System.out.println("FileName:" + obj.getPrinterFilename(""));
|
||||
System.out.println("JobStatus:" + obj.getPrinterJobStatus("", 0));
|
||||
System.out.println("RemoteFile:" + obj.getPrinterDownloadRemoteFile("", ""));
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env sh
|
||||
cd ../kysdk-java/
|
||||
mvn clean install -DskipTests=true --settings ../package/settings.xml
|
|
@ -0,0 +1,367 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
<!--
|
||||
| This is the configuration file for Maven. It can be specified at two levels:
|
||||
|
|
||||
| 1. User Level. This settings.xml file provides configuration for a single user,
|
||||
| and is normally provided in ${user.home}/.m2/settings.xml.
|
||||
|
|
||||
| NOTE: This location can be overridden with the CLI option:
|
||||
|
|
||||
| -s /path/to/user/settings.xml
|
||||
|
|
||||
| 2. Global Level. This settings.xml file provides configuration for all Maven
|
||||
| users on a machine (assuming they're all using the same Maven
|
||||
| installation). It's normally provided in
|
||||
| ${maven.conf}/settings.xml.
|
||||
|
|
||||
| NOTE: This location can be overridden with the CLI option:
|
||||
|
|
||||
| -gs /path/to/global/settings.xml
|
||||
|
|
||||
| The sections in this sample file are intended to give you a running start at
|
||||
| getting the most out of your Maven installation. Where appropriate, the default
|
||||
| values (values used when the setting is not specified) are provided.
|
||||
|
|
||||
|-->
|
||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||
<!-- localRepository
|
||||
| The path to the local repository maven will use to store artifacts.
|
||||
|
|
||||
| Default: ${user.home}/.m2/repository
|
||||
<localRepository>/path/to/local/repo</localRepository>
|
||||
-->
|
||||
<localRepository>${user.home}/.m2/repository</localRepository>
|
||||
|
||||
<!-- interactiveMode
|
||||
| This will determine whether maven prompts you when it needs input. If set to false,
|
||||
| maven will use a sensible default value, perhaps based on some other setting, for
|
||||
| the parameter in question.
|
||||
|
|
||||
| Default: true
|
||||
<interactiveMode>true</interactiveMode>
|
||||
-->
|
||||
|
||||
<!-- offline
|
||||
| Determines whether maven should attempt to connect to the network when executing a build.
|
||||
| This will have an effect on artifact downloads, artifact deployment, and others.
|
||||
|
|
||||
| Default: false
|
||||
<offline>false</offline>
|
||||
-->
|
||||
|
||||
<!-- pluginGroups
|
||||
| This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
|
||||
| when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
|
||||
| "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
|
||||
|-->
|
||||
<pluginGroups>
|
||||
<!-- pluginGroup
|
||||
| Specifies a further group identifier to use for plugin lookup.
|
||||
<pluginGroup>com.your.plugins</pluginGroup>
|
||||
-->
|
||||
</pluginGroups>
|
||||
|
||||
<!-- proxies
|
||||
| This is a list of proxies which can be used on this machine to connect to the network.
|
||||
| Unless otherwise specified (by system property or command-line switch), the first proxy
|
||||
| specification in this list marked as active will be used.
|
||||
|-->
|
||||
<proxies>
|
||||
<!-- proxy
|
||||
| Specification for one proxy, to be used in connecting to the network.
|
||||
|
|
||||
<proxy>
|
||||
<id>optional</id>
|
||||
<active>true</active>
|
||||
<protocol>http</protocol>
|
||||
<username>proxyuser</username>
|
||||
<password>proxypass</password>
|
||||
<host>proxy.host.net</host>
|
||||
<port>80</port>
|
||||
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
|
||||
</proxy>
|
||||
-->
|
||||
</proxies>
|
||||
|
||||
<!-- servers
|
||||
| This is a list of authentication profiles, keyed by the server-id used within the system.
|
||||
| Authentication profiles can be used whenever maven must make a connection to a remote server.
|
||||
|-->
|
||||
<servers>
|
||||
<!-- server
|
||||
| Specifies the authentication information to use when connecting to a particular server, identified by
|
||||
| a unique name within the system (referred to by the 'id' attribute below).
|
||||
|
|
||||
| NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
|
||||
| used together.
|
||||
|
|
||||
<server>
|
||||
<id>deploymentRepo</id>
|
||||
<username>repouser</username>
|
||||
<password>repopwd</password>
|
||||
</server>
|
||||
-->
|
||||
|
||||
<!-- Another sample, using keys to authenticate.
|
||||
<server>
|
||||
<id>siteServer</id>
|
||||
<privateKey>/path/to/private/key</privateKey>
|
||||
<passphrase>optional; leave empty if not used.</passphrase>
|
||||
</server>
|
||||
-->
|
||||
<!-- 私服发布的用户名密码 -->
|
||||
<server>
|
||||
<id>kylin-public</id>
|
||||
<username>dev</username>
|
||||
<password>dev@kylin</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>kylin-releases</id>
|
||||
<username>dev</username>
|
||||
<password>dev@kylin</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>kylin-snapshots</id>
|
||||
<username>dev</username>
|
||||
<password>dev@kylin</password>
|
||||
</server>
|
||||
</servers>
|
||||
|
||||
<!-- mirrors
|
||||
| This is a list of mirrors to be used in downloading artifacts from remote repositories.
|
||||
|
|
||||
| It works like this: a POM may declare a repository to use in resolving certain artifacts.
|
||||
| However, this repository may have problems with heavy traffic at times, so people have mirrored
|
||||
| it to several places.
|
||||
|
|
||||
| That repository definition will have a unique id, so we can create a mirror reference for that
|
||||
| repository, to be used as an alternate download site. The mirror site will be the preferred
|
||||
| server for that repository.
|
||||
|-->
|
||||
<mirrors>
|
||||
<!-- mirror
|
||||
| Specifies a repository mirror site to use instead of a given repository. The repository that
|
||||
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
|
||||
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
||||
|-->
|
||||
<mirror>
|
||||
<id>ali-nexus</id>
|
||||
<name>aliyun nexus</name>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||
<mirrorOf>*</mirrorOf>
|
||||
</mirror>
|
||||
|
||||
<mirror>
|
||||
<id>kylin-public</id>
|
||||
<name>Public Repositories</name>
|
||||
<url>http://172.20.184.181:18081/repository/maven-public/</url>
|
||||
<mirrorOf>*</mirrorOf>
|
||||
</mirror>
|
||||
|
||||
<mirror>
|
||||
<id>kylin-releases</id>
|
||||
<mirrorOf>*</mirrorOf>
|
||||
<name>releases Proxy Mirror</name>
|
||||
<url>http://172.20.184.181:18081/repository/maven-releases/</url>
|
||||
</mirror>
|
||||
<mirror>
|
||||
<id>kylin-snapshots</id>
|
||||
<mirrorOf>*</mirrorOf>
|
||||
<name>snapshots Proxy Mirror</name>
|
||||
<url>http://172.20.184.181:18081/repository/maven-snapshots/</url>
|
||||
</mirror>
|
||||
</mirrors>
|
||||
|
||||
<!-- profiles
|
||||
| This is a list of profiles which can be activated in a variety of ways, and which can modify
|
||||
| the build process. Profiles provided in the settings.xml are intended to provide local machine-
|
||||
| specific paths and repository locations which allow the build to work in the local environment.
|
||||
|
|
||||
| For example, if you have an integration testing plugin - like cactus - that needs to know where
|
||||
| your Tomcat instance is installed, you can provide a variable here such that the variable is
|
||||
| dereferenced during the build process to configure the cactus plugin.
|
||||
|
|
||||
| As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
|
||||
| section of this document (settings.xml) - will be discussed later. Another way essentially
|
||||
| relies on the detection of a system property, either matching a particular value for the property,
|
||||
| or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
|
||||
| value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
|
||||
| Finally, the list of active profiles can be specified directly from the command line.
|
||||
|
|
||||
| NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
|
||||
| repositories, plugin repositories, and free-form properties to be used as configuration
|
||||
| variables for plugins in the POM.
|
||||
|
|
||||
|-->
|
||||
<profiles>
|
||||
<!-- profile
|
||||
| Specifies a set of introductions to the build process, to be activated using one or more of the
|
||||
| mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
|
||||
| or the command line, profiles have to have an ID that is unique.
|
||||
|
|
||||
| An encouraged best practice for profile identification is to use a consistent naming convention
|
||||
| for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
|
||||
| This will make it more intuitive to understand what the set of introduced profiles is attempting
|
||||
| to accomplish, particularly when you only have a list of profile id's for debug.
|
||||
|
|
||||
| This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
|
||||
<profile>
|
||||
<id>jdk-1.4</id>
|
||||
|
||||
<activation>
|
||||
<jdk>1.4</jdk>
|
||||
</activation>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jdk14</id>
|
||||
<name>Repository for JDK 1.4 builds</name>
|
||||
<url>http://www.myhost.com/maven/jdk14</url>
|
||||
<layout>default</layout>
|
||||
<snapshotPolicy>always</snapshotPolicy>
|
||||
</repository>
|
||||
</repositories>
|
||||
</profile>
|
||||
-->
|
||||
<profile>
|
||||
<id>jdk1.8</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
<jdk>1.8</jdk>
|
||||
</activation>
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>kylin</id>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>aliyun-public</id>
|
||||
<name>aliyun Repository</name>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
<updatePolicy>always</updatePolicy>
|
||||
<checksumPolicy>fail</checksumPolicy>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
<updatePolicy>always</updatePolicy>
|
||||
<checksumPolicy>warn</checksumPolicy>
|
||||
</releases>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>kylin-public</id>
|
||||
<url>http://172.20.184.181:18081/repository/maven-public/</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>kylin-releases</id>
|
||||
<!-- <url>http://nexus.kylin.com/repository/maven-releases/</url>-->
|
||||
<url>http://172.20.184.181:18081/repository/maven-releases/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>kylin-snapshots</id>
|
||||
<!-- <url>http://nexus.kylin.com/repository/maven-snapshots/</url>-->
|
||||
<url>http://172.20.184.181:18081/repository/maven-snapshots/</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>kylin-public</id>
|
||||
<name>Public Repositories</name>
|
||||
<url>http://172.20.184.181:18081/repository/maven-public/</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
<!--
|
||||
| Here is another profile, activated by the system property 'target-env' with a value of 'dev',
|
||||
| which provides a specific path to the Tomcat instance. To use this, your plugin configuration
|
||||
| might hypothetically look like:
|
||||
|
|
||||
| ...
|
||||
| <plugin>
|
||||
| <groupId>org.myco.myplugins</groupId>
|
||||
| <artifactId>myplugin</artifactId>
|
||||
|
|
||||
| <configuration>
|
||||
| <tomcatLocation>${tomcatPath}</tomcatLocation>
|
||||
| </configuration>
|
||||
| </plugin>
|
||||
| ...
|
||||
|
|
||||
| NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
|
||||
| anything, you could just leave off the <value/> inside the activation-property.
|
||||
|
|
||||
<profile>
|
||||
<id>env-dev</id>
|
||||
|
||||
<activation>
|
||||
<property>
|
||||
<name>target-env</name>
|
||||
<value>dev</value>
|
||||
</property>
|
||||
</activation>
|
||||
|
||||
<properties>
|
||||
<tomcatPath>/path/to/tomcat/instance</tomcatPath>
|
||||
</properties>
|
||||
</profile>
|
||||
-->
|
||||
</profiles>
|
||||
|
||||
<!-- activeProfiles
|
||||
| List of profiles that are active for all builds.
|
||||
|
|
||||
<activeProfiles>
|
||||
<activeProfile>alwaysActiveProfile</activeProfile>
|
||||
<activeProfile>anotherAlwaysActiveProfile</activeProfile>
|
||||
</activeProfiles>
|
||||
-->
|
||||
<activeProfiles>
|
||||
<activeProfile>jdk1.8</activeProfile>
|
||||
<activeProfile>kylin</activeProfile>
|
||||
</activeProfiles>
|
||||
</settings>
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>kylin.kysdk.java</groupId>
|
||||
<artifactId>kysdk-java-ext</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0.0</version>
|
||||
<modules>
|
||||
<module>kysdk-java</module>
|
||||
</modules>
|
||||
</project>
|
|
@ -0,0 +1,3 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
|
@ -0,0 +1,19 @@
|
|||
<component name="ArtifactManager">
|
||||
<artifact name="test:jar">
|
||||
<output-path>$PROJECT_DIR$/out/artifacts/test_jar</output-path>
|
||||
<root id="root">
|
||||
<element id="archive" name="test.jar">
|
||||
<element id="directory" name="META-INF">
|
||||
<element id="file-copy" path="$PROJECT_DIR$/src/META-INF/MANIFEST.MF" />
|
||||
</element>
|
||||
<element id="module-output" name="test" />
|
||||
</element>
|
||||
<element id="directory" name="lib">
|
||||
<element id="library" level="project" name="github.hypfvieh.dbus.java" />
|
||||
<element id="library" level="project" name="kysdk-java-1.0.0" />
|
||||
<element id="library" level="project" name="slf4j.api" />
|
||||
<element id="library" level="project" name="slf4j.simple" />
|
||||
</element>
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="test" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,25 @@
|
|||
<component name="libraryTable">
|
||||
<library name="github.hypfvieh.dbus.java" type="repository">
|
||||
<properties maven-id="com.github.hypfvieh:dbus-java:3.3.2" />
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/hypfvieh/dbus-java/3.3.2/dbus-java-3.3.2.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/jnr/jnr-unixsocket/0.38.17/jnr-unixsocket-0.38.17.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/jnr/jnr-ffi/2.2.11/jnr-ffi-2.2.11.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/jnr/jffi/1.3.9/jffi-1.3.9.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/jnr/jffi/1.3.9/jffi-1.3.9-native.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm/9.2/asm-9.2.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-commons/9.2/asm-commons-9.2.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-tree/9.2/asm-tree-9.2.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-util/9.2/asm-util-9.2.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/jnr/jnr-a64asm/1.0.0/jnr-a64asm-1.0.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/jnr/jnr-constants/0.10.3/jnr-constants-0.10.3.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/jnr/jnr-enxio/0.32.13/jnr-enxio-0.32.13.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/jnr/jnr-posix/3.1.15/jnr-posix-3.1.15.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
|
@ -0,0 +1,9 @@
|
|||
<component name="libraryTable">
|
||||
<library name="kysdk-java-1.0.0">
|
||||
<CLASSES>
|
||||
<root url="jar:///usr/share/java/kysdk-java-1.0.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
|
@ -0,0 +1,10 @@
|
|||
<component name="libraryTable">
|
||||
<library name="slf4j.api" type="repository">
|
||||
<properties maven-id="org.slf4j:slf4j-api:1.7.36" />
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
|
@ -0,0 +1,11 @@
|
|||
<component name="libraryTable">
|
||||
<library name="slf4j.simple" type="repository">
|
||||
<properties maven-id="org.slf4j:slf4j-simple:1.7.36" />
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-simple/1.7.36/slf4j-simple-1.7.36.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue