ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/filter/plugins/TypeChecker__Plugin.java
Revision: 1.10
Committed: Sun Aug 1 10:41:02 2004 UTC (19 years, 9 months ago) by tdb
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +3 -3 lines
Log Message:
Catch a lot of old URL's and update them. Also remove a couple of old files
that aren't used.

File Contents

# User Rev Content
1 tdb 1.6 /*
2     * i-scream central monitoring system
3 tdb 1.10 * http://www.i-scream.org
4 tdb 1.6 * Copyright (C) 2000-2002 i-scream
5     *
6     * This program is free software; you can redistribute it and/or
7     * modify it under the terms of the GNU General Public License
8     * as published by the Free Software Foundation; either version 2
9     * of the License, or (at your option) any later version.
10     *
11     * This program is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with this program; if not, write to the Free Software
18     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19     */
20    
21 tdb 1.1 //---PACKAGE DECLARATION---
22 tdb 1.5 package uk.org.iscream.cms.server.filter.plugins;
23 tdb 1.1
24     //---IMPORTS---
25 tdb 1.5 import uk.org.iscream.cms.server.filter.PluginFilter;
26     import uk.org.iscream.cms.server.filter.*;
27     import uk.org.iscream.cms.server.core.*;
28 tdb 1.8 import uk.org.iscream.cms.util.*;
29 tdb 1.5 import uk.org.iscream.cms.server.componentmanager.*;
30 tdb 1.1
31     /**
32     * This plugin is designed to check the type of incoming packets.
33     *
34 tdb 1.6 * @author $Author: tdb $
35 tdb 1.10 * @version $Id: TypeChecker__Plugin.java,v 1.9 2003/02/24 20:18:49 tdb Exp $
36 tdb 1.1 */
37     public class TypeChecker__Plugin implements PluginFilter {
38    
39     //---FINAL ATTRIBUTES---
40    
41     /**
42     * The current CVS revision of this class
43     */
44 tdb 1.10 public final String REVISION = "$Revision: 1.9 $";
45 tdb 1.1
46     public final String DESC = "Checks the type attribute in the packet attributes. This must be correctly specified to allow the packet through.";
47    
48     //---STATIC METHODS---
49    
50     //---CONSTRUCTORS---
51    
52     //---PUBLIC METHODS---
53    
54     // apply the filter and return true if successful.
55     public boolean runFilter(XMLPacket packet){
56    
57     // return false if one of the predetermined types is not set.
58     if(packet.getParam("packet.attributes.type") == null
59 tdb 1.9 || (!packet.getParam("packet.attributes.type").equals("queueStat")
60 tdb 1.2 && !packet.getParam("packet.attributes.type").equals("data"))){
61 tdb 1.1 return false;
62     }
63    
64     // otherwise return true!
65     return true;
66    
67     }
68    
69     /**
70     * Overrides the {@link java.lang.Object#toString() Object.toString()}
71     * method to provide clean logging (every class should have this).
72     *
73 tdb 1.8 * This uses the uk.org.iscream.cms.util.NameFormat class
74 tdb 1.1 * to format the toString()
75     *
76     * @return the name of this class and its CVS revision
77     */
78     public String toString() {
79     return FormatName.getName(
80     _name,
81     getClass().getName(),
82     REVISION);
83     }
84    
85     /**
86     * return the String representation of what the filter does
87     */
88     public String getDescription(){
89     return DESC;
90     }
91    
92     //---PRIVATE METHODS---
93    
94     //---ACCESSOR/MUTATOR METHODS---
95    
96     //---ATTRIBUTES---
97    
98     /**
99     * This is the friendly identifier of the
100     * component this class is running in.
101     * eg, a Filter may be called "filter1",
102     * If this class does not have an owning
103     * component, a name from the configuration
104     * can be placed here. This name could also
105     * be changed to null for utility classes.
106     */
107     private String _name = FilterMain.NAME;
108    
109     /**
110     * This holds a reference to the
111     * system logger that is being used.
112     */
113     private Logger _logger = ReferenceManager.getInstance().getLogger();
114    
115     //---STATIC ATTRIBUTES---
116    
117     }