Class w3c.jigsaw.resources.ResourceFilter
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.resources.ResourceFilter

java.lang.Object
   |
   +----w3c.tools.store.AttributeHolder
           |
           +----w3c.tools.store.Resource
                   |
                   +----w3c.jigsaw.resources.ResourceFilter

public class ResourceFilter
extends Resource
implements HTTPFilter, ResourceShadower

Variable Index

 o ATTR_TARGET
Attribute index - Our target attribute.
 o target_attributes
Our target attribute description:
 o target_values
Our target shadowed values.

Constructor Index

 o ResourceFilter()

Method Index

 o definesTargetAttribute(int)
Does this filters defines the given target attribute.
 o definesTargetAttribute(String)
Does this filters defines the given target attribute.
 o getHelpURL()
Get this resource's help url.
 o getHelpURL(String)
Get the help URL for that resource's attribute.
 o getTargetAttributes()
Get our target attribute list.
 o getTargetResource()
Get our target resource.
 o getTargetValue(int, Object)
Get a shadowed attribute value.
 o getTargetValue(String, Object)
Get a shadowed attribute value (by name).
 o ingoingFilter(Request)
Simplified ingoingFilter API.
 o ingoingFilter(Request, HTTPFilter[], int)
The ingoingFilter method.
 o initialize(Object[])
Initialize the filter.
 o lookup(LookupState, LookupResult)
Lookup time filtering.
 o markModified()
Mark this filter as modified.
 o outgoingFilter(Request, Reply)
Simplified API to the outgoing filter metho.
 o outgoingFilter(Request, Reply, HTTPFilter[], int)
The outgoingFilter method.
 o pickle(DataOutputStream)
Pickle a filter.
 o setTargetValue(int, Object)
Set a shadow attribute value.
 o setTargetValue(String, Object)
Set a shadow attribute value.
 o unpickleInstance(DataInputStream, Hashtable, boolean)
Unpickle a resource filter.

Variables

 o ATTR_TARGET
  protected static int ATTR_TARGET
Attribute index - Our target attribute.
 o target_attributes
  protected Attribute target_attributes[]
Our target attribute description:
 o target_values
  protected Object target_values[]
Our target shadowed values.

Constructors

 o ResourceFilter
  public ResourceFilter()

Methods

 o getHelpURL
  public String getHelpURL()
Get this resource's help url.
Returns:
An URL, encoded as a String, or null if not available.
Overrides:
getHelpURL in class Resource
 o getHelpURL
  public String getHelpURL(String topic)
Get the help URL for that resource's attribute.
Parameters:
topic - The topic (can be an attribute name, or a property, etc).
Returns:
A String encoded URL, or null.
Overrides:
getHelpURL in class Resource
 o getTargetResource
  public Resource getTargetResource()
Get our target resource.
 o getTargetAttributes
  public Attribute[] getTargetAttributes()
Get our target attribute list.
 o getTargetValue
  public Object getTargetValue(int idx,
                               Object def)
Get a shadowed attribute value.
Parameters:
idx - The index of the attribute.
def - The default value to return if undef.
Returns:
The attribute value or the provided default value.
 o getTargetValue
  public Object getTargetValue(String name,
                               Object def)
Get a shadowed attribute value (by name).
Parameters:
name - The name of the attribute.
def - The default value to return if undef.
Returns:
The attribute value or the provided default value.
 o setTargetValue
  public void setTargetValue(int idx,
                             Object def)
Set a shadow attribute value.
Parameters:
idx - The index of the attribute to set.
value - Its new value.
 o setTargetValue
  public void setTargetValue(String name,
                             Object def)
Set a shadow attribute value.
Parameters:
name - The name of the attribute to set.
value - Its new value.
 o definesTargetAttribute
  public boolean definesTargetAttribute(int idx)
Does this filters defines the given target attribute.
Parameters:
idx - The index of the target attribute.
Returns:
A boolean true
 o definesTargetAttribute
  public boolean definesTargetAttribute(String name)
Does this filters defines the given target attribute.
Parameters:
name - The name of the target attribute.
Returns:
A boolean true
 o markModified
  public void markModified()
Mark this filter as modified. Delegate the dirty bit to our target.
Overrides:
markModified in class Resource
 o lookup
  public boolean lookup(LookupState ls,
                        LookupResult lr) throws HTTPException
Lookup time filtering. This method is called while Jigsaw performs resource lookup. Each time a lookup end up on the target resource of that filter, this method will be called.
Parameters:
ls - The current lookup state.
lr - The current lookup result.
Returns:
A boolean, true if this filter has performed the whole lookup, and side-effect the lookup result appropriatelly, false otherwise.
 o ingoingFilter
  public Reply ingoingFilter(Request request) throws HTTPException
Simplified ingoingFilter API. This is a default, simplified API to the ingoing filter method.
Parameters:
request - The request to filter.
Returns:
A Reply instance, or null if processing should continue normally.
Throws: HTTPException
If processing should be interrupted, because an abnormal situation occured.
 o ingoingFilter
  public Reply ingoingFilter(Request request,
                             HTTPFilter filters[],
                             int i) throws HTTPException
The ingoingFilter method. This is the method that really gets called by Jigsaw core. By default it will invoke the simpler ingoingFilter method, taking only the request has a parameter.
Parameters:
request - The request that is about to be handled.
filters - The whole filter list to be applied to the resource.
i - A pointer into the above array, indicating which filters have already been triggered (the one whose index are lower than i), and what filters have to be triggered (the one whose index are greater or equal to i+1).
Returns:
A Reply instance, if the filter did know how to answer the request without further processing, null otherwise.
 o outgoingFilter
  public Reply outgoingFilter(Request request,
                              Reply reply) throws HTTPException
Simplified API to the outgoing filter metho. This is a simplified API to the ougoing filter method, you can either overide this method, or the more powerfull one.
Parameters:
request - The original request.
reply - It's original reply.
Returns:
A Reply instance, or null if processing should continue normally.
Throws: HTTPException
If processing should be interrupted, because an abnormal situation occured.
 o outgoingFilter
  public Reply outgoingFilter(Request request,
                              Reply reply,
                              HTTPFilter filters[],
                              int fidx) throws HTTPException
The outgoingFilter method. This method is the one that gets called by Jigsaw core. By default it will call the simpler outgoingFilter method that takes only the request and the reply as parameters.
Parameters:
request - The request that has been processed.
reply - The original reply as emitted by the resource.
filters - The whole filter that applies to the resource.
i - The current index of filters. The i filter is ourself, filters with lower indexes have already been applied, and filters with greater indexes are still to be applied.
Returns:
A Reply instance, if that filter know how to complete the request processing, or null if reminaing filters are to be called by Jigsaw engine.
 o pickle
  public void pickle(DataOutputStream out) throws IOException
Pickle a filter. Pickle the filter attributes themselves, and than the set of shadow attribute values we maintain for our target.
Parameters:
out - The data output stream to pickle to.
Overrides:
pickle in class AttributeHolder
 o unpickleInstance
  public AttributeHolder unpickleInstance(DataInputStream in,
                                          Hashtable defs,
                                          boolean init) throws IOException
Unpickle a resource filter. Unpickle the attribute of the filter, and than the shadow attribute of our target.
Parameters:
in - The input stream to unpickle form.
defs - The default values for our shadow attributes.
init - Should the filter be initialized ?
Throws: IOException
If the input stream couldn't be read.
Overrides:
unpickleInstance in class AttributeHolder
 o initialize
  public void initialize(Object values[])
Initialize the filter.
Parameters:
values - The default attribute values.
Overrides:
initialize in class AttributeHolder

All Packages  Class Hierarchy  This Package  Previous  Next  Index