From 0677fa7fe8ad46b61364db7542a946d1fbd05d13 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 11 Jul 2005 20:22:16 +0000 Subject: [PATCH] add NetInfo getters --- bindings/java/src/net/hyperic/sigar/Sigar.java | 9 +++++++++ bindings/java/src/net/hyperic/sigar/SigarProxy.java | 2 ++ .../java/src/net/hyperic/sigar/SynchronizedSigar.java | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/bindings/java/src/net/hyperic/sigar/Sigar.java b/bindings/java/src/net/hyperic/sigar/Sigar.java index c33bf92a..588b064f 100644 --- a/bindings/java/src/net/hyperic/sigar/Sigar.java +++ b/bindings/java/src/net/hyperic/sigar/Sigar.java @@ -620,6 +620,15 @@ public class Sigar implements SigarProxy { public native Who[] getWhoList() throws SigarException; + /** + * Get general network info. + * @exception SigarException on failure. + */ + public NetInfo getNetInfo() + throws SigarException { + return NetInfo.fetch(this); + } + /** * Get network interface configuration info. * @exception SigarException on failure. diff --git a/bindings/java/src/net/hyperic/sigar/SigarProxy.java b/bindings/java/src/net/hyperic/sigar/SigarProxy.java index 05a479e0..8a43ef45 100644 --- a/bindings/java/src/net/hyperic/sigar/SigarProxy.java +++ b/bindings/java/src/net/hyperic/sigar/SigarProxy.java @@ -125,5 +125,7 @@ public interface SigarProxy { public Who[] getWhoList() throws SigarException; + public NetInfo getNetInfo() throws SigarException; + public String getFQDN() throws SigarException; } diff --git a/bindings/java/src/net/hyperic/sigar/SynchronizedSigar.java b/bindings/java/src/net/hyperic/sigar/SynchronizedSigar.java index be3b0cfe..3d9d887b 100644 --- a/bindings/java/src/net/hyperic/sigar/SynchronizedSigar.java +++ b/bindings/java/src/net/hyperic/sigar/SynchronizedSigar.java @@ -347,6 +347,12 @@ public class SynchronizedSigar implements SigarProxy { return this.sigar.getWhoList(); } + public synchronized NetInfo getNetInfo() + throws SigarException + { + return this.sigar.getNetInfo(); + } + public synchronized String getFQDN() throws SigarException {