KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > fenyo > gnetwatch > activities > NmapQueue


1
2 /*
3  * GNetWatch
4  * Copyright 2006, 2007 Alexandre Fenyo
5  * gnetwatch@fenyo.net
6  *
7  * This file is part of GNetWatch.
8  *
9  * GNetWatch is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * GNetWatch is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with GNetWatch; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22  */

23
24 package net.fenyo.gnetwatch.activities;
25
26 import java.util.LinkedList JavaDoc;
27 import java.util.List JavaDoc;
28
29 import net.fenyo.gnetwatch.*;
30 import net.fenyo.gnetwatch.GUI.*;
31 import net.fenyo.gnetwatch.actions.Action;
32 import net.fenyo.gnetwatch.targets.*;
33
34 import org.apache.commons.logging.Log;
35 import org.apache.commons.logging.LogFactory;
36
37 /**
38  * This queue holds Nmap actions.
39  * @author Alexandre Fenyo
40  * @version $Id: NmapQueue.java,v 1.1 2007/03/09 22:44:21 fenyo Exp $
41  */

42
43 public class NmapQueue extends Queue implements Runnable JavaDoc {
44   private static Log log = LogFactory.getLog(NmapQueue.class);
45
46   /**
47    * Constructor.
48    * @param name queue name.
49    * @param config configuration.
50    */

51   // main thread
52
public NmapQueue(final String JavaDoc name, final Config config) {
53     super(name, config);
54     setDescription(config.getString("dedicated_for_nmap"));
55   }
56
57   /**
58    * Returns the time to wait after each cycle.
59    * @param none.
60    * @return int time to wait.
61    */

62   // Queue thread
63
protected int getCycleDelay() {
64     return 1000;
65   }
66
67   /**
68    * Returns the time to wait between empty cycles.
69    * @param none.
70    * @return time to wait.
71    */

72   // Queue thread
73
protected int getEmptyCycleDelay() {
74     return 1000;
75   }
76
77   /**
78    * Returns the time to wait between two actions.
79    * @param none.
80    * @return time to wait.
81    */

82   // Queue thread
83
protected int getActionDelay() {
84     return 0;
85   }
86 }
87
Popular Tags