org.norther.tammi.sprig.chart
Class DefaultChartFilter

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.spray.filter.DefaultFilter
          extended by org.norther.tammi.sprig.chart.DefaultChartFilter
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Filter, Manageable, MBeanDelegate, ChartFilter

public class DefaultChartFilter
extends DefaultFilter
implements ChartFilter

A default implementation of ChartFilter.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE
 
Constructor Summary
DefaultChartFilter()
          Constructs a new filter.
 
Method Summary
 String encode(ChartLayout layout, String extension, int quality, ServletRequest request, ServletResponse response, FilterChain chain)
          Encodes the specified layout with the specified quality and returns a temporary path to it.
 String encode(ChartLayout layout, String extension, ServletRequest request, ServletResponse response, FilterChain chain)
          Encodes the specified layout and returns a temporary path to it.
 ChartLayout generate(ChartModel[] data, int type, int orientation, int order, int index, ServletRequest request, ServletResponse response, FilterChain chain)
          Generates an ordered layout from the specified models.
 ChartLayout generate(ChartModel[] data, int type, int orientation, ServletRequest request, ServletResponse response, FilterChain chain)
          Generates a layout from the specified models.
 ChartLayout generate(ChartModel data, int type, int orientation, int order, int index, ServletRequest request, ServletResponse response, FilterChain chain)
          Generates an ordered layout from the specified model.
 ChartLayout generate(ChartModel data, int type, int orientation, ServletRequest request, ServletResponse response, FilterChain chain)
          Generates a layout from the specified model.
 ObjectName getChartGeneratorName()
          Gets the chart generator of this filter.
 void postmanaged()
          This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.
 void setChartGeneratorName(ObjectName engine)
          Sets the chart generator of this filter.
 void unmanaged()
          This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.
 
Methods inherited from class org.norther.tammi.spray.filter.DefaultFilter
destroy, doFilter, getFilterConfig, getRequestMap, getSessionMap, init
 
Methods inherited from class org.norther.tammi.core.base.Adaptee
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.Filter
destroy, doFilter, init
 

Constructor Detail

DefaultChartFilter

public DefaultChartFilter()
Constructs a new filter.

Method Detail

postmanaged

public void postmanaged()
Description copied from interface: Manageable
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.

Specified by:
postmanaged in interface Manageable
Overrides:
postmanaged in class Adaptee

unmanaged

public void unmanaged()
               throws Exception
Description copied from interface: Manageable
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.

Specified by:
unmanaged in interface Manageable
Overrides:
unmanaged in class Adaptee
Throws:
Exception - if the adaptee refused to be unmanaged.

getChartGeneratorName

public ObjectName getChartGeneratorName()
Description copied from interface: ChartFilter
Gets the chart generator of this filter.

Specified by:
getChartGeneratorName in interface ChartFilter
Returns:
the object name of the chart generator or a query.

setChartGeneratorName

public void setChartGeneratorName(ObjectName engine)
Description copied from interface: ChartFilter
Sets the chart generator of this filter. If it is not set, the default one will be used.

Specified by:
setChartGeneratorName in interface ChartFilter
Parameters:
engine - the object name of the chart generator or a query.

generate

public ChartLayout generate(ChartModel data,
                            int type,
                            int orientation,
                            ServletRequest request,
                            ServletResponse response,
                            FilterChain chain)
                     throws LogException
Description copied from interface: ChartFilter
Generates a layout from the specified model.

Specified by:
generate in interface ChartFilter
Parameters:
data - the data model.
type - the chart type.
orientation - the orientation.
request - the request.
response - the response.
chain - the filter chain.
Returns:
the generated layout.
Throws:
LogException - on errors.

generate

public ChartLayout generate(ChartModel[] data,
                            int type,
                            int orientation,
                            ServletRequest request,
                            ServletResponse response,
                            FilterChain chain)
                     throws LogException
Description copied from interface: ChartFilter
Generates a layout from the specified models.

Specified by:
generate in interface ChartFilter
Parameters:
data - the data models.
type - the chart type.
orientation - the orientation.
request - the request.
response - the response.
chain - the filter chain.
Returns:
the generated layout.
Throws:
LogException - on errors.

generate

public ChartLayout generate(ChartModel data,
                            int type,
                            int orientation,
                            int order,
                            int index,
                            ServletRequest request,
                            ServletResponse response,
                            FilterChain chain)
                     throws LogException
Description copied from interface: ChartFilter
Generates an ordered layout from the specified model.

Specified by:
generate in interface ChartFilter
Parameters:
data - the data model.
type - the chart type.
orientation - the orientation.
order - the model order.
index - the model index.
request - the request.
response - the response.
chain - the filter chain.
Returns:
the generated layout.
Throws:
LogException - on errors.

generate

public ChartLayout generate(ChartModel[] data,
                            int type,
                            int orientation,
                            int order,
                            int index,
                            ServletRequest request,
                            ServletResponse response,
                            FilterChain chain)
                     throws LogException
Description copied from interface: ChartFilter
Generates an ordered layout from the specified models.

Specified by:
generate in interface ChartFilter
Parameters:
data - the data models.
type - the chart type.
orientation - the orientation.
order - the model order.
index - the model index.
request - the request.
response - the response.
chain - the filter chain.
Returns:
the generated layout.
Throws:
LogException - on errors.

encode

public String encode(ChartLayout layout,
                     String extension,
                     ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws LogException
Description copied from interface: ChartFilter
Encodes the specified layout and returns a temporary path to it.

Specified by:
encode in interface ChartFilter
Parameters:
layout - the layout.
extension - the encode type.
request - the request.
response - the response.
chain - the filter chain.
Returns:
a path to the encoded chart.
Throws:
LogException - on errors.

encode

public String encode(ChartLayout layout,
                     String extension,
                     int quality,
                     ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws LogException
Description copied from interface: ChartFilter
Encodes the specified layout with the specified quality and returns a temporary path to it.

Specified by:
encode in interface ChartFilter
Parameters:
layout - the layout.
extension - the encode type.
quality - the quality (0 - 100 %).
request - the request.
response - the response.
chain - the filter chain.
Returns:
a path to the encoded chart.
Throws:
LogException - on errors.


Copyright © 2004 The Norther Organization. All rights reserved.