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

Class w3c.jigsaw.resources.ResourceFilter

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

public class ResourceFilter
extends Resource
implements ResourceShadower

Variable Index

 o ATTR_TARGET
Attribute index - Our target attribute.
 o CallOutgoing
Return value for ingoingFilter.
 o DontCallOutgoing
Return value for ingoingFilter.
 o ForceOutgoing
Return value for ingoingFilter.
 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 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)
Filter the request before its processing.
 o initialize(Object[])
Initialize the filter.
 o markModified()
Mark this filter as modified.
 o outgoingFilter(Request, Reply)
Filter the request after its processing.
 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)
Unpickle a resource filter.

Variables

 o DontCallOutgoing
  public final static int DontCallOutgoing
Return value for ingoingFilter. Don't call the outgoingFilter. When this value is returned by the ingoingFilter, the outgoingFilter won't be called.
 o CallOutgoing
  public final static int CallOutgoing
Return value for ingoingFilter. Call outgoin if no errors. When returned by the ingoingFilter, and no error occured while processing the request, the outgoingFilter will be called.
 o ForceOutgoing
  public final static int ForceOutgoing
Return value for ingoingFilter. Call outgoing even if error occured. When returned byt the ingoingFilter, the outgoingFilter will be called, even if some error occured.
 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 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 ingoingFilter
  public int ingoingFilter(Request request) throws HTTPException
Filter the request before its processing. This method gets called before any actual processing occurs on the given request. Each filter that gets its ingoingFilter method called, is guaranteed to have its outgoingFilter on the way back.

Finally, directory entities should trigger a call to their filters even when the operation is simple a name lookup.

Parameters:
client - The client issuing the request.
request - The request to be filtered.
Returns:
An integer, one of DontCallOutgoing, CallOutgoing or ForceOutgoing, as defined in this class.
See Also:
FilteredResource
 o outgoingFilter
  public Reply outgoingFilter(Request request,
                              Reply reply) throws HTTPException
Filter the request after its processing. This method gets called after the entity has managed the request. This is the right place to implement such things as on the fly content conversion.
Parameters:
client - The client issuing the request.
request - The requested being processed.
reply - The actual reply, as emitted by the originial entity.
Throws: HTTPException
If the filter wants to send back an HTTP error instead of a normal reply
 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) 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.
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