01: /*
02: * GNetWatch
03: * Copyright 2006, 2007 Alexandre Fenyo
04: * gnetwatch@fenyo.net
05: *
06: * This file is part of GNetWatch.
07: *
08: * GNetWatch is free software; you can redistribute it and/or modify
09: * it under the terms of the GNU General Public License as published by
10: * the Free Software Foundation; either version 2 of the License, or
11: * (at your option) any later version.
12: *
13: * GNetWatch is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16: * GNU General Public License for more details.
17: *
18: * You should have received a copy of the GNU General Public License
19: * along with GNetWatch; if not, write to the Free Software
20: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21: */
22:
23: package net.fenyo.gnetwatch.activities;
24:
25: import java.util.LinkedList;
26: import java.util.List;
27:
28: import net.fenyo.gnetwatch.*;
29: import net.fenyo.gnetwatch.GUI.*;
30: import net.fenyo.gnetwatch.actions.Action;
31: import net.fenyo.gnetwatch.targets.*;
32:
33: import org.apache.commons.logging.Log;
34: import org.apache.commons.logging.LogFactory;
35:
36: /**
37: * SNMPQueue holds asynchronous SNMP queries.
38: * @author Alexandre Fenyo
39: * @version $Id: SNMPQueue.java,v 1.5 2007/03/03 00:38:19 fenyo Exp $
40: */
41:
42: public class SNMPQueue extends Queue implements Runnable {
43: private static Log log = LogFactory.getLog(SNMPQueue.class);
44:
45: /**
46: * Constructor.
47: * @param name queue name.
48: * @param config configuration.
49: */
50: // main thread
51: public SNMPQueue(final String name, final Config config) {
52: super (name, config);
53: setDescription("dedicated for SNMP queries");
54: }
55:
56: /**
57: * Returns the time to wait after each cycle.
58: * @param none.
59: * @return int time to wait.
60: */
61: // Queue thread
62: protected int getCycleDelay() {
63: return 1000;
64: }
65:
66: /**
67: * Returns the time to wait between empty cycles.
68: * @param none.
69: * @return time to wait.
70: */
71: // Queue thread
72: protected int getEmptyCycleDelay() {
73: return 1000;
74: }
75:
76: /**
77: * Returns the time to wait between two actions.
78: * @param none.
79: * @return time to wait.
80: */
81: // Queue thread
82: protected int getActionDelay() {
83: return 0;
84: }
85: }
|