org.ow2.clif.analyze.statistics
Class BladeFilterImpl

java.lang.Object
  extended by org.ow2.clif.analyze.statistics.BladeFilterImpl
All Implemented Interfaces:
java.io.Serializable, Constants, BladeFilter

public class BladeFilterImpl
extends java.lang.Object
implements BladeFilter, Constants

Instances of this class filter blade descriptors according to what you want.. this implementation aims to filter blades by event type (shorcut of class name) or by blade identifier.

Author:
Guy Vachet
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.ow2.clif.analyze.statistics.Constants
ACTION_EVENT_CLASS, ACTION_EVENT_TYPE_LABEL, ALARM_EVENT_CLASS, ALARM_EVENT_TYPE_LABEL, BLADE_STATE_COMPLETED_CODE, BLADE_STATE_INITIALIZED_CODE, BLADE_STATE_RUNNING_CODE, BLADE_STATE_STARTING_CODE, BLADE_STATE_STOPPING_CODE, BUFFERED_EVENT_FIELD_LABEL, CACHED_EVENT_FIELD_LABEL, COMMENT_PREFIX, CPU_EVENT_CLASS, CPU_EVENT_FIELD_LABEL, CPU_EVENT_TYPE_LABEL, DATA_POWER_SNMP_EVENT_CLASS, DATA_POWER_SNMP_EVENT_FIELD_LABEL, DEFAULT_ANALYZE_PROPERTY_FILE, DEFAULT_IS_DETAILED_ANALYSIS, DEFAULT_IS_OUTPUT_FILE, DEFAULT_MAX_TIME, DEFAULT_MIN_TIME, DEFAULT_REGEX_CTRL_ACTION, DEFAULT_REPORT_PATH, DEFAULT_RESULT_PATH, DEFAULT_SLICE_SIZE, DEFAULT_STATISTICAL_SORT_FACTOR, DEFAULT_STATISTICAL_SORT_RATIO, DEFAULT_TIME_RANGE_END, DEFAULT_TIME_RANGE_START, DURATION_EVENT_FIELD_LABEL, FREE_MEMORY_EVENT_FIELD_LABEL, FREE_USABLE_MEMORY_EVENT_FIELD_LABEL, GC_ARGUMENT, INJECTOR_FREQUENCY_CLASS_NUMBER, INJECTOR_QUANTILE_CLASS_NUMBER, JVM_EVENT_CLASS, JVM_EVENT_TYPE_LABEL, KERNEL_CPU_EVENT_FIELD_LABEL, LIFECYCLE_EVENT_CLASS, LIFECYCLE_EVENT_TYPE_LABEL, MEMORY_EVENT_CLASS, MEMORY_EVENT_TYPE_LABEL, NETWORK_EVENT_CLASS, NETWORK_EVENT_TYPE_LABEL, PROBE_FREQUENCY_CLASS_NUMBER, RESULT_EVENT_FIELD_LABEL, SUCCESS_EVENT_FIELD_LABEL, USED_MEMORY_EVENT_FIELD_LABEL, USED_RAM_EVENT_FIELD_LABEL, USED_SWAP_EVENT_FIELD_LABEL, USER_CPU_EVENT_FIELD_LABEL
 
Constructor Summary
BladeFilterImpl()
          Creates a new filter for blades with any filtering, which means all blades will be retained by this new filter.
 
Method Summary
 boolean accept(BladeDescriptor desc)
          Filters blade descriptors according to the blade id and event type.
 void addEventFilter(java.lang.String eventTypeLabel)
          add a new blade filter for blade descriptors with the given event type
 void addIdFilter(java.lang.String bladeId)
          add a new blade filter for blade descriptors with the given id.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BladeFilterImpl

public BladeFilterImpl()
Creates a new filter for blades with any filtering, which means all blades will be retained by this new filter.

Method Detail

addEventFilter

public void addEventFilter(java.lang.String eventTypeLabel)
add a new blade filter for blade descriptors with the given event type

Parameters:
eventTypeLabel - only blades with the given event will be retained by this filter. If null, all blades will be retained.

addIdFilter

public void addIdFilter(java.lang.String bladeId)
add a new blade filter for blade descriptors with the given id.

Parameters:
bladeId - only blades with the given id will be retained by this filter. If null, all blades will be retained.

accept

public boolean accept(BladeDescriptor desc)
Filters blade descriptors according to the blade id and event type.

Specified by:
accept in interface BladeFilter
Parameters:
desc - the blade descriptor or accept or reject
Returns:
true if the event name of the given blade descriptor equals to this filter's or if the blade id of the given blade descriptor matchs the identifier list, false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object