X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=bindings%2Fjava%2Forg%2Fcollectd%2Fapi%2FCollectdAPI.java;fp=bindings%2Fjava%2Forg%2Fcollectd%2Fapi%2FCollectdAPI.java;h=2b6e06cf9ea58f2a2840795710eed5f55d81f1ec;hb=5f19536990c9e5043c17ed2278b331102de88594;hp=9dbe7c0d482a8008e260b9aa3ac3491372ac46b7;hpb=226b7ea58bcf07ffa59466f0c739185737b15b46;p=collectd.git diff --git a/bindings/java/org/collectd/api/CollectdAPI.java b/bindings/java/org/collectd/api/CollectdAPI.java index 9dbe7c0d..2b6e06cf 100644 --- a/bindings/java/org/collectd/api/CollectdAPI.java +++ b/bindings/java/org/collectd/api/CollectdAPI.java @@ -28,15 +28,11 @@ package org.collectd.api; */ public class CollectdAPI { - /** - * Java representation of collectd/src/plugin.h:plugin_dispatch_values - */ - native public static int DispatchValues (ValueList vl); - - /** - * Java representation of collectd/src/plugin.h:plugin_get_ds - */ - native public static DataSet GetDS (String type); + private static final int LOG_ERR = 3; + private static final int LOG_WARNING = 4; + private static final int LOG_NOTICE = 5; + private static final int LOG_INFO = 6; + private static final int LOG_DEBUG = 7; /** * Java representation of collectd/src/plugin.h:plugin_register_config @@ -67,6 +63,47 @@ public class CollectdAPI */ native public static int RegisterShutdown (String name, CollectdShutdownInterface obj); + + /** + * Java representation of collectd/src/plugin.h:plugin_dispatch_values + */ + native public static int DispatchValues (ValueList vl); + + /** + * Java representation of collectd/src/plugin.h:plugin_get_ds + */ + native public static DataSet GetDS (String type); + + /** + * Java representation of collectd/src/plugin.h:plugin_log + */ + native private static void Log (int severity, String message); + + public static void LogError (String message) + { + Log (LOG_ERR, message); + } /* void LogError */ + + public static void LogWarning (String message) + { + Log (LOG_WARNING, message); + } /* void LogWarning */ + + public static void LogNotice (String message) + { + Log (LOG_NOTICE, message); + } /* void LogNotice */ + + public static void LogInfo (String message) + { + Log (LOG_INFO, message); + } /* void LogInfo */ + + public static void LogDebug (String message) + { + Log (LOG_DEBUG, message); + } /* void LogDebug */ + } /* class CollectdAPI */ /* vim: set sw=2 sts=2 et fdm=marker : */