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
-
ATTR_TARGET
- Attribute index - Our target attribute.
-
CallOutgoing
- Return value for ingoingFilter.
-
DontCallOutgoing
- Return value for ingoingFilter.
-
ForceOutgoing
- Return value for ingoingFilter.
-
target_attributes
- Our target attribute description:
-
target_values
- Our target shadowed values.
-
ResourceFilter()
-
-
definesTargetAttribute(int)
- Does this filters defines the given target attribute.
-
definesTargetAttribute(String)
- Does this filters defines the given target attribute.
-
getTargetAttributes()
- Get our target attribute list.
-
getTargetResource()
- Get our target resource.
-
getTargetValue(int, Object)
- Get a shadowed attribute value.
-
getTargetValue(String, Object)
- Get a shadowed attribute value (by name).
-
ingoingFilter(Request)
- Filter the request before its processing.
-
initialize(Object[])
- Initialize the filter.
-
markModified()
- Mark this filter as modified.
-
outgoingFilter(Request, Reply)
- Filter the request after its processing.
-
pickle(DataOutputStream)
- Pickle a filter.
-
setTargetValue(int, Object)
- Set a shadow attribute value.
-
setTargetValue(String, Object)
- Set a shadow attribute value.
-
unpickleInstance(DataInputStream, Hashtable)
- Unpickle a resource filter.
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.
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.
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.
ATTR_TARGET
protected static int ATTR_TARGET
- Attribute index - Our target attribute.
target_attributes
protected Attribute target_attributes[]
- Our target attribute description:
target_values
protected Object target_values[]
- Our target shadowed values.
ResourceFilter
public ResourceFilter()
getTargetResource
public Resource getTargetResource()
- Get our target resource.
getTargetAttributes
public Attribute[] getTargetAttributes()
- Get our target attribute list.
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.
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.
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.
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.
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
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
markModified
public void markModified()
- Mark this filter as modified.
Delegate the dirty bit to our target.
- Overrides:
- markModified in class Resource
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
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
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
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
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