15e177c6f0ad1d302d363ac4effd68aa4ba8e676
[collectd.git] / bindings / java / org / collectd / api / Collectd.java
1 /*
2  * collectd/java - org/collectd/api/Collectd.java
3  * Copyright (C) 2009  Florian octo Forster
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; only version 2 of the License is applicable.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
17  *
18  * Authors:
19  *   Florian octo Forster <octo at verplant.org>
20  */
21
22 package org.collectd.api;
23
24 /**
25  * Java API to internal functions of collectd.
26  *
27  * @author Florian Forster &lt;octo at verplant.org&gt;
28  */
29 public class Collectd
30 {
31   public static final int LOG_ERR     = 3;
32   public static final int LOG_WARNING = 4;
33   public static final int LOG_NOTICE  = 5;
34   public static final int LOG_INFO    = 6;
35   public static final int LOG_DEBUG   = 7;
36
37   public static final int FC_MATCH_NO_MATCH  = 0;
38   public static final int FC_MATCH_MATCHES   = 1;
39
40   public static final int FC_TARGET_CONTINUE = 0;
41   public static final int FC_TARGET_STOP     = 1;
42   public static final int FC_TARGET_RETURN   = 2;
43
44   /**
45    * Java representation of collectd/src/plugin.h:plugin_register_config
46    */
47   native public static int registerConfig (String name,
48       CollectdConfigInterface object);
49
50   /**
51    * Java representation of collectd/src/plugin.h:plugin_register_init
52    */
53   native public static int registerInit (String name,
54       CollectdInitInterface object);
55
56   /**
57    * Java representation of collectd/src/plugin.h:plugin_register_read
58    */
59   native public static int registerRead (String name,
60       CollectdReadInterface object);
61
62   /**
63    * Java representation of collectd/src/plugin.h:plugin_register_write
64    */
65   native public static int registerWrite (String name,
66       CollectdWriteInterface object);
67
68   /**
69    * Java representation of collectd/src/plugin.h:plugin_register_flush
70    */
71   native public static int registerFlush (String name,
72       CollectdFlushInterface object);
73
74   /**
75    * Java representation of collectd/src/plugin.h:plugin_register_shutdown
76    */
77   native public static int registerShutdown (String name,
78       CollectdShutdownInterface object);
79
80   /**
81    * Java representation of collectd/src/plugin.h:plugin_register_log
82    */
83   native public static int registerLog (String name,
84       CollectdLogInterface object);
85
86   /**
87    * Java representation of collectd/src/plugin.h:plugin_register_notification
88    */
89   native public static int registerNotification (String name,
90       CollectdNotificationInterface object);
91
92   /**
93    * Java representation of collectd/src/filter_chain.h:fc_register_match
94    */
95   native public static int registerMatch (String name,
96       CollectdMatchFactoryInterface object);
97
98   /**
99    * Java representation of collectd/src/plugin.h:plugin_dispatch_values
100    */
101   native public static int dispatchValues (ValueList vl);
102
103   /**
104    * Java representation of collectd/src/plugin.h:plugin_dispatch_notification
105    */
106   native public static int dispatchNotification (Notification n);
107
108   /**
109    * Java representation of collectd/src/plugin.h:plugin_get_ds
110    */
111   native public static DataSet getDS (String type);
112
113   /**
114    * Java representation of collectd/src/plugin.h:plugin_log
115    */
116   native private static void log (int severity, String message);
117
118   public static void logError (String message)
119   {
120     log (LOG_ERR, message);
121   } /* void logError */
122
123   public static void logWarning (String message)
124   {
125     log (LOG_WARNING, message);
126   } /* void logWarning */
127
128   public static void logNotice (String message)
129   {
130     log (LOG_NOTICE, message);
131   } /* void logNotice */
132
133   public static void logInfo (String message)
134   {
135     log (LOG_INFO, message);
136   } /* void logInfo */
137
138   public static void logDebug (String message)
139   {
140     log (LOG_DEBUG, message);
141   } /* void logDebug */
142
143 } /* class Collectd */
144
145 /* vim: set sw=2 sts=2 et fdm=marker : */