ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/server/PluginManager/PluginDemo.java
Revision: 1.2
Committed: Fri Dec 1 14:31:14 2000 UTC (23 years, 5 months ago) by pjm2
Branch: MAIN
Changes since 1.1: +5 -5 lines
Log Message:
Modified the XMLPackets so that they contain packet.attributes.blablabla
parameters.

File Contents

# User Rev Content
1 pjm2 1.1 // a demo program to make and use a plugin filter manager
2    
3     // pjm2@ukc.ac.uk
4    
5     class PluginDemo {
6    
7    
8     // Test the PluginFilterManager with some XMLPackets.
9     public static void main(String[] args){
10    
11     PluginFilterManager pfm = PluginFilterManager.init();
12    
13     // Some XMLPackets to test with...
14     XMLPacket validPacket = new XMLPacket();
15     XMLPacket emptyPacket = new XMLPacket();
16     XMLPacket nearlyEmptyPacket = new XMLPacket();
17    
18     // Add some stuff to the valid packet (i.e. all essential info)
19 pjm2 1.2 validPacket.addParam("packet.attributes.machine_name", "raptor");
20     validPacket.addParam("packet.attributes.ip", "129.12.225.53");
21     validPacket.addParam("packet.attributes.seq_no", "552");
22     validPacket.addParam("packet.attributes.date", "934999665636");
23 pjm2 1.1
24     // Add nothing to the empty packet
25    
26     // Add just the machine name to the nearly empty packet.
27 pjm2 1.2 nearlyEmptyPacket.addParam("packet.attributes.machine_name", "craptor");
28 pjm2 1.1
29     // Run the XMLPackets through the filter pipeline.
30     System.out.println("");
31     System.out.println("Well, did they make it through the filter pipeline?!");
32     System.out.println("validPacket: "+pfm.runFilters(validPacket));
33     System.out.println("emptyPacket: "+pfm.runFilters(emptyPacket));
34     System.out.println("nearlyEmptyPacket: "+pfm.runFilters(nearlyEmptyPacket));
35    
36     }
37    
38     }