|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.fenyo.gnetwatch.activities.CaptureManager
public class CaptureManager
This class captures Ethernet frames using tethereal. A tethereal instance is spawned through a Capture instance, for each layer-2 interface.
| Nested Class Summary | |
|---|---|
static interface |
CaptureManager.HandlePacket
|
| Field Summary | |
|---|---|
private java.util.List<Capture> |
capture_list
|
private Config |
config
|
private GUI |
gui
|
private MultiMap |
listeners
|
private static Log |
log
|
| Constructor Summary | |
|---|---|
CaptureManager(Config config)
Constructor. |
|
| Method Summary | |
|---|---|
private java.lang.String |
getGlobalFilter()
Creates a filter that integrates every individual listener filters. |
void |
handlePacket(Document packet)
Inform every listeners about the next frame. |
void |
registerListener(java.lang.String filter,
CaptureManager.HandlePacket callback)
Register a frame listener. |
void |
setGUI(GUI gui)
Defines the GUI instance. |
private void |
startCapture(java.lang.String filter)
Creates captures instances for each available interface. |
private void |
stopCapture()
Stops every capture instances. |
void |
unRegisterAllListeners()
Removes every listeners. |
void |
unRegisterListener(java.lang.String filter,
CaptureManager.HandlePacket callback)
Removes a frame listener. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static Log log
private final Config config
private GUI gui
private final java.util.List<Capture> capture_list
private MultiMap listeners
| Constructor Detail |
|---|
public CaptureManager(Config config)
config - configuration.| Method Detail |
|---|
public void setGUI(GUI gui)
GUI - gui.
private void startCapture(java.lang.String filter)
throws java.lang.InterruptedException
filter - tethereal filter.
java.lang.InterruptedException - exception.
private void stopCapture()
throws java.lang.InterruptedException
none. -
java.lang.InterruptedException - exception.private java.lang.String getGlobalFilter()
none. -
public void registerListener(java.lang.String filter,
CaptureManager.HandlePacket callback)
throws java.lang.InterruptedException
filter - filter this listener is interested in.callback - entry point for asynchronous call.
java.lang.InterruptedException - exception.
public void unRegisterListener(java.lang.String filter,
CaptureManager.HandlePacket callback)
throws java.lang.InterruptedException
filter - filter this listener was interested in.callback - entry point for asynchronous call.
java.lang.InterruptedException - exception.
public void unRegisterAllListeners()
throws java.lang.InterruptedException
none. -
java.lang.InterruptedException - exception.public void handlePacket(Document packet)
packet - next frame.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||